From c802368c86726fc3d18d9705bc7b4cddfedc843f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 17 Jul 2016 10:49:59 +0100
Subject: replace http server with test version
---
bin/HttpServer_OpenSim.dll | Bin 117248 -> 130560 bytes
bin/HttpServer_OpenSim.pdb | Bin 323072 -> 355840 bytes
bin/HttpServer_OpenSim.xml | 5574 --------------------------------------------
3 files changed, 5574 deletions(-)
delete mode 100644 bin/HttpServer_OpenSim.xml
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index 5db99ef..2730e17 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index 25b6760..8299d80 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
diff --git a/bin/HttpServer_OpenSim.xml b/bin/HttpServer_OpenSim.xml
deleted file mode 100644
index 7b6912e..0000000
--- a/bin/HttpServer_OpenSim.xml
+++ /dev/null
@@ -1,5574 +0,0 @@
-
-
-
- HttpServer_OpenSim
-
-
-
-
- Delegate used to let authentication modules authenticate the user name and password.
-
- Realm that the user want to authenticate in
- User name specified by client
- Can either be user password or implementation specific token.
- object that will be stored in a session variable called if authentication was successful.
- throw forbidden exception if too many attempts have been made.
-
-
- Use to specify that the token is a HA1 token. (MD5 generated
- string from realm, user name and password); Md5String(userName + ":" + realm + ":" + password);
-
-
-
-
-
- Let's you decide on a system level if authentication is required.
-
- HTTP request from client
- true if user should be authenticated.
- throw if no more attempts are allowed.
- If no more attempts are allowed
-
-
-
- Authentication modules are used to implement different
- kind of HTTP authentication.
-
-
-
-
- Initializes a new instance of the class.
-
- Delegate used to provide information used during authentication.
- Delegate used to determine if authentication is required (may be null).
-
-
-
- Initializes a new instance of the class.
-
- Delegate used to provide information used during authentication.
-
-
-
- name used in HTTP request.
-
-
-
-
- Tag used for authentication.
-
-
-
-
- Create a response that can be sent in the WWW-Authenticate header.
-
- Realm that the user should authenticate in
- Array with optional options.
- A correct authentication request.
- If realm is empty or null.
-
-
-
- An authentication response have been received from the web browser.
- Check if it's correct
-
- Contents from the Authorization header
- Realm that should be authenticated
- GET/POST/PUT/DELETE etc.
- options to specific implementations
- Authentication object that is stored for the request. A user class or something like that.
- if is invalid
- If any of the parameters is empty or null.
-
-
-
- Used to invoke the authentication delegate that is used to lookup the user name/realm.
-
- Realm (domain) that user want to authenticate in
- User name
- Password used for validation. Some implementations got password in clear text, they are then sent to client.
- object that will be stored in the request to help you identify the user if authentication was successful.
- true if authentication was successful
-
-
-
- Determines if authentication is required.
-
- HTTP request from browser
- true if user should be authenticated.
- throw from your delegate if no more attempts are allowed.
- If no more attempts are allowed
-
-
-
- The "basic" authentication scheme is based on the model that the
- client must authenticate itself with a user-ID and a password for
- each realm. The realm value should be considered an opaque string
- which can only be compared for equality with other realms on that
- server. The server will service the request only if it can validate
- the user-ID and password for the protection space of the Request-URI.
- There are no optional authentication parameters.
-
-
-
-
- Initializes a new instance of the class.
-
- Delegate used to provide information used during authentication.
- Delegate used to determine if authentication is required (may be null).
-
-
-
- Initializes a new instance of the class.
-
- Delegate used to provide information used during authentication.
-
-
-
- Create a response that can be sent in the WWW-Authenticate header.
-
- Realm that the user should authenticate in
- Not used in basic auth
- A correct auth request.
-
-
-
- An authentication response have been received from the web browser.
- Check if it's correct
-
- Contents from the Authorization header
- Realm that should be authenticated
- GET/POST/PUT/DELETE etc.
- Not used in basic auth
- Authentication object that is stored for the request. A user class or something like that.
- if authenticationHeader is invalid
- If any of the paramters is empty or null.
-
-
-
- name used in http request.
-
-
-
-
- Implements HTTP Digest authentication. It's more secure than Basic auth since password is
- encrypted with a "key" from the server.
-
-
- Keep in mind that the password is encrypted with MD5. Use a combination of SSL and digest auth to be secure.
-
-
-
-
- Initializes a new instance of the class.
-
- Delegate used to provide information used during authentication.
- Delegate used to determine if authentication is required (may be null).
-
-
-
- Initializes a new instance of the class.
-
- Delegate used to provide information used during authentication.
-
-
-
- Used by test classes to be able to use hardcoded values
-
-
-
-
- name used in http request.
-
-
-
-
- An authentication response have been received from the web browser.
- Check if it's correct
-
- Contents from the Authorization header
- Realm that should be authenticated
- GET/POST/PUT/DELETE etc.
- First option: true if username/password is correct but not cnonce
-
- Authentication object that is stored for the request. A user class or something like that.
-
- if authenticationHeader is invalid
- If any of the paramters is empty or null.
-
-
-
- Gets or sets whether the token supplied in is a
- HA1 generated string.
-
-
-
-
- Encrypts parameters into a Digest string
-
- Realm that the user want to log into.
- User logging in
- Users password.
- HTTP method.
- Uri/domain that generated the login prompt.
- Quality of Protection.
- "Number used ONCE"
- Hexadecimal request counter.
- "Client Number used ONCE"
- Digest encrypted string
-
-
-
-
-
- Md5 hex encoded "userName:realm:password", without the quotes.
- Md5 hex encoded "method:uri", without the quotes
- Quality of Protection
- "Number used ONCE"
- Hexadecimal request counter.
- Client number used once
-
-
-
-
- Create a response that can be sent in the WWW-Authenticate header.
-
- Realm that the user should authenticate in
- First options specifies if true if username/password is correct but not cnonce.
- A correct auth request.
- If realm is empty or null.
-
-
-
- Decodes authorization header value
-
- header value
- Encoding that the buffer is in
- All headers and their values if successful; otherwise null
-
- NameValueCollection header = DigestAuthentication.Decode("response=\"6629fae49393a05397450978507c4ef1\",\r\nc=00001", Encoding.ASCII);
-
- Can handle lots of whitespaces and new lines without failing.
-
-
-
- Gets the current nonce.
-
-
-
-
-
- Gets the Md5 hash bin hex2.
-
- To be hashed.
-
-
-
-
- determines if the nonce is valid or has expired.
-
- nonce value (check wikipedia for info)
- true if the nonce has not expired.
-
-
-
- Small design by contract implementation.
-
-
-
-
- Check whether a parameter is empty.
-
- Parameter value
- Parameter name, or error description.
- value is empty.
-
-
-
- Checks whether a parameter is null.
-
- Parameter value
- Parameter name, or error description.
- value is null.
-
-
-
- Checks whether a parameter is null.
-
-
- Parameter value
- Parameter name, or error description.
- value is null.
-
-
-
- Invoked when a client have been accepted by the
-
-
- Can be used to revoke incoming connections
-
-
-
-
- Initializes a new instance of the class.
-
- The socket.
-
-
-
- Accepted socket.
-
-
-
-
- Client should be revoked.
-
-
-
-
- Client may not be handled.
-
-
-
-
- Add a component instance
-
- Interface type
- Instance to add
-
-
-
- Get a component.
-
- Interface type
- Component if registered, otherwise null.
-
- Component will get created if needed.
-
-
-
- If instance cannot be created.
-
-
-
- Checks if the specified component interface have been added.
-
-
- true if found; otherwise false.
-
-
-
- Add a component.
-
- Type being requested.
- Type being created.
- Type have already been mapped.
-
-
-
- Lists content type mime types.
-
-
-
-
- text/plain
-
-
-
-
- text/haml
-
-
-
-
- content type for javascript documents = application/javascript
-
-
-
- RFC 4329 states that text/javascript have been superseeded by
- application/javascript. You might still want to check browser versions
- since older ones do not support application/javascript.
-
- Browser support: http://krijnhoetmer.nl/stuff/javascript/mime-types/
-
-
-
-
- text/xml
-
-
-
-
- A list of content types
-
-
-
-
-
-
- Semicolon separated content types.
-
-
-
- Get this first content type.
-
-
-
-
- Fetch a content type
-
- Part of type ("xml" would return "application/xml")
-
- All content types are in lower case.
-
-
-
- Returns an enumerator that iterates through a collection.
-
-
- An object that can be used to iterate through the collection.
-
-
-
-
- Searches for the specified type
-
- Can also be a part of a type (searching for "xml" would return true for "application/xml").
- true if type was found.
-
-
-
- Timeout Manager. Checks for dead clients. Clients with open connections that are not doing anything. Closes sessions opened with keepalive.
-
-
-
-
- Use a Thread or a Timer to monitor the ugly
-
-
-
-
- Causes the watcher to immediately check the connections.
-
-
-
-
- Environment.TickCount is an int but it counts all 32 bits so it goes positive
- and negative every 24.9 days. This trims down TickCount so it doesn't wrap
- for the callers.
- This trims it to a 12 day interval so don't let your frame time get too long.
-
-
-
-
-
- Environment.TickCount is an int but it counts all 32 bits so it goes positive
- and negative every 24.9 days. Subtracts the passed value (previously fetched by
- 'EnvironmentTickCount()') and accounts for any wrapping.
-
-
-
- subtraction of passed prevValue from current Environment.TickCount
-
-
-
- Environment.TickCount is an int but it counts all 32 bits so it goes positive
- and negative every 24.9 days. Subtracts the passed value (previously fetched by
- 'EnvironmentTickCount()') and accounts for any wrapping.
-
-
-
- subtraction of passed prevValue from current Environment.TickCount
-
-
-
- Environment.TickCount is an int but it counts all 32 bits so it goes positive
- and negative every 24.9 days. Subtracts the passed value (previously fetched by
- 'EnvironmentTickCount()') and accounts for any wrapping.
-
- subtraction of passed prevValue from current Environment.TickCount
-
-
-
- We dont want to let the server to die due to exceptions thrown in worker threads.
- therefore we use this delegate to give you a change to handle uncaught exceptions.
-
- Class that the exception was thrown in.
- Exception
-
- Server will throw a InternalServerException in release version if you dont
- handle this delegate.
-
-
-
-
- The request could not be understood by the server due to malformed syntax.
- The client SHOULD NOT repeat the request without modifications.
-
- Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php
-
-
-
-
- Create a new bad request exception.
-
- reason to why the request was bad.
-
-
-
- Create a new bad request exception.
-
- reason to why the request was bad.
- inner exception
-
-
-
- The server understood the request, but is refusing to fulfill it.
- Authorization will not help and the request SHOULD NOT be repeated.
- If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled,
- it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information
- available to the client, the status code 404 (Not Found) can be used instead.
-
- Text taken from: http://www.submissionchamber.com/help-guides/error-codes.php
-
-
-
-
- Initializes a new instance of the class.
-
- error message
-
-
-
- All HTTP based exceptions will derive this class.
-
-
-
-
- Create a new HttpException
-
- http status code (sent in the response)
- error description
-
-
-
- Create a new HttpException
-
- http status code (sent in the response)
- error description
- inner exception
-
-
-
- status code to use in the response.
-
-
-
-
- The server encountered an unexpected condition which prevented it from fulfilling the request.
-
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- error message.
-
-
-
- Initializes a new instance of the class.
-
- error message.
- inner exception.
-
-
-
- The requested resource was not found in the web server.
-
-
-
-
- Create a new exception
-
- message describing the error
- inner exception
-
-
-
- Create a new exception
-
- message describing the error
-
-
-
- The request requires user authentication. The response MUST include a
- WWW-Authenticate header field (section 14.47) containing a challenge
- applicable to the requested resource.
-
- The client MAY repeat the request with a suitable Authorization header
- field (section 14.8). If the request already included Authorization
- credentials, then the 401 response indicates that authorization has been
- refused for those credentials. If the 401 response contains the same challenge
- as the prior response, and the user agent has already attempted authentication
- at least once, then the user SHOULD be presented the entity that was given in the response,
- since that entity might include relevant diagnostic information.
-
- HTTP access authentication is explained in rfc2617:
- http://www.ietf.org/rfc/rfc2617.txt
-
- (description is taken from
- http://www.submissionchamber.com/help-guides/error-codes.php#sec10.4.2)
-
-
-
-
- Create a new unauhtorized exception.
-
-
-
-
-
- Create a new unauhtorized exception.
-
- reason to why the request was unauthorized.
- inner exception
-
-
-
- Create a new unauhtorized exception.
-
- reason to why the request was unauthorized.
-
-
-
- This provider is used to let us implement any type of form decoding we want without
- having to rewrite anything else in the server.
-
-
-
-
-
-
- Should contain boundary and type, as in: multipart/form-data; boundary=---------------------------230051238959
- Stream containing form data.
- Encoding used when decoding the stream
- if no parser was found.
- If stream is null or not readable.
- If stream contents cannot be decoded properly.
-
-
-
- Add a decoder.
-
-
-
-
-
-
- Number of added decoders.
-
-
-
-
- Use with care.
-
-
-
-
- Decoder used for unknown content types.
-
-
-
- Represents a field in a multipart form
-
-
-
-
-
-
-
-
-
-
-
- Interface for form content decoders.
-
-
-
-
-
-
- Stream containing the content
- Content type (with any additional info like boundry). Content type is always supplied in lower case
- Stream enconding
- A http form, or null if content could not be parsed.
- If contents in the stream is not valid input data.
-
-
-
- Checks if the decoder can handle the mime type
-
- Content type (with any additional info like boundry). Content type is always supplied in lower case.
- True if the decoder can parse the specified content type
-
-
-
-
-
-
- http://www.faqs.org/rfcs/rfc1867.html
-
-
-
-
- multipart/form-data
-
-
-
-
- form-data
-
-
-
-
-
-
- Stream containing the content
- Content type (with any additional info like boundry). Content type is always supplied in lower case
- Stream enconding
- A http form, or null if content could not be parsed.
- If contents in the stream is not valid input data.
- If any parameter is null
-
-
-
- Checks if the decoder can handle the mime type
-
- Content type (with any additional info like boundry). Content type is always supplied in lower case.
- True if the decoder can parse the specified content type
-
-
-
- Can handle application/x-www-form-urlencoded
-
-
-
-
-
- Stream containing the content
- Content type (with any additional info like boundry). Content type is always supplied in lower case
- Stream encoding
-
- A HTTP form, or null if content could not be parsed.
-
- If contents in the stream is not valid input data.
-
-
-
- Checks if the decoder can handle the mime type
-
- Content type (with any additional info like boundry). Content type is always supplied in lower case.
- True if the decoder can parse the specified content type
-
-
-
- This decoder converts XML documents to form items.
- Each element becomes a subitem in the form, and each attribute becomes an item.
-
-
- // xml: somethingdata
- // result:
- // form["hello"].Value = "something"
- // form["hello"]["id"].Value = 1
- // form["hello"]["world]["id"].Value = 1
- // form["hello"]["world"].Value = "data"
-
-
- The original xml document is stored in form["__xml__"].Value.
-
-
-
-
-
-
- Stream containing the content
- Content type (with any additional info like boundry). Content type is always supplied in lower case
- Stream encoding
- Note: contentType and encoding are not used?
- A http form, or null if content could not be parsed.
-
-
-
-
- Recursive function that will go through an xml element and store it's content
- to the form item.
-
- (parent) Item in form that content should be added to.
- Node that should be parsed.
-
-
-
- Checks if the decoder can handle the mime type
-
- Content type (with any additional info like boundry). Content type is always supplied in lower case.
- True if the decoder can parse the specified content type
-
-
-
- Helpers making it easier to work with forms.
-
-
-
-
-
- Used to let the website use different JavaScript libraries.
- Default is
-
-
-
-
- Create a <form> tag.
-
- name of form
- action to invoke on submit
- form should be posted as Ajax
- HTML code
-
-
- // without options
- WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax);
-
- // with options
- WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax, "style", "display:inline", "class", "greenForm");
-
-
- HTML attributes or JavaScript options.
- Method will ALWAYS be POST.
- options must consist of name, value, name, value
-
-
-
- Creates a select list with the values in a collection.
-
- Name of the SELECT-tag
- collection used to generate options.
- delegate used to return id and title from objects.
- value that should be marked as selected.
- First row should contain an empty value.
- string containing a SELECT-tag.
-
-
-
-
- Creates a select list with the values in a collection.
-
- Name of the SELECT-tag
- Id of the SELECT-tag
- collection used to generate options.
- delegate used to return id and title from objects.
- value that should be marked as selected.
- First row should contain an empty value.
- string containing a SELECT-tag.
-
-
-
- // Class that is going to be used in a SELECT-tag.
- public class User
- {
- private readonly string _realName;
- private readonly int _id;
- public User(int id, string realName)
- {
- _id = id;
- _realName = realName;
- }
- public string RealName
- {
- get { return _realName; }
- }
-
- public int Id
- {
- get { return _id; }
- }
- }
-
- // Using an inline delegate to generate the select list
- public void UserInlineDelegate()
- {
- List<User> items = new List<User>();
- items.Add(new User(1, "adam"));
- items.Add(new User(2, "bertial"));
- items.Add(new User(3, "david"));
- string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value)
- {
- User user = (User)o;
- id = user.Id;
- value = user.RealName;
- }, 2, true);
- }
-
- // Using an method as delegate to generate the select list.
- public void UseExternalDelegate()
- {
- List<User> items = new List<User>();
- items.Add(new User(1, "adam"));
- items.Add(new User(2, "bertial"));
- items.Add(new User(3, "david"));
- string htmlSelect = Select("users", "users", items, UserOptions, 1, true);
- }
-
- // delegate returning id and title
- public static void UserOptions(object o, out object id, out object title)
- {
- User user = (User)o;
- id = user.Id;
- value = user.RealName;
- }
-
-
- name, id, collection or getIdTitle is null.
-
-
-
- Creates a select list with the values in a collection.
-
- Name of the SELECT-tag
- Id of the SELECT-tag
- collection used to generate options.
- delegate used to return id and title from objects.
- value that should be marked as selected.
- First row should contain an empty value.
- name, value collection of extra HTML attributes.
- string containing a SELECT-tag.
-
- name, id, collection or getIdTitle is null.
- Invalid HTML attribute list.
-
-
-
- Generate a list of HTML options
-
- collection used to generate options.
- delegate used to return id and title from objects.
- value that should be marked as selected.
- First row should contain an empty value.
-
- collection or getIdTitle is null.
-
-
- sb is null.
-
-
-
- Creates a check box.
-
- element name
- element value
- determines if the check box is selected or not. This is done differently depending on the
- type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if
- the box is checked or not.
- a list with additional attributes (name, value, name, value).
- a generated radio button
-
-
-
- Creates a check box.
-
- element name
- element id
- element value
- determines if the check box is selected or not. This is done differently depending on the
- type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if
- the box is checked or not.
- a list with additional attributes (name, value, name, value).
- a generated radio button
-
- value in your business object. (check box will be selected if it matches the element value)
-
-
-
-
- Creates a check box.
-
- element name
- element id
- determines if the check box is selected or not. This is done differently depending on the
- type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if
- the box is checked or not.
- a list with additional attributes (name, value, name, value).
- a generated radio button
- will set value to "1".
-
-
-
- Creates a RadioButton.
-
- element name
- element value
- determines if the radio button is selected or not. This is done differently depending on the
- type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if
- the box is checked or not.
- a list with additional attributes (name, value, name, value).
- a generated radio button
-
-
-
- Creates a RadioButton.
-
- element name
- element id
- element value
- determines if the radio button is selected or not. This is done differently depending on the
- type of variable. A boolean simply triggers checked or not, all other types are compared with "value" to determine if
- the box is checked or not.
- a list with additional attributes (name, value, name, value).
- a generated radio button
-
-
-
- form close tag
-
-
-
-
-
- Delegate used by to populate select options.
-
- current object (for instance a User).
- Text that should be displayed in the value part of a <optiongt;-tag.
- Text shown in the select list.
-
- // Class that is going to be used in a SELECT-tag.
- public class User
- {
- private readonly string _realName;
- private readonly int _id;
- public User(int id, string realName)
- {
- _id = id;
- _realName = realName;
- }
- public string RealName
- {
- get { return _realName; }
- }
-
- public int Id
- {
- get { return _id; }
- }
- }
-
- // Using an inline delegate to generate the select list
- public void UserInlineDelegate()
- {
- List<User> items = new List<User>();
- items.Add(new User(1, "adam"));
- items.Add(new User(2, "bertial"));
- items.Add(new User(3, "david"));
- string htmlSelect = Select("users", "users", items, delegate(object o, out object id, out object value)
- {
- User user = (User)o;
- id = user.Id;
- value = user.RealName;
- }, 2, true);
- }
-
- // Using an method as delegate to generate the select list.
- public void UseExternalDelegate()
- {
- List<User> items = new List<User>();
- items.Add(new User(1, "adam"));
- items.Add(new User(2, "bertial"));
- items.Add(new User(3, "david"));
- string htmlSelect = Select("users", "users", items, UserOptions, 1, true);
- }
-
- // delegate returning id and title
- public static void UserOptions(object o, out object id, out object title)
- {
- User user = (User)o;
- id = user.Id;
- value = user.RealName;
- } ///
-
-
-
- PrototypeJS implementation of the javascript functions.
-
-
-
-
- Requests a url through ajax
-
- url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.
- optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.
- a link tag
- onclick attribute is used by this method.
-
-
- // plain text
- JSHelper.AjaxRequest("'/user/show/1'");
-
- // ajax request using this.href
- string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>";
-
-
-
-
-
- Determins if a list of strings contains a specific value
-
- options to check in
- value to find
- true if value was found
- case insensitive
-
-
-
- Ajax requests that updates an element with
- the fetched content
-
- URL to fetch. URL is NOT enclosed in quotes by the implementation. You need to do that yourself.
- element to update
- options in format "key, value, key, value". All keys should end with colon.
- A link tag.
-
-
- JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true");
-
-
-
-
-
- A link that pop ups a Dialog (overlay div)
-
- URL to contents of dialog
- link title
- name, value, name, value
-
- A "a"-tag that popups a dialog when clicked
-
- Requires Control.Modal found here: http://livepipe.net/projects/control_modal/
- And the following JavaScript (load it in application.js):
-
- Event.observe(window, 'load',
- function() {
- document.getElementsByClassName('modal').each(function(link){ new Control.Modal(link); });
- }
- );
-
-
-
- WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');");
-
-
-
-
- create a modal dialog (usually using DIVs)
-
- url to fetch
- dialog title
- javascript/html attributes. javascript options ends with colon ':'.
-
-
-
-
- Close a javascript dialog window/div.
-
- javascript for closing a dialog.
-
-
-
-
- javascript action that should be added to the "onsubmit" event in the form tag.
-
- remember to encapsulate strings in ''
-
- All javascript option names should end with colon.
-
-
- JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);");
-
-
-
-
-
- Will contain helper functions for javascript.
-
-
-
-
- Requests a url through ajax
-
- url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.
- optional options in format "key, value, key, value", used in JS request object. All keys should end with colon.
- a link tag
- onclick attribute is used by this method.
-
-
- // plain text
- JSHelper.AjaxRequest("'/user/show/1'");
-
- // ajax request using this.href
- string link = "<a href=\"/user/call/1\" onclick=\"" + JSHelper.AjaxRequest("this.href") + "/<call user</a>";
-
-
-
-
-
- Ajax requests that updates an element with
- the fetched content
-
- url to fetch. Url is NOT enclosed in quotes by the implementation. You need to do that yourself.
- element to update
- options in format "key, value, key, value". All keys should end with colon.
- A link tag.
-
-
- JSHelper.AjaxUpdater("'/user/show/1'", "user", "onsuccess:", "alert('hello');", "asynchronous:", "true");
-
-
-
-
-
- Opens contents in a dialog window.
-
- url to contents of dialog
- link title
- name, value, name, value, all parameter names should end with colon.
-
-
-
- Close a javascript dialog window/div.
-
- javascript for closing a dialog.
-
-
-
-
- The object form class takes an object and creates form items for it.
-
-
-
-
- Initializes a new instance of the class.
-
-
- form name *and* id.
- action to do when form is posted.
-
-
-
-
- Initializes a new instance of the class.
-
- form name *and* id.
- action to do when form is posted.
- object to get values from
-
-
-
- Initializes a new instance of the class.
-
- form action.
- object to get values from.
-
-
-
- write out the FORM-tag.
-
- generated html code
-
-
-
- Writeout the form tag
-
- form should be posted through ajax.
- generated html code
-
-
-
- Generates a text box.
-
-
-
- generated html code
-
-
-
- password box
-
-
-
- generated html code
-
-
-
- Hiddens the specified property name.
-
- Name of the property.
- The options.
- generated html code
-
-
-
- Labels the specified property name.
-
- property in object.
- caption
- generated html code
-
-
-
- Generate a checkbox
-
- property in object
- checkbox value
- additional html attributes.
- generated html code
-
-
-
- Write a html select tag
-
- object property.
- id column
- The title column.
- The options.
-
-
-
-
- Selects the specified property name.
-
- Name of the property.
- The items.
- The id column.
- The title column.
- The options.
-
-
-
-
- Write a submit tag.
-
- button caption
- html submit tag
-
-
-
- html end form tag
-
- html
-
-
-
- Container to bind resource names to assemblies
-
-
-
-
- Instantiates an instance of
-
- The dot seperated uri the resource maps to
- The full resource name
- The assembly the resource exists in
-
-
-
- Retrieves the assembly the resource resides in
-
-
-
-
- Retrieves the full name/path of the assembly
-
-
-
-
- Retrieves the extension of the resource
-
-
-
- Returns the Uri without extension
-
-
- Retrieves the full path name to the resource file
-
-
-
- Retrieves a stream to the resource
-
- Null if the resource couldn't be located somehow
-
-
- Class to handle loading of resource files
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- logger.
-
-
-
- Loads resources from a namespace in the given assembly to an URI
-
- The URI to map the resources to
- The assembly in which the resources reside
- The namespace from which to load the resources
-
-
- resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views");
-
- Will make the resource MyLib.Models.User.Views.list.Haml accessible via /user/list.haml or /user/list/
-
- The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded
- If a resource has already been mapped to an uri
-
-
-
- Retrieves a stream for the specified resource path if loaded otherwise null
-
- Path to the resource to retrieve a stream for
- A stream or null if the resource couldn't be found
-
-
-
- Fetch all files from the resource that matches the specified arguments.
-
- The path to the resource to extract
-
- a list of files if found; or an empty array if no files are found.
-
- Search path must end with an asterisk for finding arbitrary files
-
-
-
- Fetch all files from the resource that matches the specified arguments.
-
- Where the file should reside.
- Files to check
-
- a list of files if found; or an empty array if no files are found.
-
-
-
-
- Returns whether or not the loader has an instance of the file requested
-
- The name of the template/file
- True if the loader can provide the file
-
-
-
- Webhelper provides helpers for common tasks in HTML.
-
-
-
-
- Used to let the website use different javascript libraries.
- Default is
-
-
-
-
- Creates a link that invokes through ajax.
-
- url to fetch
- link title
-
- optional options in format "key, value, key, value".
- Javascript options starts with ':'.
-
- a link tag
-
- WebHelper.AjaxRequest("/users/add/", "Add user", "method:", "post", "onclick", "validate('this');");
-
-
-
-
- Builds a link that updates an element with the fetched ajax content.
-
- Url to fetch content from
- link title
- html element to update with the results of the ajax request.
- optional options in format "key, value, key, value"
- A link tag.
-
-
-
- A link that pop ups a Dialog (overlay div)
-
- url to contents of dialog
- link title
- name/value of html attributes.
- A "a"-tag that popups a dialog when clicked
-
- WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');");
-
-
-
-
- Create/Open a dialog box using ajax
-
-
-
-
-
-
-
-
- Close a javascript dialog window/div.
-
- javascript for closing a dialog.
-
-
-
-
- Create a <form> tag.
-
- name of form
- action to invoke on submit
- form should be posted as ajax
- html code
-
- WebHelper.FormStart("frmLogin", "/user/login", Request.IsAjax);
-
-
-
-
- Create a link tag.
-
- url to go to
- link title (text that is displayed)
- html attributes, name, value, name, value
- html code
-
- WebHelper.Link("/user/show/1", "Show user", "id", "showUser", "onclick", "return confirm('Are you shure?');");
-
-
-
-
- Build a link
-
- url to go to.
- title of link (displayed text)
- extra html attributes.
- a complete link
-
-
-
- Build a link
-
- url to go to.
- title of link (displayed text)
- extra html attributes.
- a complete link
- more options
-
-
-
- Obsolete
-
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
-
-
-
- Obsolete
-
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
- Obsolete
-
-
-
- Render errors into a UL with class "errors"
-
- class used by UL-tag.
- items to list
- an unordered html list.
-
-
-
- Render errors into a UL with class "errors"
-
- class used by UL-tag.
- items to list
- an unordered html list.
-
-
-
- Render errors into a UL with class "errors"
-
-
-
-
-
-
- Generates a list with html attributes.
-
- StringBuilder that the options should be added to.
- attributes set by user.
- attributes set by any of the helper classes.
-
-
-
- Generates a list with html attributes.
-
- StringBuilder that the options should be added to.
-
-
-
-
- Purpose of this class is to create a javascript toolkit independent javascript helper.
-
-
-
-
- Generates a list with JS options.
-
- StringBuilder that the options should be added to.
- the javascript options. name, value pairs. each string value should be escaped by YOU!
- true if we should start with a comma.
-
-
-
- Removes any javascript parameters from an array of parameters
-
- The array of parameters to remove javascript params from
- An array of html parameters
-
-
-
- javascript action that should be added to the "onsubmit" event in the form tag.
-
-
- All javascript option names should end with colon.
-
-
- JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);");
-
-
-
-
-
- Requests a url through ajax
-
- url to fetch
- optional options in format "key, value, key, value", used in JS request object.
- a link tag
- All javascript option names should end with colon.
-
-
- JSHelper.AjaxRequest("/user/show/1", "onsuccess:", "$('userInfo').update(result);");
-
-
-
-
-
- Ajax requests that updates an element with
- the fetched content
-
- Url to fetch content from
- element to update
- optional options in format "key, value, key, value", used in JS updater object.
- A link tag.
- All javascript option names should end with colon.
-
-
- JSHelper.AjaxUpdater("/user/show/1", "userInfo", "onsuccess:", "alert('Successful!');");
-
-
-
-
-
- A link that pop ups a Dialog (overlay div)
-
- url to contents of dialog
- link title
- A "a"-tag that popups a dialog when clicked
- name/value of html attributes
-
- WebHelper.DialogLink("/user/show/1", "show user", "onmouseover", "alert('booh!');");
-
-
-
-
- Close a javascript dialog window/div.
-
- javascript for closing a dialog.
-
-
-
-
- Creates a new modal dialog window
-
- url to open in window.
- window title (may not be supported by all js implementations)
-
-
-
-
-
- Helpers to make XML handling easier
-
-
-
-
- Serializes object to XML.
-
- object to serialize.
- XML
-
- Removes name spaces and adds indentation
-
-
-
-
- Create an object from a XML string
-
- Type of object
- XML string
- object
-
-
-
- Contains a connection to a browser/client.
-
-
- Remember to after you have hooked the event.
-
- TODO: Maybe this class should be broken up into HttpClientChannel and HttpClientContext?
-
-
-
- This context have been cleaned, which means that it can be reused.
-
-
-
-
- Context have been started (a new client have connected)
-
-
-
-
- Initializes a new instance of the class.
-
- true if the connection is secured (SSL/TLS)
- client that connected.
- Stream used for communication
- Used to create a .
- Size of buffer to use when reading data. Must be at least 4096 bytes.
- If fails
- Stream must be writable and readable.
-
-
-
- Process incoming body bytes.
-
-
- Bytes
-
-
-
-
-
-
-
-
-
-
- Overload to specify own type.
-
-
- Must be specified before the context is being used.
-
-
-
-
- Start reading content.
-
-
- Make sure to call base.Start() if you override this method.
-
-
-
-
- Clean up context.
-
-
- Make sure to call base.Cleanup() if you override the method.
-
-
-
-
- Using SSL or other encryption method.
-
-
-
-
- Using SSL or other encryption method.
-
-
-
-
- Specify which logger to use.
-
-
-
-
- Gets or sets the network stream.
-
-
-
-
- Gets or sets IP address that the client connected from.
-
-
-
-
- Gets or sets port that the client connected from.
-
-
-
-
- Disconnect from client
-
- error to report in the event.
-
-
-
- Send a response.
-
- Either or
- HTTP status code
- reason for the status code.
- HTML body contents, can be null or empty.
- A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty
- If is invalid.
-
-
-
- Send a response.
-
- Either or
- HTTP status code
- reason for the status code.
-
-
-
- Send a response.
-
-
-
-
-
- send a whole buffer
-
- buffer to send
-
-
-
-
- Send data using the stream
-
- Contains data to send
- Start position in buffer
- number of bytes to send
-
-
-
-
-
- The context have been disconnected.
-
-
- Event can be used to clean up a context, or to reuse it.
-
-
-
-
- A request have been received in the context.
-
-
-
-
- Used to create and reuse contexts.
-
-
-
-
- Initializes a new instance of the class.
-
- The writer.
- Amount of bytes to read from the incoming socket stream.
- Used to create a request parser.
-
-
-
- True if detailed trace logs should be written.
-
-
-
-
- Create a new context.
-
- true if socket is running HTTPS.
- Client that connected
- Network/SSL stream.
- A context.
-
-
-
- Create a new context.
-
- true if HTTPS is used.
- Remote client
- Network stream, uses .
- A new context (always).
-
-
-
- Create a secure .
-
- Client socket (accepted by the ).
- HTTPS certificate to use.
- Kind of HTTPS protocol. Usually TLS or SSL.
-
- A created .
-
-
-
-
- A request have been received from one of the contexts.
-
-
-
-
- Creates a that handles a connected client.
-
- Client socket (accepted by the ).
-
- A creates .
-
-
-
-
- Server is shutting down so shut down the factory
-
-
-
-
- Custom network stream to mark sockets as reusable when disposing the stream.
-
-
-
-
- Creates a new instance of the class for the specified .
-
-
- The that the will use to send and receive data.
-
-
- The parameter is null.
-
-
- The parameter is not connected.
- -or-
- The property of the parameter is not .
- -or-
- The parameter is in a nonblocking state.
-
-
-
-
- Initializes a new instance of the class for the specified with the specified ownership.
-
-
- The that the will use to send and receive data.
-
-
- Set to true to indicate that the will take ownership of the ; otherwise, false.
-
-
- The parameter is null.
-
-
- The parameter is not connected.
- -or-
- the value of the property of the parameter is not .
- -or-
- the parameter is in a nonblocking state.
-
-
-
-
- Creates a new instance of the class for the specified with the specified access rights.
-
-
- The that the will use to send and receive data.
-
-
- A bitwise combination of the values that specify the type of access given to the over the provided .
-
-
- The parameter is null.
-
-
- The parameter is not connected.
- -or-
- the property of the parameter is not .
- -or-
- the parameter is in a nonblocking state.
-
-
-
-
- Creates a new instance of the class for the specified with the specified access rights and the specified ownership.
-
-
- The that the will use to send and receive data.
-
-
- A bitwise combination of the values that specifies the type of access given to the over the provided .
-
-
- Set to true to indicate that the will take ownership of the ; otherwise, false.
-
-
- The parameter is null.
-
-
- The parameter is not connected.
- -or-
- The property of the parameter is not .
- -or-
- The parameter is in a nonblocking state.
-
-
-
-
- Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
-
-
-
-
- Releases the unmanaged resources used by the and optionally releases the managed resources.
-
- true to release both managed and unmanaged resources; false to release only unmanaged resources.
-
-
-
- Used to create es.
-
-
-
-
- Creates a that handles a connected client.
-
- Client socket (accepted by the ).
- A creates .
-
-
-
- Create a secure .
-
- Client socket (accepted by the ).
- HTTPS certificate to use.
- Kind of HTTPS protocol. Usually TLS or SSL.
- A created .
-
-
-
- A request have been received from one of the contexts.
-
-
-
-
- Server is shutting down so shut down the factory
-
-
-
-
- Container class for posted files
-
-
-
-
- Creates a container for a posted file
-
- The identifier of the post field
- The file path
- The content type of the file
- The name of the file uploaded
- If any parameter is null or empty
-
-
-
- Creates a container for a posted file
-
- If any parameter is null or empty
-
-
- Destructor disposing the file
-
-
-
- The name/id of the file
-
-
-
-
- The full file path
-
-
-
-
- The name of the uploaded file
-
-
-
-
- The type of file
-
-
-
-
- Deletes the temporary file
-
- True if manual dispose
-
-
-
- Disposing interface, cleans up managed resources (the temporary file) and suppresses finalization
-
-
-
- Container for posted form data
-
-
- Instance to help mark a non-initialized form
-
-
- Initializes a form container with the specified name
-
-
-
- Makes a deep copy of the input
-
- The input to copy
-
-
-
- Adds a file to the collection of posted files
-
- The file to add
- If the file is already added
- If file is null
- If the instance is HttpForm.EmptyForm which cannot be modified
-
-
-
- Checks if the form contains a specified file
-
- Field name of the file parameter
- True if the file exists
- If the instance is HttpForm.EmptyForm which cannot be modified
-
-
-
- Retrieves a file held by by the form
-
- The identifier of the file
- The requested file or null if the file was not found
- If name is null or empty
- If the instance is HttpForm.EmptyForm which cannot be modified
-
-
-
- Retrieves the number of files added to the
-
- 0 if no files are added
-
-
- Disposes all held HttpFile's and resets values
-
-
-
- Generic helper functions for HTTP
-
-
-
-
- Version string for HTTP v1.0
-
-
-
-
- Version string for HTTP v1.1
-
-
-
-
- An empty URI
-
-
-
-
- Parses a query string.
-
- Query string (URI encoded)
- A object if successful; otherwise
- queryString is null.
- If string cannot be parsed.
-
-
-
- Contains some kind of input from the browser/client.
- can be QueryString, form data or any other request body content.
-
-
-
- Representation of a non-initialized class instance
-
-
- Variable telling the class that it is non-initialized
-
-
-
- Initializes a new instance of the class.
-
- form name.
-
-
-
- Initializes a new instance of the class.
-
- form name.
- if set to true all changes will be ignored.
- this constructor should only be used by Empty
-
-
- Creates a deep copy of the HttpInput class
- The object to copy
- The function makes a deep copy of quite a lot which can be slow
-
-
-
- Form name as lower case
-
-
-
-
- Add a new element. Form array elements are parsed
- and added in a correct hierarchy.
-
- Name is converted to lower case.
-
- name is null.
- Cannot add stuff to .
-
-
-
- Get a form item.
-
-
- Returns if item was not found.
-
-
-
- Returns true if the class contains a with the corresponding name.
-
- The field/query string name
- True if the value exists
-
-
-
- Parses an item and returns it.
- This function is primarily used to parse array items as in user[name].
-
-
-
-
-
-
- Outputs the instance representing all its values joined together
-
-
-
- Returns all items as an unescaped query string.
-
-
-
-
- Extracts one parameter from an array
-
- Containing the string array
- All but the first value
-
- string test1 = ExtractOne("system[user][extension][id]");
- string test2 = ExtractOne(test1);
- string test3 = ExtractOne(test2);
- // test1 = user[extension][id]
- // test2 = extension[id]
- // test3 = id
-
-
-
- Resets all data contained by class
-
-
-
- Returns an enumerator that iterates through the collection.
-
-
-
- A that can be used to iterate through the collection.
-
- 1
-
-
-
- Returns an enumerator that iterates through a collection.
-
-
-
- An object that can be used to iterate through the collection.
-
- 2
-
-
-
- Base class for request data containers
-
-
-
-
- Adds a parameter mapped to the presented name
-
- The name to map the parameter to
- The parameter value
-
-
-
- Returns a request parameter
-
- The name associated with the parameter
-
-
-
-
- Returns true if the container contains the requested parameter
-
- Parameter id
- True if parameter exists
-
-
-
- represents a HTTP input item. Each item can have multiple sub items, a sub item
- is made in a HTML form by using square brackets
-
-
- // becomes:
- Console.WriteLine("Value: {0}", form["user"]["FirstName"].Value);
-
-
- All names in a form SHOULD be in lowercase.
-
-
-
- Representation of a non-initialized .
-
-
-
- Initializes an input item setting its name/identifier and value
-
- Parameter name/id
- Parameter value
-
-
- Creates a deep copy of the item specified
- The item to copy
- The function makes a deep copy of quite a lot which can be slow
-
-
-
- Number of values
-
-
-
-
- Get a sub item
-
- name in lower case.
- if no item was found.
-
-
-
- Name of item (in lower case).
-
-
-
-
- Returns the first value, or null if no value exist.
-
-
-
-
- Returns the last value, or null if no value exist.
-
-
-
-
- Returns the list with values.
-
-
-
-
- Add another value to this item
-
- Value to add.
- Cannot add stuff to .
-
-
-
- checks if a sub-item exists (and has a value).
-
- name in lower case
- true if the sub-item exists and has a value; otherwise false.
-
-
- Returns a formatted representation of the instance with the values of all contained parameters
-
-
-
- Outputs the string in a formatted manner
-
- A prefix to append, used internally
- produce a query string
-
-
-
-
-
- name in lower case
-
-
-
-
- Add a sub item.
-
- Can contain array formatting, the item is then parsed and added in multiple levels
- Value to add.
- Argument is null.
- Cannot add stuff to .
-
-
-
- Returns an enumerator that iterates through the collection.
-
-
-
- A that can be used to iterate through the collection.
-
- 1
-
-
-
- Returns an enumerator that iterates through a collection.
-
-
-
- An object that can be used to iterate through the collection.
-
- 2
-
-
-
- Outputs the string in a formatted manner
-
- A prefix to append, used internally
-
-
-
-
- New implementation of the HTTP listener.
-
-
- Use the Create methods to create a default listener.
-
-
-
-
- A client have been accepted, but not handled, by the listener.
-
-
-
-
- Initializes a new instance of the class.
-
- IP Address to accept connections on
- TCP Port to listen on, default HTTP port is 80.
- Factory used to create es.
- address is null.
- Port must be a positive number.
-
-
-
- Initializes a new instance of the class.
-
- The address.
- The port.
- The factory.
- The certificate.
-
-
-
- Initializes a new instance of the class.
-
- The address.
- The port.
- The factory.
- The certificate.
- The protocol.
-
-
-
- Creates a new instance with default factories.
-
- Address that the listener should accept connections on.
- Port that listener should accept connections on.
- Created HTTP listener.
-
-
-
- Creates a new instance with default factories.
-
- Address that the listener should accept connections on.
- Port that listener should accept connections on.
- Certificate to use
- Created HTTP listener.
-
-
-
- Creates a new instance with default factories.
-
- Address that the listener should accept connections on.
- Port that listener should accept connections on.
- Certificate to use
- which HTTPS protocol to use, default is TLS.
- Created HTTP listener.
-
-
-
- Can be used to create filtering of new connections.
-
- Accepted socket
-
- true if connection can be accepted; otherwise false.
-
-
-
-
- Contains a listener that doesn't do anything with the connections.
-
-
-
-
- Listen for regular HTTP connections
-
- IP Address to accept connections on
- TCP Port to listen on, default HTTP port is 80.
- Factory used to create es.
- address is null.
- Port must be a positive number.
-
-
-
- Initializes a new instance of the class.
-
- IP Address to accept connections on
- TCP Port to listen on, default HTTPS port is 443
- Factory used to create es.
- Certificate to use
-
-
-
- Initializes a new instance of the class.
-
- IP Address to accept connections on
- TCP Port to listen on, default HTTPS port is 443
- Factory used to create es.
- Certificate to use
- which HTTPS protocol to use, default is TLS.
-
-
-
- Gives you a change to receive log entries for all internals of the HTTP library.
-
-
- You may not switch log writer after starting the listener.
-
-
-
-
- True if we should turn on trace logs.
-
-
-
- Exception.
-
-
-
- Will try to accept connections one more time.
-
- If any exceptions is thrown.
-
-
-
- Can be used to create filtering of new connections.
-
- Accepted socket
- true if connection can be accepted; otherwise false.
-
-
-
- Start listen for new connections
-
- Number of connections that can stand in a queue to be accepted.
- Listener have already been started.
-
-
-
- Stop the listener
-
-
-
-
-
- Catch exceptions not handled by the listener.
-
-
- Exceptions will be thrown during debug mode if this event is not used,
- exceptions will be printed to console and suppressed during release mode.
-
-
-
-
- A request have been received from a .
-
-
-
-
- The purpose of this module is to serve files.
-
-
-
-
- Initializes a new instance of the class.
-
- Uri to serve, for instance "/files/"
- Path on hard drive where we should start looking for files
- If true a Last-Modifed header will be sent upon requests urging web browser to cache files
-
-
-
- Initializes a new instance of the class.
-
- Uri to serve, for instance "/files/"
- Path on hard drive where we should start looking for files
-
-
-
- List with all mime-type that are allowed.
-
- All other mime types will result in a Forbidden http status code.
-
-
-
- characters that may not exist in a path.
-
-
- fileMod.ForbiddenChars = new string[]{ "\\", "..", ":" };
-
-
-
-
- Mimtypes that this class can handle per default
-
-
-
-
- Determines if the request should be handled by this module.
- Invoked by the
-
-
- true if this module should handle it.
-
-
- Illegal path
-
-
-
- check if source contains any of the chars.
-
-
-
-
-
-
-
- Method that process the Uri.
-
- Information sent by the browser about the request
- Information that is being sent back to the client.
- Session used to
- Failed to find file extension
- File type is forbidden.
-
-
-
- return a file extension from an absolute Uri path (or plain filename)
-
-
-
-
-
-
- A HttpModule can be used to serve Uri's. The module itself
- decides if it should serve a Uri or not. In this way, you can
- get a very flexible http application since you can let multiple modules
- serve almost similar urls.
-
-
- Throw if you are using a and want to prompt for user name/password.
-
-
-
-
- Method that process the url
-
- Information sent by the browser about the request
- Information that is being sent back to the client.
- Session used to
- true if this module handled the request.
-
-
-
- Set the log writer to use.
-
- logwriter to use.
-
-
-
- Log something.
-
- importance of log message
- message
-
-
-
- If true specifies that the module doesn't consume the processing of a request so that subsequent modules
- can continue processing afterwards. Default is false.
-
-
-
-
- Used to inform http server that
-
-
-
-
- Eventarguments used when an exception is thrown by a module
-
- the exception
-
-
-
- Exception thrown in a module
-
-
-
-
- Serves files that are stored in embedded resources.
-
-
-
-
- Initializes a new instance of the class.
- Runs to make sure the basic mime types are available, they can be cleared later
- through the use of if desired.
-
-
-
-
- Initializes a new instance of the class.
- Runs to make sure the basic mime types are available, they can be cleared later
- through the use of if desired.
-
- The log writer to use when logging events
-
-
-
- List with all mime-type that are allowed.
-
- All other mime types will result in a Forbidden http status code.
-
-
-
- Mimtypes that this class can handle per default
-
-
-
-
- Loads resources from a namespace in the given assembly to an uri
-
- The uri to map the resources to
- The assembly in which the resources reside
- The namespace from which to load the resources
-
- resourceLoader.LoadResources("/user/", typeof(User).Assembly, "MyLib.Models.User.Views");
-
- will make ie the resource MyLib.Models.User.Views.stylesheet.css accessible via /user/stylesheet.css
-
- The amount of loaded files, giving you the possibility of making sure the resources needed gets loaded
-
-
-
- Returns true if the module can handle the request
-
-
-
-
- Method that process the url
-
- Information sent by the browser about the request
- Information that is being sent back to the client.
- Session used to
- true if this module handled the request.
-
-
-
- A reverse proxy are used to act as a bridge between local (protected/hidden) websites
- and public clients.
-
- A typical usage is to allow web servers on non standard ports to still be available
- to the public clients, or allow web servers on private ips to be available.
-
-
-
-
-
-
- Base url requested from browser
- Base url on private web server
-
- // this will return contents from http://192.168.1.128/view/jonas when client requests http://www.gauffin.com/user/view/jonas
- _server.Add(new ReverseProxyModule("http://www.gauffin.com/user/", "http://192.168.1.128/");
-
-
-
-
- Method that determines if an url should be handled or not by the module
-
- Url requested by the client.
- true if module should handle the url.
-
-
-
- Method that process the url
-
- Information sent by the browser about the request
- Information that is being sent back to the client.
- Session used to
-
-
-
- The website module let's you handle multiple websites in the same server.
- It uses the "Host" header to check which site you want.
-
- It's recommended that you do not
- add any other modules to HttpServer if you are using the website module. Instead,
- add all wanted modules to each website.
-
-
-
-
-
- domain name that should be handled.
-
-
-
-
- Name of site.
-
-
-
-
- Method that process the url
-
- Information sent by the browser about the request
- Information that is being sent back to the client.
- Session used to
-
-
-
- Returns item either from a form or a query string (checks them in that order)
-
-
-
- Representation of a non-initialized HttpParam
-
-
- Initialises the class to hold a value either from a post request or a querystring request
-
-
-
- The add method is not availible for HttpParam
- since HttpParam checks both Request.Form and Request.QueryString
-
- name identifying the value
- value to add
-
-
-
-
- Checks whether the form or querystring has the specified value
-
- Name, case sensitive
- true if found; otherwise false.
-
-
-
- Fetch an item from the form or querystring (in that order).
-
-
- Item if found; otherwise HttpInputItem.EmptyLanguageNode
-
-
-
- Returns an enumerator that iterates through the collection.
-
-
-
- A that can be used to iterate through the collection.
-
- 1
-
-
-
- Returns an enumerator that iterates through a collection.
-
-
-
- An object that can be used to iterate through the collection.
-
- 2
-
-
-
- Contains server side HTTP request information.
-
-
-
-
- Chars used to split an URL path into multiple parts.
-
-
-
-
- Gets or sets a value indicating whether this is secure.
-
-
-
-
- Path and query (will be merged with the host header) and put in Uri
-
-
-
-
-
- Assign a form.
-
-
-
-
-
- Gets whether the body is complete.
-
-
-
-
- Gets kind of types accepted by the client.
-
-
-
-
- Gets or sets body stream.
-
-
-
-
- Gets or sets kind of connection used for the session.
-
-
-
-
- Gets or sets number of bytes in the body.
-
-
-
-
- Gets headers sent by the client.
-
-
-
-
- Gets or sets version of HTTP protocol that's used.
-
-
- Probably or .
-
-
-
-
-
- Gets or sets requested method.
-
-
-
- Will always be in upper case.
-
-
-
-
-
- Gets variables sent in the query string
-
-
-
-
- Gets or sets requested URI.
-
-
-
-
- Uri absolute path splitted into parts.
-
-
- // uri is: http://gauffin.com/code/tiny/
- Console.WriteLine(request.UriParts[0]); // result: code
- Console.WriteLine(request.UriParts[1]); // result: tiny
-
-
- If you're using controllers than the first part is controller name,
- the second part is method name and the third part is Id property.
-
-
-
-
-
- Gets parameter from or .
-
-
-
-
- Gets form parameters.
-
-
-
-
- Gets whether the request was made by Ajax (Asynchronous JavaScript)
-
-
-
-
- Gets cookies that was sent with the request.
-
-
-
-
- Creates a new object that is a copy of the current instance.
-
-
-
- A new object that is a copy of this instance.
-
- 2
-
-
-
- Decode body into a form.
-
- A list with form decoders.
- If body contents is not valid for the chosen decoder.
- If body is still being transferred.
-
-
-
- Cookies
-
- the cookies
-
-
-
- Create a response object.
-
- A new .
-
-
-
- Called during parsing of a .
-
- Name of the header, should not be URL encoded
- Value of the header, should not be URL encoded
- If a header is incorrect.
-
-
-
- Add bytes to the body
-
- buffer to read bytes from
- where to start read
- number of bytes to read
- Number of bytes actually read (same as length unless we got all body bytes).
- If body is not writable
- bytes is null.
- offset is out of range.
-
-
-
- Clear everything in the request
-
-
-
-
- Response that is sent back to the web browser / client.
-
-
-
- A response can be sent if different ways. The easiest one is
- to just fill the Body stream with content, everything else
- will then be taken care of by the framework. The default content-type
- is text/html, you should change it if you send anything else.
-
- The second and slightly more complex way is to send the response
- as parts. Start with sending the header using the SendHeaders method and
- then you can send the body using SendBody method, but do not forget
- to set and before doing so.
-
-
-
-
- // Example using response body.
- class MyModule : HttpModule
- {
- public override bool Process(IHttpRequest request, IHttpResponse response, IHttpSession session)
- {
- StreamWriter writer = new StreamWriter(response.Body);
- writer.WriteLine("Hello dear World!");
- writer.Flush();
-
- // return true to tell webserver that we've handled the url
- return true;
- }
- }
-
-
- todo: add two examples, using SendHeaders/SendBody and just the Body stream.
-
-
-
- Initializes a new instance of the class.
-
- Client that send the .
- Contains information of what the client want to receive.
- cannot be empty.
-
-
-
- Initializes a new instance of the class.
-
- Client that send the .
- Version of HTTP protocol that the client uses.
- Type of HTTP connection used.
-
-
-
- The body stream is used to cache the body contents
- before sending everything to the client. It's the simplest
- way to serve documents.
-
-
-
-
- The chunked encoding modifies the body of a message in order to
- transfer it as a series of chunks, each with its own size indicator,
- followed by an OPTIONAL trailer containing entity-header fields. This
- allows dynamically produced content to be transferred along with the
- information necessary for the recipient to verify that it has
- received the full message.
-
-
-
-
- Defines the version of the HTTP Response for applications where it's required
- for this to be forced.
-
-
-
-
- Kind of connection
-
-
-
-
- Encoding to use when sending stuff to the client.
-
- Default is UTF8
-
-
-
- Number of seconds to keep connection alive
-
- Only used if Connection property is set to .
-
-
-
- Status code that is sent to the client.
-
- Default is
-
-
-
- Information about why a specific status code was used.
-
-
-
-
- Size of the body. MUST be specified before sending the header,
- unless property Chunked is set to true.
-
-
-
-
- Kind of content in the body
-
- Default type is "text/html"
-
-
-
- Headers have been sent to the client-
-
- You can not send any additional headers if they have already been sent.
-
-
-
- The whole response have been sent.
-
-
-
-
- Cookies that should be created/changed.
-
-
-
-
- Add another header to the document.
-
- Name of the header, case sensitive, use lower cases.
- Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n
- If headers already been sent.
- If value conditions have not been met.
- Adding any header will override the default ones and those specified by properties.
-
-
-
- Send headers and body to the browser.
-
- If content have already been sent.
-
-
-
- Make sure that you have specified and sent the headers first.
-
-
- If headers have not been sent.
-
- offset of first byte to send
- number of bytes to send.
-
-
- This method can be used if you want to send body contents without caching them first. This
- is recommended for larger files to keep the memory usage low.
-
-
-
- Make sure that you have specified and sent the headers first.
-
-
- If headers have not been sent.
-
-
-
- This method can be used if you want to send body contents without caching them first. This
- is recommended for larger files to keep the memory usage low.
-
-
-
- Send headers to the client.
-
- If headers already been sent.
-
-
-
-
-
-
- Redirect client to somewhere else using the 302 status code.
-
- Destination of the redirect
- If headers already been sent.
- You can not do anything more with the request when a redirect have been done. This should be your last
- action.
-
-
-
- redirect to somewhere
-
- where the redirect should go
-
- No body are allowed when doing redirects.
-
-
-
-
- Delegate used to find a realm/domain.
-
-
-
-
- Realms are used during HTTP Authentication
-
-
-
-
-
-
- A complete HTTP server, you need to add a module to it to be able to handle incoming requests.
-
-
-
- // this small example will add two web site modules, thus handling
- // two different sites. In reality you should add Controller modules or something
- // two the website modules to be able to handle different requests.
- HttpServer server = new HttpServer();
- server.Add(new WebSiteModule("www.gauffin.com", "Gauffin Telecom AB"));
- server.Add(new WebSiteModule("www.vapadi.se", "Remote PBX"));
-
- // start regular http
- server.Start(IPAddress.Any, 80);
-
- // start https
- server.Start(IPAddress.Any, 443, myCertificate);
-
-
-
-
-
-
-
-
- Server that is handling the current request.
-
-
- Will be set as soon as a request arrives to the object.
-
-
-
-
- Initializes a new instance of the class.
-
- Used to get all components used in the server..
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Initializes a new instance of the class.
-
- Form decoders are used to convert different types of posted data to the object types.
-
-
-
-
-
- Initializes a new instance of the class.
-
- A session store is used to save and retrieve sessions
-
-
-
-
- Initializes a new instance of the class.
-
- The log writer.
-
-
-
-
- Initializes a new instance of the class.
-
- Form decoders are used to convert different types of posted data to the object types.
- The log writer.
-
-
-
-
-
-
- Initializes a new instance of the class.
-
- Form decoders are used to convert different types of posted data to the object types.
- A session store is used to save and retrieve sessions
- The log writer.
-
-
-
-
-
-
-
- Modules used for authentication. The module that is is added first is used as
- the default authentication module.
-
- Use the corresponding property
- in the if you are using multiple websites.
-
-
-
- Form decoder providers are used to decode request body (which normally contains form data).
-
-
-
-
- Server name sent in HTTP responses.
-
-
- Do NOT include version in name, since it makes it
- easier for hackers.
-
-
-
-
- Name of cookie where session id is stored.
-
-
-
-
- Specified where logging should go.
-
-
-
-
-
-
-
- Number of connections that can wait to be accepted by the server.
-
- Default is 10.
-
-
-
- Gets or sets maximum number of allowed simultaneous requests.
-
-
-
- This property is useful in busy systems. The HTTP server
- will start queuing new requests if this limit is hit, instead
- of trying to process all incoming requests directly.
-
-
- The default number if allowed simultaneous requests are 10.
-
-
-
-
-
- Gets or sets maximum number of requests queuing to be handled.
-
-
-
- The WebServer will start turning requests away if response code
- to indicate that the server
- is too busy to be able to handle the request.
-
-
-
-
-
- Adds the specified rule.
-
- The rule.
-
-
-
- Add a to the server.
-
- mode to add
-
-
-
- Decodes the request body.
-
- The request.
- Failed to decode form data.
-
-
-
- Generate a HTTP error page (that will be added to the response body).
- response status code is also set.
-
- Response that the page will be generated in.
- .
- response body contents.
-
-
-
- Generate a HTTP error page (that will be added to the response body).
- response status code is also set.
-
- Response that the page will be generated in.
- exception.
-
-
-
- Realms are used by the s.
-
- HTTP request
- domain/realm.
-
-
-
- Process an incoming request.
-
- connection to client
- request information
- response that should be filled
- session information
-
-
-
- Can be overloaded to implement stuff when a client have been connected.
-
-
- Default implementation does nothing.
-
- client that disconnected
- disconnect reason
-
-
-
- Handle authentication
-
-
-
-
- true if request can be handled; false if not.
- Invalid authorization header
-
-
-
- Will request authentication.
-
-
- Sends respond to client, nothing else can be done with the response after this.
-
-
-
-
-
-
-
- Received from a when a request have been parsed successfully.
-
- that received the request.
- The request.
-
-
-
- To be able to track request count.
-
-
-
-
-
-
- Start the web server using regular HTTP.
-
- IP Address to listen on, use IpAddress.Any to accept connections on all IP addresses/network cards.
- Port to listen on. 80 can be a good idea =)
- address is null.
- Port must be a positive number.
-
-
-
- Accept secure connections.
-
- IP Address to listen on, use to accept connections on all IP Addresses / network cards.
- Port to listen on. 80 can be a good idea =)
- Certificate to use
- address is null.
- Port must be a positive number.
-
-
-
- shut down the server and listeners
-
-
-
-
- write an entry to the log file
-
- importance of the message
- log message
-
-
-
- write an entry to the log file
-
- object that wrote the message
- importance of the message
- log message
-
-
-
- Realms are used during HTTP authentication.
- Default realm is same as server name.
-
-
-
-
- Let's to receive unhandled exceptions from the threads.
-
-
- Exceptions will be thrown during debug mode if this event is not used,
- exceptions will be printed to console and suppressed during release mode.
-
-
-
-
- Inversion of control interface.
-
-
-
-
- Add a component instance
-
- Interface type
- Instance to add
-
-
-
- Get a component.
-
- Interface type
- Component if registered, otherwise null.
-
- Component will get created if needed.
-
-
-
-
- Checks if the specified component interface have been added.
-
-
- true if found; otherwise false.
-
-
-
- Add a component.
-
- Type being requested.
- Type being created.
-
-
-
- Contains a connection to a browser/client.
-
-
-
-
- Using SSL or other encryption method.
-
-
-
-
- Using SSL or other encryption method.
-
-
-
-
- Disconnect from client
-
- error to report in the event.
-
-
-
- Send a response.
-
- Either or
- HTTP status code
- reason for the status code.
- HTML body contents, can be null or empty.
- A content type to return the body as, i.e. 'text/html' or 'text/plain', defaults to 'text/html' if null or empty
- If is invalid.
-
-
-
- Send a response.
-
- Either or
- HTTP status code
- reason for the status code.
-
-
-
- Send a response.
-
-
-
-
-
- send a whole buffer
-
- buffer to send
-
-
-
-
- Send data using the stream
-
- Contains data to send
- Start position in buffer
- number of bytes to send
-
-
-
-
-
- Closes the streams and disposes of the unmanaged resources
-
-
-
-
- The context have been disconnected.
-
-
- Event can be used to clean up a context, or to reuse it.
-
-
-
-
- A request have been received in the context.
-
-
-
-
- A have been disconnected.
-
-
-
-
- Gets reason to why client disconnected.
-
-
-
-
- Initializes a new instance of the class.
-
- Reason to disconnection.
-
-
-
-
-
-
-
-
- Gets received request.
-
-
-
-
- Initializes a new instance of the class.
-
- The request.
-
-
-
- Class that receives Requests from a .
-
-
-
-
- Client have been disconnected.
-
- Client that was disconnected.
- Reason
-
-
-
-
- Invoked when a client context have received a new HTTP request
-
- Client that received the request.
- Request that was received.
-
-
-
-
- Contains server side HTTP request information.
-
-
-
-
- Gets kind of types accepted by the client.
-
-
-
-
- Gets or sets body stream.
-
-
-
-
- Gets whether the body is complete.
-
-
-
-
- Gets or sets kind of connection used for the session.
-
-
-
-
- Gets or sets number of bytes in the body.
-
-
-
-
- Gets cookies that was sent with the request.
-
-
-
-
- Gets form parameters.
-
-
-
-
- Gets headers sent by the client.
-
-
-
-
- Gets or sets version of HTTP protocol that's used.
-
-
- Probably or .
-
-
-
-
-
- Gets whether the request was made by Ajax (Asynchronous JavaScript)
-
-
-
-
- Gets or sets requested method.
-
-
- Will always be in upper case.
-
-
-
-
-
- Gets parameter from or .
-
-
-
-
- Gets variables sent in the query string
-
-
-
-
- Gets or sets requested URI.
-
-
-
-
- Gets URI absolute path divided into parts.
-
-
- // URI is: http://gauffin.com/code/tiny/
- Console.WriteLine(request.UriParts[0]); // result: code
- Console.WriteLine(request.UriParts[1]); // result: tiny
-
-
- If you're using controllers than the first part is controller name,
- the second part is method name and the third part is Id property.
-
-
-
-
-
- Gets or sets path and query.
-
-
-
- Are only used during request parsing. Cannot be set after "Host" header have been
- added.
-
-
-
-
- Called during parsing of a .
-
- Name of the header, should not be URL encoded
- Value of the header, should not be URL encoded
- If a header is incorrect.
-
-
-
- Add bytes to the body
-
- buffer to read bytes from
- where to start read
- number of bytes to read
- Number of bytes actually read (same as length unless we got all body bytes).
- If body is not writable
- bytes is null.
- offset is out of range.
-
-
-
- Clear everything in the request
-
-
-
-
- Decode body into a form.
-
- A list with form decoders.
- If body contents is not valid for the chosen decoder.
- If body is still being transferred.
-
-
-
- Sets the cookies.
-
- The cookies.
-
-
-
- Create a response object.
-
- Context for the connected client.
- A new .
-
-
-
- Event driven parser used to parse incoming HTTP requests.
-
-
- The parser supports partial messages and keeps the states between
- each parsed buffer. It's therefore important that the parser gets
- ed if a client disconnects.
-
-
-
-
- Current state in parser.
-
-
-
-
- Parse partial or complete message.
-
- buffer containing incoming bytes
- where in buffer that parsing should start
- number of bytes to parse
- Unparsed bytes left in buffer.
- BadRequestException.
-
-
-
- A request have been successfully parsed.
-
-
-
-
- More body bytes have been received.
-
-
-
-
- Request line have been received.
-
-
-
-
- A header have been received.
-
-
-
-
- Clear parser state.
-
-
-
-
- Gets or sets the log writer.
-
-
-
-
- Current state in the parsing.
-
-
-
-
- Should parse the request line
-
-
-
-
- Searching for a complete header name
-
-
-
-
- Searching for colon after header name (ignoring white spaces)
-
-
-
-
- Searching for start of header value (ignoring white spaces)
-
-
-
-
- Searching for a complete header value (can span over multiple lines, as long as they are prefixed with one/more whitespaces)
-
-
-
-
- Adding bytes to body
-
-
-
-
- Response that is sent back to the web browser / client.
-
- A response can be sent if different ways. The easiest one is
- to just fill the Body stream with content, everything else
- will then be taken care of by the framework. The default content-type
- is text/html, you should change it if you send anything else.
-
- The second and slighty more complex way is to send the response
- as parts. Start with sending the header using the SendHeaders method and
- then you can send the body using SendBody method, but do not forget
- to set ContentType and ContentLength before doing so.
-
-
- public void MyHandler(IHttpRequest request, IHttpResponse response)
- {
-
- }
-
-
-
-
- The body stream is used to cache the body contents
- before sending everything to the client. It's the simplest
- way to serve documents.
-
-
-
-
- Defines the version of the HTTP Response for applications where it's required
- for this to be forced.
-
-
-
-
- The chunked encoding modifies the body of a message in order to
- transfer it as a series of chunks, each with its own size indicator,
- followed by an OPTIONAL trailer containing entity-header fields. This
- allows dynamically produced content to be transferred along with the
- information necessary for the recipient to verify that it has
- received the full message.
-
-
-
-
- Kind of connection
-
-
-
-
- Encoding to use when sending stuff to the client.
-
- Default is UTF8
-
-
-
- Number of seconds to keep connection alive
-
- Only used if Connection property is set to ConnectionType.KeepAlive
-
-
-
- Status code that is sent to the client.
-
- Default is HttpStatusCode.Ok
-
-
-
- Information about why a specific status code was used.
-
-
-
-
- Size of the body. MUST be specified before sending the header,
- unless property Chunked is set to true.
-
-
-
-
- Kind of content in the body
-
- Default is text/html
-
-
-
- Headers have been sent to the client-
-
- You can not send any additional headers if they have already been sent.
-
-
-
- The whole response have been sent.
-
-
-
-
- Cookies that should be created/changed.
-
-
-
-
- Add another header to the document.
-
- Name of the header, case sensitive, use lower cases.
- Header values can span over multiple lines as long as each line starts with a white space. New line chars should be \r\n
- If headers already been sent.
- If value conditions have not been met.
- Adding any header will override the default ones and those specified by properties.
-
-
-
- Send headers and body to the browser.
-
- If content have already been sent.
-
-
-
- Make sure that you have specified ContentLength and sent the headers first.
-
-
- If headers have not been sent.
-
- offest of first byte to send
- number of bytes to send.
-
-
- This method can be used if you want to send body contents without caching them first. This
- is recommended for larger files to keep the memory usage low.
-
-
-
- Make sure that you have specified ContentLength and sent the headers first.
-
-
- If headers have not been sent.
-
-
-
- This method can be used if you want to send body contents without caching them first. This
- is recommended for larger files to keep the memory usage low.
-
-
-
- Send headers to the client.
-
- If headers already been sent.
-
-
-
-
-
-
- Redirect client to somewhere else using the 302 status code.
-
- Destination of the redirect
- If headers already been sent.
- You can not do anything more with the request when a redirect have been done. This should be your last
- action.
-
-
-
- redirect to somewhere
-
- where the redirect should go
-
- No body are allowed when doing redirects.
-
-
-
-
- Type of HTTP connection
-
-
-
-
- Connection is closed after each request-response
-
-
-
-
- Connection is kept alive for X seconds (unless another request have been made)
-
-
-
-
- Priority for log entries
-
-
-
-
-
- Very detailed logs to be able to follow the flow of the program.
-
-
-
-
- Logs to help debug errors in the application
-
-
-
-
- Information to be able to keep track of state changes etc.
-
-
-
-
- Something did not go as we expected, but it's no problem.
-
-
-
-
- Something that should not fail failed, but we can still keep
- on going.
-
-
-
-
- Something failed, and we cannot handle it properly.
-
-
-
-
- Interface used to write to log files.
-
-
-
-
- Write an entry to the log file.
-
- object that is writing to the log
- importance of the log message
- the message
-
-
-
- This class writes to the console. It colors the output depending on the logprio and includes a 3-level stacktrace (in debug mode)
-
-
-
-
-
- The actual instance of this class.
-
-
-
-
- Logwriters the specified source.
-
- object that wrote the logentry.
- Importance of the log message
- The message.
-
-
-
- Get color for the specified logprio
-
- prio for the log entry
- A for the prio
-
-
-
- Default log writer, writes everything to null (nowhere).
-
-
-
-
-
- The logging instance.
-
-
-
-
- Writes everything to null
-
- object that wrote the log entry.
- Importance of the log message
- The message.
-
-
-
- A thread-safe lockless queue that supports multiple readers and
- multiple writers
-
-
-
-
- Provides a node container for data in a singly linked list
-
-
-
- Pointer to the next node in list
-
-
- The data contained by the node
-
-
-
- Constructor
-
-
-
-
- Constructor
-
-
-
- Queue head
-
-
- Queue tail
-
-
- Queue item count
-
-
- Gets the current number of items in the queue. Since this
- is a lockless collection this value should be treated as a close
- estimate
-
-
-
- Constructor
-
-
-
-
- Enqueue an item
-
- Item to enqeue
-
-
-
- Try to dequeue an item
-
- Dequeued item if the dequeue was successful
- True if an item was successfully deqeued, otherwise false
-
-
-
- Contains all HTTP Methods (according to the HTTP 1.1 specification)
-
- See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
-
-
-
-
-
- The DELETE method requests that the origin server delete the resource identified by the Request-URI.
-
-
-
- This method MAY be overridden by human intervention (or other means) on the origin server.
- The client cannot be guaranteed that the operation has been carried out, even if the status code
- returned from the origin server indicates that the action has been completed successfully.
-
-
- However, the server SHOULD NOT indicate success unless, at the time the response is given,
- it intends to delete the resource or move it to an inaccessible location.
-
-
- A successful response SHOULD be 200 (OK) if the response includes an entity describing the status,
- 202 (Accepted) if the action has not yet been enacted,
- or 204 (No Content) if the action has been enacted but the response does not include an entity.
-
-
- If the request passes through a cache and the Request-URI identifies one or more currently cached entities,
- those entries SHOULD be treated as stale. Responses to this method are not cacheable.
-
-
-
-
-
- The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI.
-
-
-
- If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the
- entity in the response and not the source text of the process, unless that text happens to be the output of the process.
-
-
- The semantics of the GET method change to a "conditional GET" if the request message includes an
- If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field.
- A conditional GET method requests that the entity be transferred only under the circumstances described
- by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network
- usage by allowing cached entities to be refreshed without requiring multiple requests or transferring
- data already held by the client.
-
-
-
-
-
- The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.
-
-
- The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the
- information sent in response to a GET request. This method can be used for obtaining meta information about
- the entity implied by the request without transferring the entity-body itself.
-
- This method is often used for testing hypertext links for validity, accessibility, and recent modification.
-
-
-
-
- The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.
-
-
- This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.
-
-
-
-
- The POST method is used to request that the origin server accept the entity enclosed
- in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.
-
-
- POST is designed to allow a uniform method to cover the following functions:
-
- -
- Annotation of existing resources;
-
-
- Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles;
-
-
- Providing a block of data, such as the result of submitting a form, to a data-handling process;
-
-
- Extending a database through an append operation.
-
-
-
- If a resource has been created on the origin server, the response SHOULD be 201 (Created) and
- contain an entity which describes the status of the request and refers to the new resource, and a
- Location header (see section 14.30).
-
-
- The action performed by the POST method might not result in a resource that can be identified by a URI.
- In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on
- whether or not the response includes an entity that describes the result.
-
- Responses to this method are not cacheable, unless the response includes appropriate Cache-Control
- or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent
- to retrieve a cacheable resource.
-
-
-
-
-
- The PUT method requests that the enclosed entity be stored under the supplied Request-URI.
-
-
-
- -
- If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a
- modified version of the one residing on the origin server.
-
-
- If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new
- resource by the requesting user agent, the origin server can create the resource with that URI.
-
-
- If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response.
-
-
- If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to
- indicate successful completion of the request.
-
-
- If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be
- given that reflects the nature of the problem.
-
-
-
- The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not
- understand or implement and MUST return a 501 (Not Implemented) response in such cases.
-
-
-
-
-
- The TRACE method is used to invoke a remote, application-layer loop- back of the request message.
-
-
-
-
- Contains all HTTP Methods (according to the HTTP 1.1 specification)
-
- See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
-
-
-
-
-
- The DELETE method requests that the origin server delete the resource identified by the Request-URI.
-
-
-
- This method MAY be overridden by human intervention (or other means) on the origin server.
- The client cannot be guaranteed that the operation has been carried out, even if the status code
- returned from the origin server indicates that the action has been completed successfully.
-
-
- However, the server SHOULD NOT indicate success unless, at the time the response is given,
- it intends to delete the resource or move it to an inaccessible location.
-
-
- A successful response SHOULD be 200 (OK) if the response includes an entity describing the status,
- 202 (Accepted) if the action has not yet been enacted,
- or 204 (No Content) if the action has been enacted but the response does not include an entity.
-
-
- If the request passes through a cache and the Request-URI identifies one or more currently cached entities,
- those entries SHOULD be treated as stale. Responses to this method are not cacheable.
-
-
-
-
-
- The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI.
-
-
-
- If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the
- entity in the response and not the source text of the process, unless that text happens to be the output of the process.
-
-
- The semantics of the GET method change to a "conditional GET" if the request message includes an
- If-Modified-Since, If-Unmodified-Since, If-Match, If-None-Match, or If-Range header field.
- A conditional GET method requests that the entity be transferred only under the circumstances described
- by the conditional header field(s). The conditional GET method is intended to reduce unnecessary network
- usage by allowing cached entities to be refreshed without requiring multiple requests or transferring
- data already held by the client.
-
-
-
-
-
- The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.
-
-
- The meta information contained in the HTTP headers in response to a HEAD request SHOULD be identical to the
- information sent in response to a GET request. This method can be used for obtaining meta information about
- the entity implied by the request without transferring the entity-body itself.
-
- This method is often used for testing hypertext links for validity, accessibility, and recent modification.
-
-
-
-
- The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI.
-
-
- This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.
-
-
-
-
- The POST method is used to request that the origin server accept the entity enclosed
- in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.
-
-
- POST is designed to allow a uniform method to cover the following functions:
-
- -
- Annotation of existing resources;
-
-
- Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles;
-
-
- Providing a block of data, such as the result of submitting a form, to a data-handling process;
-
-
- Extending a database through an append operation.
-
-
-
- If a resource has been created on the origin server, the response SHOULD be 201 (Created) and
- contain an entity which describes the status of the request and refers to the new resource, and a
- Location header (see section 14.30).
-
-
- The action performed by the POST method might not result in a resource that can be identified by a URI.
- In this case, either 200 (OK) or 204 (No Content) is the appropriate response status, depending on
- whether or not the response includes an entity that describes the result.
-
- Responses to this method are not cacheable, unless the response includes appropriate Cache-Control
- or Expires header fields. However, the 303 (See Other) response can be used to direct the user agent
- to retrieve a cacheable resource.
-
-
-
-
-
- The PUT method requests that the enclosed entity be stored under the supplied Request-URI.
-
-
-
- -
- If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a
- modified version of the one residing on the origin server.
-
-
- If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new
- resource by the requesting user agent, the origin server can create the resource with that URI.
-
-
- If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response.
-
-
- If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to
- indicate successful completion of the request.
-
-
- If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be
- given that reflects the nature of the problem.
-
-
-
- The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not
- understand or implement and MUST return a 501 (Not Implemented) response in such cases.
-
-
-
-
-
- The TRACE method is used to invoke a remote, application-layer loop- back of the request message.
-
-
-
-
- Arguments used when more body bytes have come.
-
-
-
-
- Initializes a new instance of the class.
-
- buffer that contains the received bytes.
- offset in buffer where to start processing.
- number of bytes from that should be parsed.
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets buffer that contains the received bytes.
-
-
-
-
- Gets or sets number of bytes from that should be parsed.
-
-
-
-
- Gets or sets offset in buffer where to start processing.
-
-
-
-
- Event arguments used when a new header have been parsed.
-
-
-
-
- Initializes a new instance of the class.
-
- Name of header.
- Header value.
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets header name.
-
-
-
-
- Gets or sets header value.
-
-
-
-
- Parses a HTTP request directly from a stream
-
-
-
-
- Create a new request parser
-
- delegate receiving log entries.
-
-
-
- Add a number of bytes to the body
-
- buffer containing more body bytes.
- starting offset in buffer
- number of bytes, from offset, to read.
- offset to continue from.
-
-
-
- Remove all state information for the request.
-
-
-
-
- Gets or sets the log writer.
-
-
-
-
- Parse request line
-
-
- If line is incorrect
- Expects the following format: "Method SP Request-URI SP HTTP-Version CRLF"
-
-
-
- We've parsed a new header.
-
- Name in lower case
- Value, unmodified.
- If content length cannot be parsed.
-
-
-
- Current state in parser.
-
-
-
-
- Parse a message
-
- bytes to parse.
- where in buffer that parsing should start
- number of bytes to parse, starting on .
- offset (where to start parsing next).
- BadRequestException.
-
-
-
- A request have been successfully parsed.
-
-
-
-
- More body bytes have been received.
-
-
-
-
- Request line have been received.
-
-
-
-
- A header have been received.
-
-
-
-
- Used when the request line have been successfully parsed.
-
-
-
-
- Initializes a new instance of the class.
-
- The HTTP method.
- The URI path.
- The HTTP version.
-
-
-
- Initializes a new instance of the class.
-
-
-
-
- Gets or sets http method.
-
-
- Should be one of the methods declared in .
-
-
-
-
- Gets or sets the version of the HTTP protocol that the client want to use.
-
-
-
-
- Gets or sets requested URI path.
-
-
-
-
- Creates request parsers when needed.
-
-
-
-
- Create a new request parser.
-
- Used when logging should be enabled.
- A new request parser.
-
-
-
- Creates request parsers when needed.
-
-
-
-
- Create a new request parser.
-
- Used when logging should be enabled.
- A new request parser.
-
-
-
- cookie sent by the client/browser
-
-
-
-
-
- Constructor.
-
- cookie identifier
- cookie content
- id or content is null
- id is empty
-
-
-
- Gets the cookie HTML representation.
-
- cookie string
-
-
-
- Gets the cookie identifier.
-
-
-
-
- Cookie value. Set to null to remove cookie.
-
-
-
-
- This class is created as a wrapper, since there are two different cookie types in .Net (Cookie and HttpCookie).
- The framework might switch class in the future and we dont want to have to replace all instances
-
-
-
-
- Let's copy all the cookies.
-
- value from cookie header.
-
-
-
- Adds a cookie in the collection.
-
- cookie to add
- cookie is null
-
-
-
- Gets the count of cookies in the collection.
-
-
-
-
- Gets the cookie of a given identifier (null if not existing).
-
-
-
-
- Gets a collection enumerator on the cookie list.
-
- collection enumerator
-
-
-
- Remove all cookies.
-
-
-
-
- Returns an enumerator that iterates through the collection.
-
-
-
- A that can be used to iterate through the collection.
-
- 1
-
-
-
- Remove a cookie from the collection.
-
- Name of cookie.
-
-
-
- Used to queue incoming requests.
-
-
-
-
- Initializes a new instance of the class.
-
- Called when a request should be processed.
-
-
-
- Used two queue incoming requests to avoid
- thread starvation.
-
-
-
-
- Gets or sets maximum number of allowed simultaneous requests.
-
-
-
-
- Gets or sets maximum number of requests queuing to be handled.
-
-
-
-
- Specifies how many requests the HTTP server is currently processing.
-
-
-
-
- Used to process queued requests.
-
-
-
-
- Method used to process a queued request
-
- Context that the request was received from.
- Request to process.
-
-
-
- cookie being sent back to the browser.
-
-
-
-
-
- Constructor.
-
- cookie identifier
- cookie content
- cookie expiration date. Use DateTime.MinValue for session cookie.
- id or content is null
- id is empty
-
-
-
- Create a new cookie
-
- name identifying the cookie
- cookie value
- when the cookie expires. Setting DateTime.MinValue will delete the cookie when the session is closed.
- Path to where the cookie is valid
- Domain that the cookie is valid for.
-
-
-
- Create a new cookie
-
- Name and value will be used
- when the cookie expires.
-
-
-
- Gets the cookie HTML representation.
-
- cookie string
-
-
-
- When the cookie expires.
- DateTime.MinValue means that the cookie expires when the session do so.
-
-
-
-
- Cookie is only valid under this path.
-
-
-
-
- Cookies that should be set.
-
-
-
-
- Adds a cookie in the collection.
-
- cookie to add
- cookie is null
-
-
-
- Copy a request cookie
-
-
- When the cookie should expire
-
-
-
- Gets the count of cookies in the collection.
-
-
-
-
- Gets the cookie of a given identifier (null if not existing).
-
-
-
-
- Gets a collection enumerator on the cookie list.
-
- collection enumerator
-
-
-
- Remove all cookies
-
-
-
-
- Returns an enumerator that iterates through the collection.
-
-
-
- A that can be used to iterate through the collection.
-
- 1
-
-
-
- Rules are used to perform operations before a request is being handled.
- Rules can be used to create routing etc.
-
-
-
-
- Process the incoming request.
-
- incoming HTTP request
- outgoing HTTP response
- true if response should be sent to the browser directly (no other rules or modules will be processed).
-
- returning true means that no modules will get the request. Returning true is typically being done
- for redirects.
-
- If request or response is null.
-
-
-
- redirects from one URL to another.
-
-
-
-
- Initializes a new instance of the class.
-
- Absolute path (no server name)
- Absolute path (no server name)
-
- server.Add(new RedirectRule("/", "/user/index"));
-
-
-
-
- Initializes a new instance of the class.
-
- Absolute path (no server name)
- Absolute path (no server name)
- true if request should be redirected, false if the request URI should be replaced.
-
- server.Add(new RedirectRule("/", "/user/index"));
-
-
-
-
- Gets string to match request URI with.
-
- Is compared to request.Uri.AbsolutePath
-
-
-
- Gets where to redirect.
-
-
-
-
- Gets whether server should redirect client.
-
-
- false means that the rule will replace
- the current request URI with the new one from this class.
- true means that a redirect response is sent to the client.
-
-
-
-
- Process the incoming request.
-
- incoming HTTP request
- outgoing HTTP response
- true if response should be sent to the browser directly (no other rules or modules will be processed).
-
- returning true means that no modules will get the request. Returning true is typically being done
- for redirects.
-
-
-
-
- Class to make dynamic binding of redirects. Instead of having to specify a number of similar redirect rules
- a regular expression can be used to identify redirect URLs and their targets.
-
-
- [a-z0-9]+)", "/users/${target}?find=true", RegexOptions.IgnoreCase)
- ]]>
-
-
-
-
- Initializes a new instance of the class.
-
- Expression to match URL
- Expression to generate URL
-
- [a-zA-Z0-9]+)", "/user/${first}"));
- Result of ie. /employee1 will then be /user/employee1
- ]]>
-
-
-
-
- Initializes a new instance of the class.
-
- Expression to match URL
- Expression to generate URL
- Regular expression options to use, can be null
-
- [a-zA-Z0-9]+)", "/user/{first}", RegexOptions.IgnoreCase));
- Result of ie. /employee1 will then be /user/employee1
- ]]>
-
-
-
-
- Initializes a new instance of the class.
-
- Expression to match URL
- Expression to generate URL
- Regular expression options to apply
- true if request should be redirected, false if the request URI should be replaced.
-
- [a-zA-Z0-9]+)", "/user/${first}", RegexOptions.None));
- Result of ie. /employee1 will then be /user/employee1
- ]]>
-
- Argument is null.
-
-
-
-
- Process the incoming request.
-
- incoming HTTP request
- outgoing HTTP response
- true if response should be sent to the browser directly (no other rules or modules will be processed).
-
- returning true means that no modules will get the request. Returning true is typically being done
- for redirects.
-
- If request or response is null
-
-
-
- Interface for sessions
-
-
-
-
- Session id
-
-
-
-
- Should
-
- Name of the session variable
- null if it's not set
- If the object cant be serialized.
-
-
-
- When the session was last accessed.
- This property is touched by the http server each time the
- session is requested.
-
-
-
-
- Number of session variables.
-
-
-
-
- Remove everything from the session
-
-
-
-
- Remove everything from the session
-
- True if the session is cleared due to expiration
-
-
-
- Event triggered upon clearing the session
-
-
-
-
- Arguments sent when a is cleared
-
-
-
-
- Instantiates the arguments for the event
-
- True if the session is cleared due to expiration
-
-
-
- Returns true if the session is cleared due to expiration
-
-
-
-
- Delegate for when a IHttpSession is cleared
-
- this is being cleared.
- Arguments for the clearing
-
-
-
- A session store is used to store and load sessions on a media.
- The default implementation () saves/retrieves sessions from memory.
-
-
-
-
- Load a session from the store
-
-
- null if session is not found.
-
-
-
- Number of minutes before a session expires.
-
- Default time is 20 minutes.
-
-
-
- Creates a new http session with a generated id.
-
- A object
-
-
-
- Creates a new http session with a specific id
-
- Id used to identify the new cookie..
- A object.
-
- Id should be generated by the store implementation if it's null or .
-
-
-
-
- Load an existing session.
-
- Session id (usually retrieved from a client side cookie).
- A session if found; otherwise null.
-
-
-
- Save an updated session to the store.
-
- Session id (usually retrieved from a client side cookie).
- If Id property have not been specified.
-
-
-
- We use the flyweight pattern which reuses small objects
- instead of creating new each time.
-
- Unused session that should be reused next time Create is called.
-
-
-
- Remove expired sessions
-
-
-
-
- Remove a session
-
- id of the session.
-
-
-
- A session stored in memory.
-
-
-
-
-
-
- A unique id used by the sessions store to identify the session
-
-
-
- Id
-
-
-
-
-
- Session id
-
-
-
-
- Should
-
- Name of the session variable
- null if it's not set
-
-
-
- when the session was last accessed.
-
-
- Used to determine when the session should be removed.
-
-
-
-
- Number of values in the session
-
-
-
-
- Flag to indicate that the session have been changed
- and should be saved into the session store.
-
-
-
-
- Remove everything from the session
-
-
-
-
- Clears the specified expire.
-
- True if the session is cleared due to expiration
-
-
-
- Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
-
- 2
-
-
-
- Event triggered upon clearing the session
-
-
-
-
- Session store using memory for each session.
-
-
-
-
- Initializes the class setting the expirationtimer to clean the session every minute
-
-
-
-
- Delegate for the cleanup timer
-
-
-
-
- Load a session from the store
-
-
- null if session is not found.
-
-
-
- Creates a new http session
-
-
-
-
-
- Creates a new http session with a specific id
-
- Id used to identify the new cookie..
- A object.
-
- Id should be generated by the store implementation if it's null or .
-
-
-
-
- Load an existing session.
-
-
-
-
-
-
- Save an updated session to the store.
-
-
-
-
-
- We use the flyweight pattern which reuses small objects
- instead of creating new each time.
-
- EmptyLanguageNode (unused) session that should be reused next time Create is called.
-
-
-
- Remove expired sessions
-
-
-
-
- Remove a session
-
- id of the session.
-
-
-
- Number of minutes before a session expires.
- Default is 20 minutes.
-
-
-
-
--
cgit v1.1
From 6a02ac634b99468a0df62cdf43254020488fcb7b Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 17 Jul 2016 11:39:38 +0100
Subject: identify contexts by ID now avaiable ( pipeline serialization)
---
.../Servers/HttpServer/PollServiceHttpRequest.cs | 13 +++++++++----
bin/HttpServer_OpenSim.dll | Bin 130560 -> 130560 bytes
bin/HttpServer_OpenSim.pdb | Bin 355840 -> 355840 bytes
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
index 0e4a941..9083e12 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
@@ -47,8 +47,10 @@ namespace OpenSim.Framework.Servers.HttpServer
public readonly UUID RequestID;
public int contextHash;
+/*
private void GenContextHash()
{
+
Random rnd = new Random();
contextHash = 0;
if (Request.Headers["remote_addr"] != null)
@@ -62,8 +64,9 @@ namespace OpenSim.Framework.Servers.HttpServer
}
else
contextHash += rnd.Next() & 0xffff;
- }
+ }
+*/
public PollServiceHttpRequest(
PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest)
{
@@ -72,7 +75,8 @@ namespace OpenSim.Framework.Servers.HttpServer
Request = pRequest;
RequestTime = System.Environment.TickCount;
RequestID = UUID.Random();
- GenContextHash();
+// GenContextHash();
+ contextHash = HttpContext.contextID;
}
internal void DoHTTPGruntWork(BaseHttpServer server, Hashtable responsedata)
@@ -132,8 +136,9 @@ namespace OpenSim.Framework.Servers.HttpServer
{
if (b1.contextHash != b2.contextHash)
return false;
- bool b = Object.ReferenceEquals(b1.HttpContext, b2.HttpContext);
- return b;
+// bool b = Object.ReferenceEquals(b1.HttpContext, b2.HttpContext);
+// return b;
+ return true;
}
public int GetHashCode(PollServiceHttpRequest b2)
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index 2730e17..bc28ce4 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index 8299d80..ba6b0b0 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From 442b27222828381a27c7c5eddc967a0de4c82d0a Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 17 Jul 2016 13:20:56 +0100
Subject: add a Drop method to PollService Event handlers, Drop requests on
connections known to be lost or delay event check if they are sending a
response
---
OpenSim/Framework/Console/RemoteConsole.cs | 11 ++-
.../Servers/HttpServer/PollServiceEventArgs.cs | 5 +-
.../HttpServer/PollServiceRequestManager.cs | 95 ++++++++++++++--------
.../Linden/Caps/EventQueue/EventQueueGetModule.cs | 6 +-
.../ClientStack/Linden/Caps/GetMeshModule.cs | 11 ++-
.../ClientStack/Linden/Caps/GetTextureModule.cs | 6 +-
.../Linden/Caps/WebFetchInvDescModule.cs | 4 +-
.../CoreModules/Scripting/LSLHttp/UrlModule.cs | 26 +++++-
8 files changed, 123 insertions(+), 41 deletions(-)
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index 8ad7b0d..4b88923 100644
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -234,7 +234,7 @@ namespace OpenSim.Framework.Console
string uri = "/ReadResponses/" + sessionID.ToString() + "/";
m_Server.AddPollServiceHTTPHandler(
- uri, new PollServiceEventArgs(null, uri, HasEvents, GetEvents, NoEvents, sessionID,25000)); // 25 secs timeout
+ uri, new PollServiceEventArgs(null, uri, HasEvents, GetEvents, NoEvents, Drop, sessionID, 25000)); // 25 secs timeout
XmlDocument xmldoc = new XmlDocument();
XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration,
@@ -425,6 +425,15 @@ namespace OpenSim.Framework.Console
return false;
}
+ private void Drop(UUID RequestID, UUID sessionID)
+ {
+ lock (m_Connections)
+ {
+ if (m_Connections.ContainsKey(sessionID))
+ m_Connections.Remove(sessionID);
+ }
+ }
+
private Hashtable GetEvents(UUID RequestID, UUID sessionID)
{
ConsoleConnection c = null;
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
index 3fd3bf7..a9860cc 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs
@@ -37,6 +37,7 @@ namespace OpenSim.Framework.Servers.HttpServer
public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId);
public delegate Hashtable NoEventsMethod(UUID requestID, UUID pId);
+ public delegate void DropMethod(UUID requestID, UUID pId);
public class PollServiceEventArgs : EventArgs
{
@@ -44,6 +45,7 @@ namespace OpenSim.Framework.Servers.HttpServer
public GetEventsMethod GetEvents;
public NoEventsMethod NoEvents;
public RequestMethod Request;
+ public DropMethod Drop;
public UUID Id;
public int TimeOutms;
public EventType Type;
@@ -73,13 +75,14 @@ namespace OpenSim.Framework.Servers.HttpServer
RequestMethod pRequest,
string pUrl,
HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents,
- UUID pId, int pTimeOutms)
+ DropMethod pDrop, UUID pId, int pTimeOutms)
{
Request = pRequest;
Url = pUrl;
HasEvents = pHasEvents;
GetEvents = pGetEvents;
NoEvents = pNoEvents;
+ Drop = pDrop;
Id = pId;
TimeOutms = pTimeOutms;
Type = EventType.LongPoll;
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index ffcad0f..5b40590 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -160,6 +160,19 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
+ public void DropByContext(PollServiceHttpRequest req)
+ {
+ Queue ctxQeueue;
+ lock (m_bycontext)
+ {
+ if (m_bycontext.TryGetValue(req, out ctxQeueue))
+ {
+ ctxQeueue.Clear();
+ m_bycontext.Remove(req);
+ }
+ }
+ }
+
public void EnqueueInt(PollServiceHttpRequest req)
{
if (m_running)
@@ -263,22 +276,61 @@ namespace OpenSim.Framework.Servers.HttpServer
PollServiceHttpRequest req = m_requests.Dequeue(5000);
Watchdog.UpdateThread();
- if (req != null)
+ if(req == null)
+ continue;
+
+ try
{
- try
+ if(!req.HttpContext.CanSend())
{
- if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
+ req.PollServiceArgs.Drop(req.RequestID, req.PollServiceArgs.Id);
+ byContextDequeue(req);
+ continue;
+ }
+
+ if(req.HttpContext.IsSending())
+ {
+ if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
{
- Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id);
+ req.PollServiceArgs.Drop(req.RequestID, req.PollServiceArgs.Id);
+ byContextDequeue(req);
+ }
+ else
+ ReQueueEvent(req);
+ continue;
+ }
+ if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
+ {
+ Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id);
+
+ m_threadPool.QueueWorkItem(x =>
+ {
+ try
+ {
+ req.DoHTTPGruntWork(m_server, responsedata);
+ byContextDequeue(req);
+ }
+ catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
+ {
+ // Ignore it, no need to reply
+ }
+ return null;
+ }, null);
+ }
+ else
+ {
+ if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
+ {
m_threadPool.QueueWorkItem(x =>
{
try
{
- req.DoHTTPGruntWork(m_server, responsedata);
+ req.DoHTTPGruntWork(m_server,
+ req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
byContextDequeue(req);
}
- catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
+ catch (ObjectDisposedException)
{
// Ignore it, no need to reply
}
@@ -287,36 +339,15 @@ namespace OpenSim.Framework.Servers.HttpServer
}
else
{
- if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
- {
- m_threadPool.QueueWorkItem(x =>
- {
- try
- {
- req.DoHTTPGruntWork(m_server,
- req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id));
- byContextDequeue(req);
- }
- catch (ObjectDisposedException)
- {
- // Ignore it, no need to reply
- }
- return null;
- }, null);
- }
- else
- {
- ReQueueEvent(req);
- }
+ ReQueueEvent(req);
}
}
- catch (Exception e)
- {
- m_log.ErrorFormat("Exception in poll service thread: " + e.ToString());
- }
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat("Exception in poll service thread: " + e.ToString());
}
}
}
-
}
}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index cc614f3..18670f5 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -372,7 +372,7 @@ namespace OpenSim.Region.ClientStack.Linden
caps.RegisterPollHandler(
"EventQueueGet",
- new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, SERVER_EQ_TIME_NO_EVENTS));
+ new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, Drop, agentID, SERVER_EQ_TIME_NO_EVENTS));
}
public bool HasEvents(UUID requestID, UUID agentID)
@@ -403,6 +403,10 @@ namespace OpenSim.Region.ClientStack.Linden
ev["message"], m_scene.GetScenePresence(agentId).Name, m_scene.Name);
}
}
+ public void Drop(UUID requestID, UUID pAgentId)
+ {
+ // do nothing for now, hope client close will do it
+ }
public Hashtable GetEvents(UUID requestID, UUID pAgentId)
{
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index f66ef57..7831de3 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -226,7 +226,7 @@ namespace OpenSim.Region.ClientStack.Linden
private Scene m_scene;
private MeshCapsDataThrottler m_throttler;
public PollServiceMeshEventArgs(string uri, UUID pId, Scene scene) :
- base(null, uri, null, null, null, pId, int.MaxValue)
+ base(null, uri, null, null, null, null, pId, int.MaxValue)
{
m_scene = scene;
m_throttler = new MeshCapsDataThrottler(100000, 1400000, 10000, scene, pId);
@@ -241,6 +241,15 @@ namespace OpenSim.Region.ClientStack.Linden
}
};
+
+ Drop= (x, y) =>
+ {
+ lock (responses)
+ {
+ responses.Remove(x);
+ }
+ };
+
GetEvents = (x, y) =>
{
lock (responses)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index 14a59fe..ee7e291 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -222,7 +222,7 @@ namespace OpenSim.Region.ClientStack.Linden
private Scene m_scene;
private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000);
public PollServiceTextureEventArgs(UUID pId, Scene scene) :
- base(null, "", null, null, null, pId, int.MaxValue)
+ base(null, "", null, null, null, null, pId, int.MaxValue)
{
m_scene = scene;
// x is request id, y is userid
@@ -236,6 +236,9 @@ namespace OpenSim.Region.ClientStack.Linden
}
};
+
+ Drop = (x, y) => { lock (responses) responses.Remove(x); };
+
GetEvents = (x, y) =>
{
lock (responses)
@@ -423,7 +426,6 @@ namespace OpenSim.Region.ClientStack.Linden
internal sealed class CapsDataThrottler
{
-
private volatile int currenttime = 0;
private volatile int lastTimeElapsed = 0;
private volatile int BytesSent = 0;
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index ba4fb76..bde94e6 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -256,11 +256,13 @@ namespace OpenSim.Region.ClientStack.Linden
private WebFetchInvDescModule m_module;
public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) :
- base(null, url, null, null, null, pId, int.MaxValue)
+ base(null, url, null, null, null, null, pId, int.MaxValue)
{
m_module = module;
HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); };
+ Drop = (x, y) => { lock (responses) responses.Remove(x); };
+
GetEvents = (x, y) =>
{
lock (responses)
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index f563c68..c118f33 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -225,7 +225,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
string uri = "/lslhttp/" + urlcode.ToString() + "/";
PollServiceEventArgs args
- = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000);
+ = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000);
args.Type = PollServiceEventArgs.EventType.LslHttp;
m_HttpServer.AddPollServiceHTTPHandler(uri, args);
@@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
string uri = "/lslhttps/" + urlcode.ToString() + "/";
PollServiceEventArgs args
- = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000);
+ = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000);
args.Type = PollServiceEventArgs.EventType.LslHttp;
m_HttpsServer.AddPollServiceHTTPHandler(uri, args);
@@ -530,6 +530,28 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
}
}
}
+
+ private void Drop(UUID requestID, UUID sessionID)
+ {
+ UrlData url = null;
+ lock (m_RequestMap)
+ {
+ if (m_RequestMap.ContainsKey(requestID))
+ {
+ url = m_RequestMap[requestID];
+ m_RequestMap.Remove(requestID);
+ if(url != null)
+ {
+ lock (url.requests)
+ {
+ if(url.requests.ContainsKey(requestID))
+ url.requests.Remove(requestID);
+ }
+ }
+ }
+ }
+ }
+
private Hashtable GetEvents(UUID requestID, UUID sessionID)
{
UrlData url = null;
--
cgit v1.1
From e881562d34bcd67b4fb09c499b008db576b7e368 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 17 Jul 2016 14:15:46 +0100
Subject: fix drop on delayed events processing
---
.../ClientStack/Linden/Caps/GetMeshModule.cs | 46 ++++++++---
.../ClientStack/Linden/Caps/GetTextureModule.cs | 89 ++++++++++++++--------
.../Linden/Caps/WebFetchInvDescModule.cs | 40 +++++++++-
3 files changed, 130 insertions(+), 45 deletions(-)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index 7831de3..783c3de 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -222,6 +222,7 @@ namespace OpenSim.Region.ClientStack.Linden
new List();
private Dictionary responses =
new Dictionary();
+ private HashSet dropedResponses = new HashSet();
private Scene m_scene;
private MeshCapsDataThrottler m_throttler;
@@ -242,11 +243,13 @@ namespace OpenSim.Region.ClientStack.Linden
}
};
- Drop= (x, y) =>
+ Drop = (x, y) =>
{
lock (responses)
{
responses.Remove(x);
+ lock(dropedResponses)
+ dropedResponses.Add(x);
}
};
@@ -307,26 +310,47 @@ namespace OpenSim.Region.ClientStack.Linden
if(m_scene.ShuttingDown)
return;
- // If the avatar is gone, don't bother to get the texture
- if (m_scene.GetScenePresence(Id) == null)
+ lock(responses)
{
- response = new Hashtable();
+ lock(dropedResponses)
+ {
+ if(dropedResponses.Contains(requestID))
+ {
+ dropedResponses.Remove(requestID);
+ return;
+ }
+ }
+
+ // If the avatar is gone, don't bother to get the texture
+ if (m_scene.GetScenePresence(Id) == null)
+ {
+ response = new Hashtable();
- response["int_response_code"] = 500;
- response["str_response_string"] = "Script timeout";
- response["content_type"] = "text/plain";
- response["keepalive"] = false;
- response["reusecontext"] = false;
+ response["int_response_code"] = 500;
+ response["str_response_string"] = "Script timeout";
+ response["content_type"] = "text/plain";
+ response["keepalive"] = false;
+ response["reusecontext"] = false;
- lock (responses)
responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 };
- return;
+ return;
+ }
}
response = m_getMeshHandler.Handle(requestinfo.request);
+
lock (responses)
{
+ lock(dropedResponses)
+ {
+ if(dropedResponses.Contains(requestID))
+ {
+ dropedResponses.Remove(requestID);
+ return;
+ }
+ }
+
responses[requestID] = new aPollResponse()
{
bytes = (int)response["int_bytes"],
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index ee7e291..15c0967 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -218,6 +218,7 @@ namespace OpenSim.Region.ClientStack.Linden
new List();
private Dictionary responses =
new Dictionary();
+ private HashSet dropedResponses = new HashSet();
private Scene m_scene;
private CapsDataThrottler m_throttler = new CapsDataThrottler(100000, 1400000,10000);
@@ -237,7 +238,14 @@ namespace OpenSim.Region.ClientStack.Linden
}
};
- Drop = (x, y) => { lock (responses) responses.Remove(x); };
+ Drop = (x, y) =>
+ {
+ lock (responses)
+ {
+ responses.Remove(x);
+ dropedResponses.Add(x);
+ }
+ };
GetEvents = (x, y) =>
{
@@ -307,52 +315,71 @@ namespace OpenSim.Region.ClientStack.Linden
if(m_scene.ShuttingDown)
return;
- if (requestinfo.send503)
+ lock (responses)
{
- response = new Hashtable();
+ lock(dropedResponses)
+ {
+ if(dropedResponses.Contains(requestID))
+ {
+ dropedResponses.Remove(requestID);
+ return;
+ }
+ }
- response["int_response_code"] = 503;
- response["str_response_string"] = "Throttled";
- response["content_type"] = "text/plain";
- response["keepalive"] = false;
- response["reusecontext"] = false;
+ if (requestinfo.send503)
+ {
+ response = new Hashtable();
- Hashtable headers = new Hashtable();
- headers["Retry-After"] = 30;
- response["headers"] = headers;
-
- lock (responses)
+ response["int_response_code"] = 503;
+ response["str_response_string"] = "Throttled";
+ response["content_type"] = "text/plain";
+ response["keepalive"] = false;
+ response["reusecontext"] = false;
+
+ Hashtable headers = new Hashtable();
+ headers["Retry-After"] = 30;
+ response["headers"] = headers;
+
responses[requestID] = new aPollResponse() {bytes = 0, response = response};
- return;
- }
+ return;
+ }
// If the avatar is gone, don't bother to get the texture
- if (m_scene.GetScenePresence(Id) == null)
- {
- response = new Hashtable();
+ if (m_scene.GetScenePresence(Id) == null)
+ {
+ response = new Hashtable();
- response["int_response_code"] = 500;
- response["str_response_string"] = "Script timeout";
- response["content_type"] = "text/plain";
- response["keepalive"] = false;
- response["reusecontext"] = false;
+ response["int_response_code"] = 500;
+ response["str_response_string"] = "Script timeout";
+ response["content_type"] = "text/plain";
+ response["keepalive"] = false;
+ response["reusecontext"] = false;
- lock (responses)
responses[requestID] = new aPollResponse() {bytes = 0, response = response};
- return;
+ return;
+ }
}
-
+
response = m_getTextureHandler.Handle(requestinfo.request);
+
lock (responses)
{
+ lock(dropedResponses)
+ {
+ if(dropedResponses.Contains(requestID))
+ {
+ dropedResponses.Remove(requestID);
+ m_throttler.ProcessTime();
+ return;
+ }
+ }
responses[requestID] = new aPollResponse()
- {
- bytes = (int) response["int_bytes"],
- response = response
- };
-
+ {
+ bytes = (int) response["int_bytes"],
+ response = response
+ };
}
m_throttler.ProcessTime();
}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index bde94e6..ed5b3dd 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -250,8 +250,8 @@ namespace OpenSim.Region.ClientStack.Linden
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private Dictionary responses =
- new Dictionary();
+ private Dictionary responses = new Dictionary();
+ private HashSet dropedResponses = new HashSet();
private WebFetchInvDescModule m_module;
@@ -261,7 +261,16 @@ namespace OpenSim.Region.ClientStack.Linden
m_module = module;
HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); };
- Drop = (x, y) => { lock (responses) responses.Remove(x); };
+
+ Drop = (x, y) =>
+ {
+ lock (responses)
+ {
+ responses.Remove(x);
+ lock(dropedResponses)
+ dropedResponses.Add(x);
+ }
+ };
GetEvents = (x, y) =>
{
@@ -367,6 +376,19 @@ namespace OpenSim.Region.ClientStack.Linden
UUID requestID = requestinfo.reqID;
+
+ lock(responses)
+ {
+ lock(dropedResponses)
+ {
+ if(dropedResponses.Contains(requestID))
+ {
+ dropedResponses.Remove(requestID);
+ return;
+ }
+ }
+ }
+
Hashtable response = new Hashtable();
response["int_response_code"] = 200;
@@ -379,6 +401,18 @@ namespace OpenSim.Region.ClientStack.Linden
lock (responses)
{
+ lock(dropedResponses)
+ {
+ if(dropedResponses.Contains(requestID))
+ {
+ dropedResponses.Remove(requestID);
+ requestinfo.folders.Clear();
+ requestinfo.request.Clear();
+ WebFetchInvDescModule.ProcessedRequestsCount++;
+ return;
+ }
+ }
+
if (responses.ContainsKey(requestID))
m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054");
responses[requestID] = response;
--
cgit v1.1
From 79e464f33fa60e5164874e4c3e2a189c52924ae1 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 17 Jul 2016 16:16:24 +0100
Subject: dont try dequeues if didnt reacquired lock
---
OpenSim/Framework/BlockingQueue.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs
index daf99a8..f6861e4 100644
--- a/OpenSim/Framework/BlockingQueue.cs
+++ b/OpenSim/Framework/BlockingQueue.cs
@@ -78,7 +78,8 @@ namespace OpenSim.Framework
{
if (m_queue.Count < 1 && m_pqueue.Count < 1)
{
- Monitor.Wait(m_queueSync, msTimeout);
+ if(!Monitor.Wait(m_queueSync, msTimeout))
+ return default(T);
}
if (m_pqueue.Count > 0)
--
cgit v1.1
From eaefae7e20c95266ad84ea59912cf8c011ccd1b5 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 17 Jul 2016 22:52:58 +0100
Subject: don't loose inventory items when there are bad folders
---
.../Handlers/FetchInventory/FetchInvDescHandler.cs | 98 ++++++++++------------
.../Linden/Caps/WebFetchInvDescModule.cs | 12 +--
2 files changed, 49 insertions(+), 61 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
index e3a9a22..45eda57 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
@@ -30,6 +30,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
+using System.Text;
using log4net;
using Nini.Config;
using OpenMetaverse;
@@ -93,8 +94,8 @@ namespace OpenSim.Capabilities.Handlers
ArrayList foldersrequested = (ArrayList)hash["folders"];
- string response = "";
- string bad_folders_response = "";
+ StringBuilder tmpresponse = new StringBuilder(1024);
+ StringBuilder tmpbadfolders = new StringBuilder(1024);
List folders = new List();
for (int i = 0; i < foldersrequested.Count; i++)
@@ -142,43 +143,38 @@ namespace OpenSim.Capabilities.Handlers
inventoryitemstr = inventoryitemstr.Replace("", "");
- response += inventoryitemstr;
+ tmpresponse.Append(inventoryitemstr);
}
//m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders));
foreach (UUID bad in bad_folders)
- bad_folders_response += "" + bad + "";
+ {
+ tmpbadfolders.Append("");
+ }
}
- if (response.Length == 0)
+ StringBuilder lastresponse = new StringBuilder(1024);
+ lastresponse.Append("");
+ if(tmpresponse.Length > 0)
{
- /* Viewers expect a bad_folders array when not available */
- if (bad_folders_response.Length != 0)
- {
- response = "";
- }
- else
- {
- response = "";
- }
+ lastresponse.Append("");
}
else
+ lastresponse.Append("");
+
+ if(tmpbadfolders.Length > 0)
{
- if (bad_folders_response.Length != 0)
- {
- response = "";
- }
- else
- {
- response = "";
- }
+ lastresponse.Append("");
}
+ lastresponse.Append("");
- //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request for {0} folders. Item count {1}", folders.Count, item_count);
- //m_log.Debug("[WEB FETCH INV DESC HANDLER] " + response);
-
- return response;
-
+ return lastresponse.ToString();
}
///
@@ -285,8 +281,8 @@ namespace OpenSim.Capabilities.Handlers
{
//m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Received request for {0} folders", foldersrequested.Count);
- string response = "";
- string bad_folders_response = "";
+ StringBuilder tmpresponse = new StringBuilder(1024);
+ StringBuilder tmpbadfolders = new StringBuilder(1024);
for (int i = 0; i < foldersrequested.Count; i++)
{
@@ -308,7 +304,9 @@ namespace OpenSim.Capabilities.Handlers
if (null == reply)
{
- bad_folders_response += "" + llsdRequest.folder_id.ToString() + "";
+ tmpbadfolders.Append("");
}
else
{
@@ -317,39 +315,29 @@ namespace OpenSim.Capabilities.Handlers
inventoryitemstr = inventoryitemstr.Replace("", "");
}
- response += inventoryitemstr;
+ tmpresponse.Append(inventoryitemstr);
}
- if (response.Length == 0)
+ StringBuilder lastresponse = new StringBuilder(1024);
+ lastresponse.Append("");
+ if(tmpresponse.Length > 0)
{
- /* Viewers expect a bad_folders array when not available */
- if (bad_folders_response.Length != 0)
- {
- response = "";
- }
- else
- {
- response = "";
- }
+ lastresponse.Append("");
}
else
+ lastresponse.Append("");
+
+ if(tmpbadfolders.Length > 0)
{
- if (bad_folders_response.Length != 0)
- {
- response = "";
- }
- else
- {
- response = "";
- }
+ lastresponse.Append("");
}
+ lastresponse.Append("");
- // m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request");
- //m_log.Debug("[WEB FETCH INV DESC HANDLER] "+response);
-
- return response;
-
- // }
+ return lastresponse.ToString();
}
///
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
index ed5b3dd..0277a24 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs
@@ -61,7 +61,6 @@ namespace OpenSim.Region.ClientStack.Linden
public UUID reqID;
public Hashtable request;
public ScenePresence presence;
- public List folders;
}
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -296,8 +295,10 @@ namespace OpenSim.Region.ClientStack.Linden
reqinfo.reqID = x;
reqinfo.request = y;
reqinfo.presence = sp;
- reqinfo.folders = new List();
+/* why where we doing this? just to get cof ?
+ List folders = new List();
+
// Decode the request here
string request = y["body"].ToString();
@@ -333,11 +334,11 @@ namespace OpenSim.Region.ClientStack.Linden
UUID folderID;
if (UUID.TryParse(folder, out folderID))
{
- if (!reqinfo.folders.Contains(folderID))
+ if (!folders.Contains(folderID))
{
if (sp.COF != UUID.Zero && sp.COF == folderID)
highPriority = true;
- reqinfo.folders.Add(folderID);
+ folders.Add(folderID);
}
}
}
@@ -345,6 +346,7 @@ namespace OpenSim.Region.ClientStack.Linden
if (highPriority)
m_queue.PriorityEnqueue(reqinfo);
else
+*/
m_queue.Enqueue(reqinfo);
};
@@ -406,7 +408,6 @@ namespace OpenSim.Region.ClientStack.Linden
if(dropedResponses.Contains(requestID))
{
dropedResponses.Remove(requestID);
- requestinfo.folders.Clear();
requestinfo.request.Clear();
WebFetchInvDescModule.ProcessedRequestsCount++;
return;
@@ -417,7 +418,6 @@ namespace OpenSim.Region.ClientStack.Linden
m_log.WarnFormat("[FETCH INVENTORY DESCENDENTS2 MODULE]: Caught in the act of loosing responses! Please report this on mantis #7054");
responses[requestID] = response;
}
- requestinfo.folders.Clear();
requestinfo.request.Clear();
WebFetchInvDescModule.ProcessedRequestsCount++;
}
--
cgit v1.1
From 46c55b6fa08b089961fe7fff4079295bfa24dc87 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 19 Jul 2016 18:56:32 +0100
Subject: some cleanup on FetchInvDescHandler
---
.../Handlers/FetchInventory/FetchInvDescHandler.cs | 170 +++------------------
1 file changed, 22 insertions(+), 148 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
index 45eda57..8998b7a 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
@@ -60,7 +60,6 @@ namespace OpenSim.Capabilities.Handlers
m_LibraryService = libService;
m_Scene = s;
}
-
public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
@@ -137,13 +136,13 @@ namespace OpenSim.Capabilities.Handlers
string inventoryitemstr = string.Empty;
foreach (InventoryCollectionWithDescendents icoll in invcollSet)
{
- LLSDInventoryDescendents reply = ToLLSD(icoll.Collection, icoll.Descendents);
-
- inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply);
- inventoryitemstr = inventoryitemstr.Replace("", "");
-
- tmpresponse.Append(inventoryitemstr);
+ LLSDInventoryFolderContents thiscontents = contentsToLLSD(icoll.Collection, icoll.Descendents);
+ inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(thiscontents);
+// inventoryitemstr = inventoryitemstr.Replace("", "");
+// inventoryitemstr = inventoryitemstr.Replace("", "");
+// inventoryitemstr = inventoryitemstr.Substring(6,inventoryitemstr.Length - 13);
+// tmpresponse.Append(inventoryitemstr);
+ tmpresponse.Append(inventoryitemstr.Substring(6,inventoryitemstr.Length - 13));
}
//m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders));
@@ -236,16 +235,13 @@ namespace OpenSim.Capabilities.Handlers
return reply;
}
- private LLSDInventoryDescendents ToLLSD(InventoryCollection inv, int descendents)
+ private LLSDInventoryFolderContents contentsToLLSD(InventoryCollection inv, int descendents)
{
- LLSDInventoryDescendents reply = new LLSDInventoryDescendents();
LLSDInventoryFolderContents contents = new LLSDInventoryFolderContents();
contents.agent_id = inv.OwnerID;
contents.owner_id = inv.OwnerID;
contents.folder_id = inv.FolderID;
- reply.folders.Array.Add(contents);
-
if (inv.Folders != null)
{
foreach (InventoryFolderBase invFolder in inv.Folders)
@@ -267,7 +263,7 @@ namespace OpenSim.Capabilities.Handlers
contents.descendents = descendents;
contents.version = inv.Version;
- return reply;
+ return contents;
}
///
/// Old style. Soon to be deprecated.
@@ -424,108 +420,7 @@ namespace OpenSim.Capabilities.Handlers
itemsToReturn.Insert(0, linkedItem);
}
}
-
- // Now scan for folder links and insert the items they target and those links at the head of the return data
-
-/* dont send contents of LinkFolders.
-from docs seems this was never a spec
-
- foreach (InventoryItemBase item in originalItems)
- {
- if (item.AssetType == (int)AssetType.LinkFolder)
- {
- InventoryCollection linkedFolderContents = m_InventoryService.GetFolderContent(ownerID, item.AssetID);
- List links = linkedFolderContents.Items;
-
- itemsToReturn.InsertRange(0, links);
-
- foreach (InventoryItemBase link in linkedFolderContents.Items)
- {
- // Take care of genuinely broken links where the target doesn't exist
- // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
- // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
- // rather than having to keep track of every folder requested in the recursion.
- if (link != null)
- {
-// m_log.DebugFormat(
-// "[WEB FETCH INV DESC HANDLER]: Adding item {0} {1} from folder {2} linked from {3}",
-// link.Name, (AssetType)link.AssetType, item.AssetID, containingFolder.Name);
-
- InventoryItemBase linkedItem
- = m_InventoryService.GetItem(new InventoryItemBase(link.AssetID));
-
- if (linkedItem != null)
- itemsToReturn.Insert(0, linkedItem);
- }
- }
- }
- }
-*/
}
-
-// foreach (InventoryItemBase item in contents.Items)
-// {
-// m_log.DebugFormat(
-// "[WEB FETCH INV DESC HANDLER]: Returning item {0}, type {1}, parent {2} in {3} {4}",
-// item.Name, (AssetType)item.AssetType, item.Folder, containingFolder.Name, containingFolder.ID);
-// }
-
- // =====
-
-//
-// foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
-// {
-// m_log.DebugFormat(
-// "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
-// linkedItem.Name, folderID, agentID);
-//
-// contents.Items.Add(linkedItem);
-// }
-//
-// // If the folder requested contains links, then we need to send those folders first, otherwise the links
-// // will be broken in the viewer.
-// HashSet linkedItemFolderIdsToSend = new HashSet();
-// foreach (InventoryItemBase item in contents.Items)
-// {
-// if (item.AssetType == (int)AssetType.Link)
-// {
-// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
-//
-// // Take care of genuinely broken links where the target doesn't exist
-// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
-// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
-// // rather than having to keep track of every folder requested in the recursion.
-// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
-// {
-// // We don't need to send the folder if source and destination of the link are in the same
-// // folder.
-// if (linkedItem.Folder != containingFolder.ID)
-// linkedItemFolderIdsToSend.Add(linkedItem.Folder);
-// }
-// }
-// }
-//
-// foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
-// {
-// m_log.DebugFormat(
-// "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
-// linkedItemFolderId, folderID, agentID);
-//
-// int dummyVersion;
-// InventoryCollection linkedCollection
-// = Fetch(
-// agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
-//
-// InventoryFolderBase linkedFolder = new InventoryFolderBase(linkedItemFolderId);
-// linkedFolder.Owner = agentID;
-// linkedFolder = m_InventoryService.GetFolder(linkedFolder);
-//
-//// contents.Folders.AddRange(linkedCollection.Folders);
-//
-// contents.Folders.Add(linkedFolder);
-// contents.Items.AddRange(linkedCollection.Items);
-// }
-// }
}
}
else
@@ -696,42 +591,21 @@ from docs seems this was never a spec
if (freq.fetch_items && contents.Items != null)
{
- List itemsToReturn = contents.Items;
-
+ // viewers are lasy and want a copy of the link item sent before the link to it
+
// descendents must only include the links, not the linked items we add
- coll.Descendents = itemsToReturn.Count;
+ coll.Descendents = contents.Items.Count;
- // Add target items for links in this folder before the links themselves.
+ // look for item links
List itemIDs = new List();
- List folderIDs = new List();
- foreach (InventoryItemBase item in itemsToReturn)
+ foreach (InventoryItemBase item in contents.Items)
{
//m_log.DebugFormat("[XXX]: {0} {1}", item.Name, item.AssetType);
if (item.AssetType == (int)AssetType.Link)
itemIDs.Add(item.AssetID);
-
-// else if (item.AssetType == (int)AssetType.LinkFolder)
-// folderIDs.Add(item.AssetID);
- }
-
- //m_log.DebugFormat("[XXX]: folder {0} has {1} links and {2} linkfolders", contents.FolderID, itemIDs.Count, folderIDs.Count);
-
- // Scan for folder links and insert the items they target and those links at the head of the return data
- if (folderIDs.Count > 0)
- {
- InventoryCollection[] linkedFolders = m_InventoryService.GetMultipleFoldersContent(coll.Collection.OwnerID, folderIDs.ToArray());
- foreach (InventoryCollection linkedFolderContents in linkedFolders)
- {
- if (linkedFolderContents == null)
- continue;
-
- List links = linkedFolderContents.Items;
-
- itemsToReturn.InsertRange(0, links);
-
- }
}
+ // get the linked if any
if (itemIDs.Count > 0)
{
InventoryItemBase[] linked = m_InventoryService.GetMultipleItems(freq.owner_id, itemIDs.ToArray());
@@ -746,13 +620,11 @@ from docs seems this was never a spec
linked[i++] = m_InventoryService.GetItem(freq.owner_id, id);
}
}
-
- //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Processing folder {0}. Existing items:", freq.folder_id);
- //foreach (InventoryItemBase item in itemsToReturn)
- // m_log.DebugFormat("[XXX]: {0} {1} {2}", item.Name, item.AssetType, item.Folder);
-
+
if (linked != null)
{
+ List linkedItems = new List();
+ // check for broken
foreach (InventoryItemBase linkedItem in linked)
{
// Take care of genuinely broken links where the target doesn't exist
@@ -761,14 +633,16 @@ from docs seems this was never a spec
// rather than having to keep track of every folder requested in the recursion.
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
{
- itemsToReturn.Insert(0, linkedItem);
+ linkedItems.Add(linkedItem);
//m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Added {0} {1} {2}", linkedItem.Name, linkedItem.AssetType, linkedItem.Folder);
}
}
+ // insert them
+ if(linkedItems.Count > 0)
+ contents.Items.InsertRange(0,linkedItems);
}
}
}
-
}
///
--
cgit v1.1
From 2c6db4f617eb23581e9f7c144f96f5a55ba77803 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 19 Jul 2016 19:01:03 +0100
Subject: fix a typo
---
OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
index 8998b7a..525381d 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
@@ -591,7 +591,7 @@ namespace OpenSim.Capabilities.Handlers
if (freq.fetch_items && contents.Items != null)
{
- // viewers are lasy and want a copy of the link item sent before the link to it
+ // viewers are lasy and want a copy of the linked item sent before the link to it
// descendents must only include the links, not the linked items we add
coll.Descendents = contents.Items.Count;
--
cgit v1.1
From 2cacd77d41552b0290ecf46186360a97c531e2cd Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 19 Jul 2016 23:49:41 +0100
Subject: let FS get a answer to folder uuid.zero, (still seems a no op); send
Library folders list"
---
.../Handlers/FetchInventory/FetchInvDescHandler.cs | 49 +++++++---------------
1 file changed, 14 insertions(+), 35 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
index 525381d..2fb1c63 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
@@ -248,8 +248,6 @@ namespace OpenSim.Capabilities.Handlers
{
contents.categories.Array.Add(ConvertInventoryFolder(invFolder));
}
-
- descendents += inv.Folders.Count;
}
if (inv.Items != null)
@@ -449,13 +447,14 @@ namespace OpenSim.Capabilities.Handlers
{
InventoryCollectionWithDescendents ret = new InventoryCollectionWithDescendents();
ret.Collection = new InventoryCollection();
- ret.Collection.Folders = new List();
+// ret.Collection.Folders = new List();
+ ret.Collection.Folders = fold.RequestListOfFolders();
ret.Collection.Items = fold.RequestListOfItems();
ret.Collection.OwnerID = m_LibraryService.LibraryRootFolder.Owner;
ret.Collection.FolderID = f.folder_id;
ret.Collection.Version = fold.Version;
- ret.Descendents = ret.Collection.Items.Count;
+ ret.Descendents = ret.Collection.Items.Count + ret.Collection.Folders.Count;
result.Add(ret);
//m_log.DebugFormat("[XXX]: Added libfolder {0} ({1}) {2}", ret.Collection.FolderID, ret.Collection.OwnerID);
@@ -477,11 +476,18 @@ namespace OpenSim.Capabilities.Handlers
// Filter folder Zero right here. Some viewers (Firestorm) send request for folder Zero, which doesn't make sense
// and can kill the sim (all root folders have parent_id Zero)
+ // send something.
LLSDFetchInventoryDescendents zero = fetchFolders.Find(f => f.folder_id == UUID.Zero);
if (zero != null)
{
fetchFolders.Remove(zero);
- BadFolder(zero, null, bad_folders);
+ InventoryCollectionWithDescendents zeroColl = new InventoryCollectionWithDescendents();
+ zeroColl.Collection = new InventoryCollection();
+ zeroColl.Collection.OwnerID = zero.owner_id;
+ zeroColl.Collection.Version = 0;
+ zeroColl.Collection.FolderID = zero.folder_id;
+ zeroColl.Descendents = 0;
+ result.Add(zeroColl);
}
if (fetchFolders.Count > 0)
@@ -549,35 +555,8 @@ namespace OpenSim.Capabilities.Handlers
}
else
{
- // Was it really a request for folder Zero?
- // This is an overkill, but Firestorm really asks for folder Zero.
- // I'm leaving the code here for the time being, but commented.
- if (freq.folder_id == UUID.Zero)
- {
- //coll.Collection.OwnerID = freq.owner_id;
- //coll.Collection.FolderID = contents.FolderID;
- //containingFolder = m_InventoryService.GetRootFolder(freq.owner_id);
- //if (containingFolder != null)
- //{
- // m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Request for parent of folder {0}", containingFolder.ID);
- // coll.Collection.Folders.Clear();
- // coll.Collection.Folders.Add(containingFolder);
- // if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null)
- // {
- // InventoryFolderBase lib = new InventoryFolderBase(m_LibraryService.LibraryRootFolder.ID, m_LibraryService.LibraryRootFolder.Owner);
- // lib.Name = m_LibraryService.LibraryRootFolder.Name;
- // lib.Type = m_LibraryService.LibraryRootFolder.Type;
- // lib.Version = m_LibraryService.LibraryRootFolder.Version;
- // coll.Collection.Folders.Add(lib);
- // }
- // coll.Collection.Items.Clear();
- //}
- }
- else
- {
- m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Unable to fetch folder {0}", freq.folder_id);
- bad_folders.Add(freq.folder_id);
- }
+ m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Unable to fetch folder {0}", freq.folder_id);
+ bad_folders.Add(freq.folder_id);
bad = true;
}
}
@@ -594,7 +573,7 @@ namespace OpenSim.Capabilities.Handlers
// viewers are lasy and want a copy of the linked item sent before the link to it
// descendents must only include the links, not the linked items we add
- coll.Descendents = contents.Items.Count;
+ coll.Descendents = contents.Items.Count + contents.Folders.Count;
// look for item links
List itemIDs = new List();
--
cgit v1.1
From 475087de7933e58ec95b418a113768abd2a296f9 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 21 Jul 2016 11:22:13 +0100
Subject: add a gatekeeper login fail reason reply
---
OpenSim/Services/HypergridService/GatekeeperService.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 9643a8b..e3b5f71 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -287,7 +287,8 @@ namespace OpenSim.Services.HypergridService
if (dm.Success)
{
- m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", curViewer);
+ reason = "Login failed: Viewer " + curViewer + " is denied";
+ m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: viewer {0} is denied", curViewer);
return false;
}
}
--
cgit v1.1
From 2062418c5685b6975610f54052ba93e4fd6191b1 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 21 Jul 2016 11:34:17 +0100
Subject: add another gatekeeper login fail reason reply
---
OpenSim/Services/HypergridService/GatekeeperService.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index e3b5f71..3c77924 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -275,6 +275,7 @@ namespace OpenSim.Services.HypergridService
if (!am.Success)
{
+ reason = "Login failed: client " + curViewer + " is not allowed";
m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is not allowed", curViewer);
return false;
}
@@ -287,8 +288,8 @@ namespace OpenSim.Services.HypergridService
if (dm.Success)
{
- reason = "Login failed: Viewer " + curViewer + " is denied";
- m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: viewer {0} is denied", curViewer);
+ reason = "Login failed: client " + curViewer + " is denied";
+ m_log.InfoFormat("[GATEKEEPER SERVICE]: Login failed, reason: client {0} is denied", curViewer);
return false;
}
}
--
cgit v1.1
From 8d22b79ba49fd5a53c94f517408adb3a4fa1c100 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 7 Aug 2016 14:30:27 +0100
Subject: several changes related to culling option
---
OpenSim/Framework/IClientAPI.cs | 52 +++---
OpenSim/Framework/PriorityQueue.cs | 12 +-
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 188 ++++++++++-----------
3 files changed, 116 insertions(+), 136 deletions(-)
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 018f194..0140733 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -585,10 +585,10 @@ namespace OpenSim.Framework
public float dwell;
}
- public class IEntityUpdate
+ public class EntityUpdate
{
private ISceneEntity m_entity;
- private uint m_flags;
+ private PrimUpdateFlags m_flags;
private int m_updateTime;
public ISceneEntity Entity
@@ -596,7 +596,7 @@ namespace OpenSim.Framework
get { return m_entity; }
}
- public uint Flags
+ public PrimUpdateFlags Flags
{
get { return m_flags; }
}
@@ -606,23 +606,31 @@ namespace OpenSim.Framework
get { return m_updateTime; }
}
- public virtual void Update(IEntityUpdate update)
+ public virtual void Update(EntityUpdate update)
{
- m_flags |= update.Flags;
+ PrimUpdateFlags updateFlags = update.Flags;
+ if(updateFlags.HasFlag(PrimUpdateFlags.CancelKill))
+ m_flags = PrimUpdateFlags.FullUpdate;
+ else if(m_flags.HasFlag(PrimUpdateFlags.Kill))
+ return;
+ else if(updateFlags.HasFlag(PrimUpdateFlags.Kill))
+ m_flags = PrimUpdateFlags.Kill;
+ else
+ m_flags |= updateFlags;
// Use the older of the updates as the updateTime
if (Util.EnvironmentTickCountCompare(UpdateTime, update.UpdateTime) > 0)
m_updateTime = update.UpdateTime;
}
- public IEntityUpdate(ISceneEntity entity, uint flags)
+ public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags)
{
m_entity = entity;
m_flags = flags;
m_updateTime = Util.EnvironmentTickCount();
}
- public IEntityUpdate(ISceneEntity entity, uint flags, Int32 updateTime)
+ public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags, Int32 updateTime)
{
m_entity = entity;
m_flags = flags;
@@ -630,29 +638,6 @@ namespace OpenSim.Framework
}
}
- public class EntityUpdate : IEntityUpdate
- {
- private float m_timeDilation;
-
- public float TimeDilation
- {
- get { return m_timeDilation; }
- }
-
- public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags, float timedilation)
- : base(entity, (uint)flags)
- {
- // Flags = flags;
- m_timeDilation = timedilation;
- }
-
- public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags, float timedilation, Int32 updateTime)
- : base(entity,(uint)flags,updateTime)
- {
- m_timeDilation = timedilation;
- }
- }
-
public class PlacesReplyData
{
public UUID OwnerID;
@@ -701,9 +686,12 @@ namespace OpenSim.Framework
ExtraData = 1 << 20,
Sound = 1 << 21,
Joint = 1 << 22,
- FullUpdate = UInt32.MaxValue
+ FullUpdate = 0x3fffffff,
+ CancelKill = 0x7fffffff,
+ Kill = 0x80000000
}
+/* included in .net 4.0
public static class PrimUpdateFlagsExtensions
{
public static bool HasFlag(this PrimUpdateFlags updateFlags, PrimUpdateFlags flag)
@@ -711,7 +699,7 @@ namespace OpenSim.Framework
return (updateFlags & flag) == flag;
}
}
-
+*/
public interface IClientAPI
{
Vector3 StartPos { get; set; }
diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs
index 4f05f65..fec01da 100644
--- a/OpenSim/Framework/PriorityQueue.cs
+++ b/OpenSim/Framework/PriorityQueue.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Framework
///
/// Enqueue an item into the specified priority queue
///
- public bool Enqueue(uint pqueue, IEntityUpdate value)
+ public bool Enqueue(uint pqueue, EntityUpdate value)
{
LookupItem lookup;
@@ -154,7 +154,7 @@ namespace OpenSim.Framework
/// oldest item from the next queue in order to provide fair access to
/// all of the queues
///
- public bool TryDequeue(out IEntityUpdate value, out Int32 timeinqueue)
+ public bool TryDequeue(out EntityUpdate value, out Int32 timeinqueue)
{
// If there is anything in imediate queues, return it first no
// matter what else. Breaks fairness. But very useful.
@@ -212,7 +212,7 @@ namespace OpenSim.Framework
}
timeinqueue = 0;
- value = default(IEntityUpdate);
+ value = default(EntityUpdate);
return false;
}
@@ -270,8 +270,8 @@ namespace OpenSim.Framework
#region MinHeapItem
private struct MinHeapItem : IComparable
{
- private IEntityUpdate value;
- internal IEntityUpdate Value {
+ private EntityUpdate value;
+ internal EntityUpdate Value {
get {
return this.value;
}
@@ -307,7 +307,7 @@ namespace OpenSim.Framework
this.pqueue = pqueue;
}
- internal MinHeapItem(uint pqueue, UInt64 entryorder, IEntityUpdate value)
+ internal MinHeapItem(uint pqueue, UInt64 entryorder, EntityUpdate value)
{
this.entrytime = Util.EnvironmentTickCount();
this.entryorder = entryorder;
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index e3b2fd1..b823abe 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3937,7 +3937,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
uint priority = m_prioritizer.GetUpdatePriority(this, entity);
lock (m_entityUpdates.SyncRoot)
- m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation));
+ m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags));
}
///
@@ -4006,12 +4006,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// We must lock for both manipulating the kill record and sending the packet, in order to avoid a race
// condition where a kill can be processed before an out-of-date update for the same object.
// float avgTimeDilation = 0.0f;
- IEntityUpdate iupdate;
+ EntityUpdate update;
Int32 timeinqueue; // this is just debugging code & can be dropped later
bool doCulling = m_scene.ObjectsCullingByDistance;
float cullingrange = 64.0f;
HashSet GroupsNeedFullUpdate = new HashSet();
+ List kills = new List();
// Vector3 mycamera = Vector3.Zero;
Vector3 mypos = Vector3.Zero;
ScenePresence mysp = (ScenePresence)SceneAgent;
@@ -4027,12 +4028,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
while (updatesThisCall < maxUpdates)
{
lock (m_entityUpdates.SyncRoot)
- if (!m_entityUpdates.TryDequeue(out iupdate, out timeinqueue))
+ if (!m_entityUpdates.TryDequeue(out update, out timeinqueue))
break;
-
- EntityUpdate update = (EntityUpdate)iupdate;
-
+
// avgTimeDilation += update.TimeDilation;
+ PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags;
+
+ if(updateFlags.HasFlag(PrimUpdateFlags.Kill))
+ {
+ m_killRecord.Add(update.Entity.LocalId);
+ continue;
+ }
if (update.Entity is SceneObjectPart)
{
@@ -4156,11 +4162,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region UpdateFlags to packet type conversion
- PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags;
-
bool canUseCompressed = true;
bool canUseImproved = true;
+
// Compressed object updates only make sense for LL primitives
if (!(update.Entity is SceneObjectPart))
{
@@ -4319,17 +4324,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_killRecord.Clear();
}
+ if (kills.Count > 0)
+ {
+ foreach(SceneObjectGroup grp in kills)
+ {
+ foreach(SceneObjectPart p in grp.Parts)
+ SendEntityUpdate(p,PrimUpdateFlags.Kill);
+ }
+ kills.Clear();
+ }
+
if(GroupsNeedFullUpdate.Count > 0)
{
foreach(SceneObjectGroup grp in GroupsNeedFullUpdate)
{
- grp.ScheduleGroupForFullUpdate();
+ foreach(SceneObjectPart p in grp.Parts)
+ SendEntityUpdate(p,PrimUpdateFlags.CancelKill);
lock(GroupsInView)
GroupsInView.Add(grp);
}
}
#endregion
-
}
// hack.. dont use
@@ -4368,7 +4383,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
private bool CheckGroupsInViewBusy = false;
- private bool CheckGroupsInViewOverRun = false;
public void CheckGroupsInView()
{
@@ -4377,112 +4391,90 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return;
if(CheckGroupsInViewBusy)
- {
- CheckGroupsInViewOverRun = true;
return;
- }
+
CheckGroupsInViewBusy = true;
- do
- {
- CheckGroupsInViewOverRun = false;
- float cullingrange = 64.0f;
+ float cullingrange = 64.0f;
// Vector3 mycamera = Vector3.Zero;
- Vector3 mypos = Vector3.Zero;
- ScenePresence mysp = (ScenePresence)SceneAgent;
- if(mysp != null && !mysp.IsDeleted)
- {
- cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
+ Vector3 mypos = Vector3.Zero;
+ ScenePresence mysp = (ScenePresence)SceneAgent;
+ if(mysp != null && !mysp.IsDeleted)
+ {
+ cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
// mycamera = mysp.CameraPosition;
- mypos = mysp.AbsolutePosition;
- }
- else
- {
- CheckGroupsInViewBusy= false;
- return;
- }
+ mypos = mysp.AbsolutePosition;
+ }
+ else
+ {
+ CheckGroupsInViewBusy= false;
+ return;
+ }
- HashSet NewGroupsInView = new HashSet();
- HashSet GroupsNeedFullUpdate = new HashSet();
- List kills = new List();
- int killedParst = 0;
+ HashSet NewGroupsInView = new HashSet();
+ HashSet GroupsNeedFullUpdate = new HashSet();
+ List kills = new List();
- EntityBase[] entities = m_scene.Entities.GetEntities();
- foreach (EntityBase e in entities)
- {
- if(!IsActive)
- return;
+ EntityBase[] entities = m_scene.Entities.GetEntities();
+ foreach (EntityBase e in entities)
+ {
+ if(!IsActive)
+ return;
- if (e != null && e is SceneObjectGroup)
- {
- SceneObjectGroup grp = (SceneObjectGroup)e;
- if(grp.IsDeleted || grp.IsAttachment)
- continue;
+ if (e != null && e is SceneObjectGroup)
+ {
+ SceneObjectGroup grp = (SceneObjectGroup)e;
+ if(grp.IsDeleted || grp.IsAttachment)
+ continue;
- float bradius = grp.GetBoundsRadius();
- Vector3 grppos = grp.AbsolutePosition + grp.getBoundsCenter();
+ float bradius = grp.GetBoundsRadius();
+ Vector3 grppos = grp.AbsolutePosition + grp.getBoundsCenter();
// float dcam = (grppos - mycamera).LengthSquared();
- float dpos = (grppos - mypos).LengthSquared();
+ float dpos = (grppos - mypos).LengthSquared();
// if(dcam < dpos)
// dpos = dcam;
- dpos = (float)Math.Sqrt(dpos) - bradius;
+ dpos = (float)Math.Sqrt(dpos) - bradius;
- bool inview;
- lock(GroupsInView)
- inview = GroupsInView.Contains(grp);
-
- if(dpos > cullingrange)
- {
- if(inview)
- {
- kills.Add(grp.LocalId);
- killedParst += grp.PrimCount;
+ bool inview;
+ lock(GroupsInView)
+ inview = GroupsInView.Contains(grp);
- if (killedParst > 199 )
- {
- SendKillObject(kills);
- kills.Clear();
- killedParst = 0;
- Thread.Sleep(50);
- if(mysp != null && !mysp.IsDeleted)
- {
- cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
-// mycamera = mysp.CameraPosition;
- mypos = mysp.AbsolutePosition;
- }
- else
- {
- CheckGroupsInViewBusy= false;
- return;
- }
- }
- }
- }
- else
- {
- if(!inview)
- GroupsNeedFullUpdate.Add(grp);
- NewGroupsInView.Add(grp);
- }
+ if(dpos > cullingrange)
+ {
+ if(inview)
+ kills.Add(grp);
+ }
+ else
+ {
+ if(!inview)
+ GroupsNeedFullUpdate.Add(grp);
+ NewGroupsInView.Add(grp);
}
}
+ }
- lock(GroupsInView)
- GroupsInView = NewGroupsInView;
+ lock(GroupsInView)
+ GroupsInView = NewGroupsInView;
- if (kills.Count > 0)
+ if (kills.Count > 0)
+ {
+ foreach(SceneObjectGroup grp in kills)
{
- SendKillObject(kills);
- kills.Clear();
+ foreach(SceneObjectPart p in grp.Parts)
+ SendEntityUpdate(p,PrimUpdateFlags.Kill);
}
+ kills.Clear();
+ }
- if(GroupsNeedFullUpdate.Count > 0)
+ if(GroupsNeedFullUpdate.Count > 0)
+ {
+ foreach(SceneObjectGroup grp in GroupsNeedFullUpdate)
{
- foreach(SceneObjectGroup grp in GroupsNeedFullUpdate)
- grp.ScheduleGroupForFullUpdate();
+ foreach(SceneObjectPart p in grp.Parts)
+ SendEntityUpdate(p,PrimUpdateFlags.CancelKill);
}
- } while(CheckGroupsInViewOverRun);
+ }
CheckGroupsInViewBusy = false;
}
@@ -4670,13 +4662,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(pack, ThrottleOutPacketType.Task);
}
- private class ObjectPropertyUpdate : IEntityUpdate
+ private class ObjectPropertyUpdate : EntityUpdate
{
internal bool SendFamilyProps;
internal bool SendObjectProps;
public ObjectPropertyUpdate(ISceneEntity entity, uint flags, bool sendfam, bool sendobj)
- : base(entity,flags)
+ : base(entity,(PrimUpdateFlags)flags)
{
SendFamilyProps = sendfam;
SendObjectProps = sendobj;
@@ -4745,7 +4737,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OpenSim.Framework.Lazy> propertyUpdates =
new OpenSim.Framework.Lazy>();
- IEntityUpdate iupdate;
+ EntityUpdate iupdate;
Int32 timeinqueue; // this is just debugging code & can be dropped later
int updatesThisCall = 0;
@@ -4849,11 +4841,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// m_log.WarnFormat("[PACKETCOUNTS] queued {0} family property packets with {1} blocks",fpcnt,fbcnt);
}
- private ObjectPropertiesFamilyPacket.ObjectDataBlock CreateObjectPropertiesFamilyBlock(SceneObjectPart sop, uint requestFlags)
+ private ObjectPropertiesFamilyPacket.ObjectDataBlock CreateObjectPropertiesFamilyBlock(SceneObjectPart sop, PrimUpdateFlags requestFlags)
{
ObjectPropertiesFamilyPacket.ObjectDataBlock block = new ObjectPropertiesFamilyPacket.ObjectDataBlock();
- block.RequestFlags = requestFlags;
+ block.RequestFlags = (uint)requestFlags;
block.ObjectID = sop.UUID;
if (sop.OwnerID == sop.GroupID)
block.OwnerID = UUID.Zero;
--
cgit v1.1
From 081c66631c53688343d4d701adb94411aaa3340c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 7 Aug 2016 17:07:09 +0100
Subject: move updates from updates queues into udp queues acording to their
payload estimated size and udp sending capability on a time slice, instead
always moving a arbitrary number of updates.
---
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 81 ++++++++++++----------
.../Region/ClientStack/Linden/UDP/LLUDPClient.cs | 5 +-
2 files changed, 46 insertions(+), 40 deletions(-)
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index b823abe..6beb9b4 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3982,7 +3982,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ResendPrimUpdate(update);
}
- private void ProcessEntityUpdates(int maxUpdates)
+ private void ProcessEntityUpdates(int maxUpdatesBytes)
{
OpenSim.Framework.Lazy> objectUpdateBlocks = new OpenSim.Framework.Lazy>();
OpenSim.Framework.Lazy> compressedUpdateBlocks = new OpenSim.Framework.Lazy>();
@@ -3996,16 +3996,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Check to see if this is a flush
- if (maxUpdates <= 0)
+ if (maxUpdatesBytes <= 0)
{
- maxUpdates = Int32.MaxValue;
+ maxUpdatesBytes = Int32.MaxValue;
}
- int updatesThisCall = 0;
-
- // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race
- // condition where a kill can be processed before an out-of-date update for the same object.
-// float avgTimeDilation = 0.0f;
EntityUpdate update;
Int32 timeinqueue; // this is just debugging code & can be dropped later
@@ -4018,25 +4013,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ScenePresence mysp = (ScenePresence)SceneAgent;
if(mysp != null && !mysp.IsDeleted)
{
- cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance +16f;
+ cullingrange = mysp.DrawDistance + m_scene.ReprioritizationDistance + 16f;
// mycamera = mysp.CameraPosition;
mypos = mysp.AbsolutePosition;
}
else
doCulling = false;
- while (updatesThisCall < maxUpdates)
+ while (maxUpdatesBytes > 0)
{
lock (m_entityUpdates.SyncRoot)
if (!m_entityUpdates.TryDequeue(out update, out timeinqueue))
break;
-// avgTimeDilation += update.TimeDilation;
PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags;
if(updateFlags.HasFlag(PrimUpdateFlags.Kill))
{
m_killRecord.Add(update.Entity.LocalId);
+ maxUpdatesBytes -= 30;
continue;
}
@@ -4158,8 +4153,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
continue;
}
- ++updatesThisCall;
-
#region UpdateFlags to packet type conversion
bool canUseCompressed = true;
@@ -4212,30 +4205,49 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// TODO: Remove this once we can build compressed updates
canUseCompressed = false;
-
+
if (!canUseImproved && !canUseCompressed)
{
if (update.Entity is ScenePresence)
{
- objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity));
+ ObjectUpdatePacket.ObjectDataBlock ablock =
+ CreateAvatarUpdateBlock((ScenePresence)update.Entity);
+ objectUpdateBlocks.Value.Add(ablock);
+ maxUpdatesBytes -= ablock.Length;
}
else
{
- objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId));
+ ObjectUpdatePacket.ObjectDataBlock ablock =
+ CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId);
+ objectUpdateBlocks.Value.Add(ablock);
+ maxUpdatesBytes -= ablock.Length;
}
}
else if (!canUseImproved)
{
- compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags));
+ ObjectUpdateCompressedPacket.ObjectDataBlock ablock =
+ CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags);
+ compressedUpdateBlocks.Value.Add(ablock);
+ maxUpdatesBytes -= ablock.Length;
}
else
{
if (update.Entity is ScenePresence)
+ {
// ALL presence updates go into a special list
- terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
+ ImprovedTerseObjectUpdatePacket.ObjectDataBlock ablock =
+ CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures));
+ terseAgentUpdateBlocks.Value.Add(ablock);
+ maxUpdatesBytes -= ablock.Length;
+ }
else
+ {
// Everything else goes here
- terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
+ ImprovedTerseObjectUpdatePacket.ObjectDataBlock ablock =
+ CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures));
+ terseUpdateBlocks.Value.Add(ablock);
+ maxUpdatesBytes -= ablock.Length;
+ }
}
#endregion Block Construction
@@ -4504,8 +4516,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// of updates converted to packets. Since we don't want packets
// to sit in the queue with old data, only convert enough updates
// to packets that can be sent in 200ms.
- private Int32 m_LastQueueFill = 0;
- private Int32 m_maxUpdates = 0;
+// private Int32 m_LastQueueFill = 0;
+// private Int32 m_maxUpdates = 0;
void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories)
{
@@ -4516,7 +4528,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
// if (!m_udpServer.IsRunningOutbound)
// return;
-
+/*
if (m_maxUpdates == 0 || m_LastQueueFill == 0)
{
m_maxUpdates = m_udpServer.PrimUpdatesPerCallback;
@@ -4530,17 +4542,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
m_maxUpdates = Util.Clamp(m_maxUpdates,10,500);
m_LastQueueFill = Util.EnvironmentTickCount();
-
+*/
+ int maxUpdateBytes = m_udpClient.GetCatBytesCanSend(ThrottleOutPacketType.Task, 30);
+
if (m_entityUpdates.Count > 0)
- ProcessEntityUpdates(m_maxUpdates);
+ ProcessEntityUpdates(maxUpdateBytes);
if (m_entityProps.Count > 0)
- ProcessEntityPropertyRequests(m_maxUpdates);
+ ProcessEntityPropertyRequests(maxUpdateBytes);
}
if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0)
ImageManager.ProcessImageQueue(m_udpServer.TextureSendLimit);
- }
+ }
internal bool HandleHasUpdates(ThrottleOutPacketTypeFlags categories)
{
@@ -4723,7 +4737,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_entityProps.Enqueue(priority, new ObjectPropertyUpdate(entity,0,false,true));
}
- private void ProcessEntityPropertyRequests(int maxUpdates)
+ private void ProcessEntityPropertyRequests(int maxUpdateBytes)
{
OpenSim.Framework.Lazy> objectFamilyBlocks =
new OpenSim.Framework.Lazy>();
@@ -4740,8 +4754,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
EntityUpdate iupdate;
Int32 timeinqueue; // this is just debugging code & can be dropped later
- int updatesThisCall = 0;
- while (updatesThisCall < m_maxUpdates)
+ while (maxUpdateBytes > 0)
{
lock (m_entityProps.SyncRoot)
if (!m_entityProps.TryDequeue(out iupdate, out timeinqueue))
@@ -4756,6 +4769,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesFamilyBlock(sop,update.Flags);
objectFamilyBlocks.Value.Add(objPropDB);
familyUpdates.Value.Add(update);
+ maxUpdateBytes -= objPropDB.Length;
}
}
@@ -4767,16 +4781,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ObjectPropertiesPacket.ObjectDataBlock objPropDB = CreateObjectPropertiesBlock(sop);
objectPropertiesBlocks.Value.Add(objPropDB);
propertyUpdates.Value.Add(update);
+ maxUpdateBytes -= objPropDB.Length;
}
}
-
- updatesThisCall++;
}
-
-
- // Int32 ppcnt = 0;
- // Int32 pbcnt = 0;
-
+
if (objectPropertiesBlocks.IsValueCreated)
{
List blocks = objectPropertiesBlocks.Value;
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index 36e0a0e..4e68a9b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -771,8 +771,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
RTO = Math.Min(RTO * 2, m_maxRTO);
}
-
- const int MIN_CALLBACK_MS = 10;
+ const int MIN_CALLBACK_MS = 20;
///
/// Does an early check to see if this queue empty callback is already
@@ -807,9 +806,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
else
- {
m_isQueueEmptyRunning = false;
- }
}
}
--
cgit v1.1
From a0538eb53d8d1d08f4bffb2e9502537dbad3f812 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 7 Aug 2016 20:53:38 +0100
Subject: fix entity update flags update
---
OpenSim/Framework/IClientAPI.cs | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 0140733..848d574 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -606,21 +606,20 @@ namespace OpenSim.Framework
get { return m_updateTime; }
}
- public virtual void Update(EntityUpdate update)
+ public virtual void Update(EntityUpdate oldupdate)
{
- PrimUpdateFlags updateFlags = update.Flags;
- if(updateFlags.HasFlag(PrimUpdateFlags.CancelKill))
+ // we are on the new one
+ PrimUpdateFlags updateFlags = oldupdate.Flags;
+ if(m_flags.HasFlag(PrimUpdateFlags.CancelKill))
m_flags = PrimUpdateFlags.FullUpdate;
- else if(m_flags.HasFlag(PrimUpdateFlags.Kill))
- return;
else if(updateFlags.HasFlag(PrimUpdateFlags.Kill))
- m_flags = PrimUpdateFlags.Kill;
- else
+ return;
+ else // kill case will just merge in
m_flags |= updateFlags;
// Use the older of the updates as the updateTime
- if (Util.EnvironmentTickCountCompare(UpdateTime, update.UpdateTime) > 0)
- m_updateTime = update.UpdateTime;
+ if (Util.EnvironmentTickCountCompare(UpdateTime, oldupdate.UpdateTime) > 0)
+ m_updateTime = oldupdate.UpdateTime;
}
public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags)
--
cgit v1.1
From 4f9378bf97b69567f8bfb06cb8764405443464ec Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 3 Sep 2016 08:50:22 +0100
Subject: remove reuse context code, they had notthing worth using and on
original code when reusing contexts still in use, etc. Change DLL information
to make clear it is a opensim fork, so our responsability not original author
---
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 4 ++--
OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs | 2 +-
OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs | 4 ++--
OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index e431042..c078a73 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -461,7 +461,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
- resp.ReuseContext = true;
+// resp.ReuseContext = true;
// resp.ReuseContext = false;
HandleRequest(req, resp);
@@ -1804,7 +1804,7 @@ namespace OpenSim.Framework.Servers.HttpServer
*/
// disable this things
response.KeepAlive = false;
- response.ReuseContext = false;
+ // response.ReuseContext = false;
// Cross-Origin Resource Sharing with simple requests
if (responsedata.ContainsKey("access_control_allow_origin"))
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs
index f61b090..d26b68a 100644
--- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs
+++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IOSHttpResponse.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Framework.Servers.HttpServer
///
string StatusDescription { get; set; }
- bool ReuseContext { get; set; }
+// bool ReuseContext { get; set; }
///
/// Add a header field and content to the response.
diff --git a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs
index ccf9c91..8456654 100644
--- a/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs
+++ b/OpenSim/Framework/Servers/HttpServer/OSHttpResponse.cs
@@ -256,7 +256,7 @@ namespace OpenSim.Framework.Servers.HttpServer
_httpResponse.Reason = value;
}
}
-
+/*
public bool ReuseContext
{
get
@@ -275,7 +275,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
}
-
+*/
protected IHttpResponse _httpResponse;
private IHttpClientContext _httpClientContext;
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
index 9083e12..6537f64 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Framework.Servers.HttpServer
response.SendChunked = false;
response.ContentLength64 = buffer.Length;
response.ContentEncoding = Encoding.UTF8;
- response.ReuseContext = false;
+// response.ReuseContext = false;
try
{
@@ -114,7 +114,7 @@ namespace OpenSim.Framework.Servers.HttpServer
response.SendChunked = false;
response.ContentLength64 = 0;
response.ContentEncoding = Encoding.UTF8;
- response.ReuseContext = false;
+// response.ReuseContext = false;
response.KeepAlive = false;
response.SendChunked = false;
response.StatusCode = 503;
--
cgit v1.1
From 606e9f99f39101eaa6291af42c3ba659bab83aa1 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 3 Sep 2016 08:52:15 +0100
Subject: forgot the dll
---
bin/HttpServer_OpenSim.dll | Bin 130560 -> 118272 bytes
bin/HttpServer_OpenSim.pdb | Bin 355840 -> 325120 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index bc28ce4..605fa6a 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index ba6b0b0..563b5e0 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From b51739e23ecc071a107755c7613ff274f65c3a64 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 6 Oct 2016 21:35:11 +0100
Subject: recover regions main http server ssl suport. Using a PKCS12 cert
file, and not certs store for now. Option http_listener_cn, cert CN need to
the same as external IP. Self sign certs do seem to work, but the viewers
option NoVerifySLLCert needs to be set true. CA check is not done but they do
check the IP
---
OpenSim/Framework/NetworkServersInfo.cs | 4 ++++
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 10 ++++++++-
OpenSim/Region/Application/OpenSimBase.cs | 26 ++++++++++++++++++++--
.../Region/Application/RegionApplicationBase.cs | 14 +++++++-----
.../Caps/EventQueue/Tests/EventQueueTests.cs | 2 +-
.../ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs | 2 +-
bin/OpenSimDefaults.ini | 11 +++++----
7 files changed, 53 insertions(+), 16 deletions(-)
diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs
index dfe9695..d79eb0d 100644
--- a/OpenSim/Framework/NetworkServersInfo.cs
+++ b/OpenSim/Framework/NetworkServersInfo.cs
@@ -37,6 +37,8 @@ namespace OpenSim.Framework
public bool isSandbox;
public bool HttpUsesSSL = false;
public string HttpSSLCN = "";
+ public string HttpSSLCertPath = "";
+ public string HttpSSLCNCertPass = "";
public uint httpSSLPort = 9001;
// "Out of band" managemnt https
@@ -62,6 +64,8 @@ namespace OpenSim.Framework
(uint)config.Configs["Network"].GetInt("http_listener_sslport", ((int)ConfigSettings.DefaultRegionHttpPort+1));
HttpUsesSSL = config.Configs["Network"].GetBoolean("http_listener_ssl", false);
HttpSSLCN = config.Configs["Network"].GetString("http_listener_cn", "localhost");
+ HttpSSLCertPath = config.Configs["Network"].GetString("http_listener_cert_path", HttpSSLCertPath);
+ HttpSSLCNCertPass = config.Configs["Network"].GetString("http_listener_cert_pass", HttpSSLCNCertPass);
// "Out of band management https"
ssl_listener = config.Configs["Network"].GetBoolean("https_listener",false);
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index c078a73..29a8d3f 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -153,11 +153,19 @@ namespace OpenSim.Framework.Servers.HttpServer
m_ssl = ssl;
}
- public BaseHttpServer(uint port, bool ssl, uint sslport, string CN) : this (port, ssl)
+ public BaseHttpServer(uint port, bool ssl, uint sslport, string CN, string CPath, string CPass) : this (port, ssl)
{
if (m_ssl)
{
+ if(string.IsNullOrEmpty(CPass))
+ throw new Exception("invalid main http server cert path");
+
m_sslport = sslport;
+ m_cert = new X509Certificate2(CPath, CPass);
+ m_SSLCommonName = m_cert.GetNameInfo(X509NameType.SimpleName,false);
+ if(CN != m_SSLCommonName)
+ throw new Exception("main http server CN does not match cert CN");
+
}
}
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 52ded3d..62abf8e 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -351,7 +351,18 @@ namespace OpenSim
if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true))
WorkManager.JobEngine.Start();
- m_httpServerPort = m_networkServersInfo.HttpListenerPort;
+
+ if(m_networkServersInfo.HttpUsesSSL)
+ {
+ m_httpServerSSL = true;
+ m_httpServerPort = m_networkServersInfo.httpSSLPort;
+ }
+ else
+ {
+ m_httpServerSSL = false;
+ m_httpServerPort = m_networkServersInfo.HttpListenerPort;
+ }
+
SceneManager.OnRestartSim += HandleRestartRegion;
// Only enable the watchdogs when all regions are ready. Otherwise we get false positives when cpu is
@@ -404,7 +415,18 @@ namespace OpenSim
// set initial ServerURI
regionInfo.HttpPort = m_httpServerPort;
- regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/";
+ if(m_httpServerSSL)
+ {
+ if(m_networkServersInfo.HttpSSLCN != regionInfo.ExternalHostName)
+ throw new Exception("main http cert CN doesn't match region External IP");
+
+ regionInfo.ServerURI = "https://" + regionInfo.ExternalHostName +
+ ":" + regionInfo.HttpPort.ToString() + "/";
+ }
+ else
+ regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName +
+ ":" + regionInfo.HttpPort.ToString() + "/";
+
regionInfo.osSecret = m_osSecret;
diff --git a/OpenSim/Region/Application/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs
index ba92fd6..603f139 100644
--- a/OpenSim/Region/Application/RegionApplicationBase.cs
+++ b/OpenSim/Region/Application/RegionApplicationBase.cs
@@ -50,6 +50,7 @@ namespace OpenSim
protected Dictionary m_clientCircuits = new Dictionary();
protected NetworkServersInfo m_networkServersInfo;
protected uint m_httpServerPort;
+ protected bool m_httpServerSSL;
protected ISimulationDataService m_simulationDataService;
protected IEstateDataService m_estateDataService;
@@ -70,15 +71,18 @@ namespace OpenSim
m_httpServer
= new BaseHttpServer(
- m_httpServerPort, m_networkServersInfo.HttpUsesSSL, m_networkServersInfo.httpSSLPort,
- m_networkServersInfo.HttpSSLCN);
-
+ m_httpServerPort, m_networkServersInfo.HttpUsesSSL,
+ m_networkServersInfo.httpSSLPort, m_networkServersInfo.HttpSSLCN,
+ m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass);
+
+/* why this? we only run one
if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
{
m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
-
- m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort);
+*/
+ m_log.InfoFormat("[REGION SERVER]: Starting HTTP{0} server on port {1}",
+ m_networkServersInfo.HttpUsesSSL ? "S" : "", m_httpServerPort);
m_httpServer.Start();
MainServer.AddHttpServer(m_httpServer);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
index 5eb4452..507d9b8 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
// variables and the VM is not restarted between tests.
MainServer.RemoveHttpServer(port);
- BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "");
+ BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "","","");
MainServer.AddHttpServer(server);
MainServer.Instance = server;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
index 30dc4cd..1453204 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
uint port = 9999;
MainServer.RemoveHttpServer(port);
- BaseHttpServer server = new BaseHttpServer(port, false, 0, "");
+ BaseHttpServer server = new BaseHttpServer(port, false, 0, "", "", "");
MainServer.AddHttpServer(server);
MainServer.Instance = server;
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 47257b2..418330e 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -500,13 +500,12 @@
http_listener_port = 9000
console_port = 0
- ; ssl config: Experimental! The auto https config only really works definately on windows XP now
- ; you need a Cert Request/Signed pair installed in the MY store with the CN specified below
- ; you can use https on other platforms, but you'll need to configure the httpapi yourself for now
- http_listener_ssl = false ; Also create a SSL server
- http_listener_cn = "localhost" ; Use the cert with the common name
+ ; ssl config: Experimental!
+ http_listener_ssl = false ; if set to true main server is replaced a ssl one
http_listener_sslport = 9001 ; Use this port for SSL connections
- http_listener_ssl_cert = "" ; Currently unused, but will be used for OSHttpServer
+ http_listener_cn = "myexternalip" ; // should be the External ip and match the CN on the cert
+ http_listener_cert_path = "mycert.p12" ; path for the cert file
+ http_listener_cert_pass = "mycertpass" ; the cert passwork
; HTTPS for "Out of band" management applications such as the remote
; admin module
--
cgit v1.1
From 5b946405a09a4ec89e0d7664fabbf5015c7c62e8 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 9 Oct 2016 01:01:52 +0100
Subject: changes to regions ssl suport: verify if hostnames are validate by
the selected cert, make clear that for now all regions need to have the same
ExternalHostName if using sll (due to other code that needs to be changed
later)
---
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 146 +++++++++++++++++++--
OpenSim/Region/Application/OpenSimBase.cs | 2 +-
bin/OpenSimDefaults.ini | 8 +-
3 files changed, 141 insertions(+), 15 deletions(-)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 29a8d3f..af292c6 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -43,10 +43,11 @@ using log4net;
using Nwc.XmlRpc;
using OpenMetaverse.StructuredData;
using CoolHTTPListener = HttpServer.HttpListener;
-using HttpListener=System.Net.HttpListener;
-using LogPrio=HttpServer.LogPrio;
+using HttpListener = System.Net.HttpListener;
+using LogPrio = HttpServer.LogPrio;
using OpenSim.Framework.Monitoring;
using System.IO.Compression;
+using System.Security.Cryptography;
namespace OpenSim.Framework.Servers.HttpServer
{
@@ -112,6 +113,9 @@ namespace OpenSim.Framework.Servers.HttpServer
private X509Certificate2 m_cert;
protected bool m_firstcaps = true;
protected string m_SSLCommonName = "";
+ protected List m_certNames = new List();
+ protected List m_certIPs = new List();
+ protected string m_certCN= "";
protected IPAddress m_listenIPAddress = IPAddress.Any;
@@ -153,30 +157,150 @@ namespace OpenSim.Framework.Servers.HttpServer
m_ssl = ssl;
}
- public BaseHttpServer(uint port, bool ssl, uint sslport, string CN, string CPath, string CPass) : this (port, ssl)
+ private void load_cert(string CPath, string CPass)
{
- if (m_ssl)
+ try
{
- if(string.IsNullOrEmpty(CPass))
+ m_cert = new X509Certificate2(CPath, CPass);
+ X509Extension ext = m_cert.Extensions["2.5.29.17"];
+ if(ext != null)
+ {
+ AsnEncodedData asndata = new AsnEncodedData(ext.Oid, ext.RawData);
+ string datastr = asndata.Format(true);
+ string[] lines = datastr.Split(new char[] {'\n','\r'});
+ foreach(string s in lines)
+ {
+ if(String.IsNullOrEmpty(s))
+ continue;
+ string[] parts = s.Split(new char[] {'='});
+ if(String.IsNullOrEmpty(parts[0]))
+ continue;
+ string entryName = parts[0].Replace(" ","");
+ if(entryName == "DNSName")
+ m_certNames.Add(parts[1]);
+ else if(entryName == "IPAddress")
+ m_certIPs.Add(parts[1]);
+ }
+ }
+ m_certCN = m_cert.GetNameInfo(X509NameType.SimpleName, false);
+ }
+ catch
+ {
+ throw new Exception("SSL cert load error");
+ }
+ }
+
+ public BaseHttpServer(uint port, bool ssl, uint sslport, string CN, string CPath, string CPass)
+ {
+ m_port = port;
+ if (ssl)
+ {
+ if(string.IsNullOrEmpty(CPath))
throw new Exception("invalid main http server cert path");
+ if(Uri.CheckHostName(CN) == UriHostNameType.Unknown)
+ throw new Exception("invalid main http server CN (ExternalHostName)");
+
+ m_certNames.Clear();
+ m_certIPs.Clear();
+ m_certCN= "";
+
+ m_ssl = true;
m_sslport = sslport;
- m_cert = new X509Certificate2(CPath, CPass);
- m_SSLCommonName = m_cert.GetNameInfo(X509NameType.SimpleName,false);
- if(CN != m_SSLCommonName)
- throw new Exception("main http server CN does not match cert CN");
+ load_cert(CPath, CPass);
+
+ if(!CheckSSLCertHost(CN))
+ throw new Exception("invalid main http server CN (ExternalHostName)");
+
+ m_SSLCommonName = CN;
+
+ if(m_cert.Issuer == m_cert.Subject )
+ m_log.Warn("Self signed certificate. Clients need to allow this (some viewers debug option NoVerifySSLcert must be set to true");
+
}
+ else
+ m_ssl = false;
}
public BaseHttpServer(uint port, bool ssl, string CPath, string CPass) : this (port, ssl)
{
if (m_ssl)
{
- m_cert = new X509Certificate2(CPath, CPass);
+ load_cert(CPath, CPass);
+ if(m_cert.Issuer == m_cert.Subject )
+ m_log.Warn("Self signed certificate. Http clients need to allow this");
+ }
+ }
+
+ static bool MatchDNS (string hostname, string dns)
+ {
+ int indx = dns.IndexOf ('*');
+ if (indx == -1)
+ return (String.Compare(hostname, dns, true, CultureInfo.InvariantCulture) == 0);
+
+ int dnslen = dns.Length;
+ dnslen--;
+ if(indx == dnslen)
+ return true; // just * ?
+
+ if(indx > dnslen - 2)
+ return false; // 2 short ?
+
+ if (dns[indx + 1] != '.')
+ return false;
+
+ int indx2 = dns.IndexOf ('*', indx + 1);
+ if (indx2 != -1)
+ return false; // there can only be one;
+
+ string end = dns.Substring(indx + 1);
+ int hostlen = hostname.Length;
+ int endlen = end.Length;
+ int length = hostlen - endlen;
+ if (length <= 0)
+ return false;
+
+ if (String.Compare(hostname, length, end, 0, endlen, true, CultureInfo.InvariantCulture) != 0)
+ return false;
+
+ if (indx == 0)
+ {
+ indx2 = hostname.IndexOf ('.');
+ return ((indx2 == -1) || (indx2 >= length));
+ }
+
+ string start = dns.Substring (0, indx);
+ return (String.Compare (hostname, 0, start, 0, start.Length, true, CultureInfo.InvariantCulture) == 0);
+ }
+
+ public bool CheckSSLCertHost(string hostname)
+ {
+ UriHostNameType htype = Uri.CheckHostName(hostname);
+
+ if(htype == UriHostNameType.Unknown || htype == UriHostNameType.Basic)
+ return false;
+ if(htype == UriHostNameType.Dns)
+ {
+ foreach(string name in m_certNames)
+ {
+ if(MatchDNS(hostname, name))
+ return true;
+ }
+ if(MatchDNS(hostname, m_certCN))
+ return true;
+ }
+ else
+ {
+ foreach(string ip in m_certIPs)
+ {
+ if (String.Compare(hostname, ip, true, CultureInfo.InvariantCulture) != 0)
+ return true;
+ }
}
- }
+ return false;
+ }
///
/// Add a stream handler to the http server. If the handler already exists, then nothing happens.
///
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 62abf8e..90505e1 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -417,7 +417,7 @@ namespace OpenSim
regionInfo.HttpPort = m_httpServerPort;
if(m_httpServerSSL)
{
- if(m_networkServersInfo.HttpSSLCN != regionInfo.ExternalHostName)
+ if(!m_httpServer.CheckSSLCertHost(regionInfo.ExternalHostName))
throw new Exception("main http cert CN doesn't match region External IP");
regionInfo.ServerURI = "https://" + regionInfo.ExternalHostName +
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index d1ded36..07e1c48 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -501,10 +501,12 @@
console_port = 0
; ssl config: Experimental!
- http_listener_ssl = false ; if set to true main server is replaced a ssl one
+ http_listener_ssl = false ; if set to true main server is replaced by a ssl one
http_listener_sslport = 9001 ; Use this port for SSL connections
- http_listener_cn = "myexternalip" ; // should be the External ip and match the CN on the cert
- http_listener_cert_path = "mycert.p12" ; path for the cert file
+ ; currently if using ssl, regions ExternalHostName must the the same and equal to http_listener_cn
+ ; this will change is future
+ http_listener_cn = "myRegionsExternalHostName"
+ http_listener_cert_path = "mycert.p12" ; path for the cert file that is valid for the ExternalHostName
http_listener_cert_pass = "mycertpass" ; the cert passwork
; HTTPS for "Out of band" management applications such as the remote
--
cgit v1.1
From 7aa4bd7006fcf6f8c9810180bd0e59cddb958ba0 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 9 Oct 2016 01:15:53 +0100
Subject: add a comment about selfsigned certs
---
bin/OpenSimDefaults.ini | 1 +
1 file changed, 1 insertion(+)
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 07e1c48..01a44c3 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -506,6 +506,7 @@
; currently if using ssl, regions ExternalHostName must the the same and equal to http_listener_cn
; this will change is future
http_listener_cn = "myRegionsExternalHostName"
+ ; if the cert doesnt have a oficial CA or is selfsigned viewers option NoVerifySSLCert need to be set true
http_listener_cert_path = "mycert.p12" ; path for the cert file that is valid for the ExternalHostName
http_listener_cert_pass = "mycertpass" ; the cert passwork
--
cgit v1.1
From 80d4f76d182f919740d80b665a8cc445d014b540 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 9 Oct 2016 20:18:20 +0100
Subject: keep a unsecure http port up for external services (datasnapshot
search). Only fire poolservices on main http listener
---
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 29 ++++++------
OpenSim/Framework/Servers/MainServer.cs | 16 +++++++
.../Region/Application/RegionApplicationBase.cs | 53 ++++++++++++++--------
.../DataSnapshot/DataRequestHandler.cs | 4 +-
4 files changed, 66 insertions(+), 36 deletions(-)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index af292c6..bd8b681 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -111,7 +111,6 @@ namespace OpenSim.Framework.Servers.HttpServer
protected uint m_sslport;
protected bool m_ssl;
private X509Certificate2 m_cert;
- protected bool m_firstcaps = true;
protected string m_SSLCommonName = "";
protected List m_certNames = new List();
protected List m_certIPs = new List();
@@ -152,11 +151,6 @@ namespace OpenSim.Framework.Servers.HttpServer
m_port = port;
}
- public BaseHttpServer(uint port, bool ssl) : this (port)
- {
- m_ssl = ssl;
- }
-
private void load_cert(string CPath, string CPass)
{
try
@@ -216,21 +210,24 @@ namespace OpenSim.Framework.Servers.HttpServer
if(m_cert.Issuer == m_cert.Subject )
m_log.Warn("Self signed certificate. Clients need to allow this (some viewers debug option NoVerifySSLcert must be set to true");
-
-
}
else
m_ssl = false;
}
- public BaseHttpServer(uint port, bool ssl, string CPath, string CPass) : this (port, ssl)
+ public BaseHttpServer(uint port, bool ssl, string CPath, string CPass)
{
- if (m_ssl)
+ m_port = port;
+ if (ssl)
{
load_cert(CPath, CPass);
if(m_cert.Issuer == m_cert.Subject )
m_log.Warn("Self signed certificate. Http clients need to allow this");
+ m_ssl = true;
+ m_sslport = port;
}
+ else
+ m_ssl = false;
}
static bool MatchDNS (string hostname, string dns)
@@ -2038,7 +2035,7 @@ namespace OpenSim.Framework.Servers.HttpServer
public void Start()
{
- Start(true);
+ Start(true,true);
}
///
@@ -2048,7 +2045,7 @@ namespace OpenSim.Framework.Servers.HttpServer
/// If true then poll responses are performed asynchronsly.
/// Option exists to allow regression tests to perform processing synchronously.
///
- public void Start(bool performPollResponsesAsync)
+ public void Start(bool performPollResponsesAsync, bool runPool)
{
m_log.InfoFormat(
"[BASE HTTP SERVER]: Starting {0} server on port {1}", UseSSL ? "HTTPS" : "HTTP", Port);
@@ -2086,9 +2083,11 @@ namespace OpenSim.Framework.Servers.HttpServer
m_httpListener2.Start(64);
// Long Poll Service Manager with 3 worker threads a 25 second timeout for no events
-
- PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 2, 25000);
- PollServiceRequestManager.Start();
+ if(runPool)
+ {
+ PollServiceRequestManager = new PollServiceRequestManager(this, performPollResponsesAsync, 2, 25000);
+ PollServiceRequestManager.Start();
+ }
HTTPDRunning = true;
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs
index 57931d4..e9c284c 100644
--- a/OpenSim/Framework/Servers/MainServer.cs
+++ b/OpenSim/Framework/Servers/MainServer.cs
@@ -42,6 +42,7 @@ namespace OpenSim.Framework.Servers
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static BaseHttpServer instance = null;
+ private static BaseHttpServer unsecureinstance = null;
private static Dictionary m_Servers = new Dictionary();
///
@@ -93,6 +94,21 @@ namespace OpenSim.Framework.Servers
}
}
+
+ public static BaseHttpServer ÚnSecureInstance
+ {
+ get { return unsecureinstance; }
+
+ set
+ {
+ lock (m_Servers)
+ if (!m_Servers.ContainsValue(value))
+ throw new Exception("HTTP server must already have been registered to be set as the main instance");
+
+ unsecureinstance = value;
+ }
+ }
+
///
/// Get all the registered servers.
///
diff --git a/OpenSim/Region/Application/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs
index 603f139..77b0138 100644
--- a/OpenSim/Region/Application/RegionApplicationBase.cs
+++ b/OpenSim/Region/Application/RegionApplicationBase.cs
@@ -69,23 +69,38 @@ namespace OpenSim
Initialize();
- m_httpServer
- = new BaseHttpServer(
- m_httpServerPort, m_networkServersInfo.HttpUsesSSL,
- m_networkServersInfo.httpSSLPort, m_networkServersInfo.HttpSSLCN,
- m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass);
+ uint mainport = m_networkServersInfo.HttpListenerPort;
+ uint mainSSLport =m_networkServersInfo.httpSSLPort;
-/* why this? we only run one
- if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
+ if (m_networkServersInfo.HttpUsesSSL && (mainport == mainSSLport))
{
m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
-*/
- m_log.InfoFormat("[REGION SERVER]: Starting HTTP{0} server on port {1}",
- m_networkServersInfo.HttpUsesSSL ? "S" : "", m_httpServerPort);
- m_httpServer.Start();
- MainServer.AddHttpServer(m_httpServer);
+ if(m_networkServersInfo.HttpUsesSSL)
+ {
+ m_httpServer = new BaseHttpServer(
+ mainSSLport, m_networkServersInfo.HttpUsesSSL,
+ mainSSLport, m_networkServersInfo.HttpSSLCN,
+ m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass);
+ m_httpServer.Start(true,true);
+ MainServer.AddHttpServer(m_httpServer);
+
+ }
+
+ // unsecure main server
+ BaseHttpServer server = new BaseHttpServer(mainport);
+ if(!m_networkServersInfo.HttpUsesSSL)
+ {
+ m_httpServer = server;
+ server.Start(true, true);
+ }
+ else
+ server.Start(false, false);
+
+ MainServer.AddHttpServer(server);
+ MainServer.ÚnSecureInstance = server;
+
MainServer.Instance = m_httpServer;
// "OOB" Server
@@ -93,22 +108,22 @@ namespace OpenSim
{
if (!m_networkServersInfo.ssl_external)
{
- BaseHttpServer server = new BaseHttpServer(
- m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path,
+ server = new BaseHttpServer(
+ m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener,
+ m_networkServersInfo.cert_path,
m_networkServersInfo.cert_pass);
- m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port);
+ m_log.InfoFormat("[REGION SERVER]: Starting OOB HTTPS server on port {0}", server.SSLPort);
+ server.Start(false, false);
MainServer.AddHttpServer(server);
- server.Start();
}
else
{
- BaseHttpServer server = new BaseHttpServer(
- m_networkServersInfo.https_port);
+ server = new BaseHttpServer(m_networkServersInfo.https_port);
m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0} for external HTTPS", server.Port);
+ server.Start(false, false);
MainServer.AddHttpServer(server);
- server.Start();
}
}
diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs
index 50276ae..9273b20 100644
--- a/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs
+++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataRequestHandler.cs
@@ -52,12 +52,12 @@ namespace OpenSim.Region.DataSnapshot
m_externalData = externalData;
//Register HTTP handler
- if (MainServer.Instance.AddHTTPHandler("collector", OnGetSnapshot))
+ if (MainServer.ÚnSecureInstance.AddHTTPHandler("collector", OnGetSnapshot))
{
m_log.Info("[DATASNAPSHOT]: Set up snapshot service");
}
// Register validation callback handler
- MainServer.Instance.AddHTTPHandler("validate", OnValidate);
+ MainServer.ÚnSecureInstance.AddHTTPHandler("validate", OnValidate);
}
--
cgit v1.1
From 6b0094645c404ab58c2ef287571578a81712843d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 10 Oct 2016 20:14:02 +0100
Subject: change some coments relative to ssl in config files
---
bin/OpenSim.ini.example | 55 +++++++++++++++++++++++++++++++++++++++----------
bin/OpenSimDefaults.ini | 7 ++++---
2 files changed, 48 insertions(+), 14 deletions(-)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 3fe3992..36dae35 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -46,22 +46,28 @@
[Const]
- ; For a grid these will usually be the externally accessible IP/DNS
- ; name and use default public port 8002 and default private port 8003
- ; For a standalone this will usually be the externally accessible IP/DNS
- ; name and use default public port 9000. The private port is not used
- ; in the configuration for a standalone.
-
- ;# {BaseURL} {} {BaseURL} {"http://example.com" "http://127.0.0.1"} "http://127.0.0.1"
+ ; this section defines constants for grid services
+ ; to simplify other configuration files default settings
+
+ ; BaseURL
+ ; should be the externally accessible IP/DNS name of grid or standalone
+ ; http://externalHostName or https://externalHostName if using ssl
+ ; examples: http://mymachine.example.com, https://mymachine.example.com, https://127.0.0.1
+ ; default: http://127.0.0.1
+ ;# {BaseURL} {} {BaseURL} {"http://example.com" "http://127.0.0.1"} ""
BaseURL = http://127.0.0.1
- ;# {PublicPort} {} {PublicPort} {8002 9000} "8002"
+ ; default public port
+ ; usually 8002 for grids.
+ ; on standalones it needs to match http_listener_port or http_listener_sslport if using ssl
+ ; in [Network] section below (defaults 9000 or 9001 if using ssl)
+ ;# {PublicPort} {} {PublicPort} {8002 9000 9001} "8002"
PublicPort = "8002"
+ ;grid default private port 8003, not used in standalone
;# {PrivatePort} {} {PrivatePort} {8003} "8003"
PrivatePort = "8003"
-
[Startup]
;# {ConsolePrompt} {} {ConsolePrompt} {} "Region (\R) "
;; Console prompt
@@ -437,7 +443,6 @@
;; Password for the default estate owner
; DefaultEstateOwnerPassword = password
-
[SMTP]
;; The SMTP server enabled the email module to send email to external
;; destinations.
@@ -470,7 +475,6 @@
;# {SMTP_SERVER_PASSWORD} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server password} {}
; SMTP_SERVER_PASSWORD = ""
-
[Network]
;# {ConsoleUser} {} {User name for console account} {}
;; Configure the remote console user here. This will not actually be used
@@ -487,10 +491,39 @@
;; the region ports use UDP.
; http_listener_port = 9000
+ ; optional main server secure http (ssl)
+ ; to use ssl you need a ssl certificate in PKCS12 format that validates the ExternalHostnames
+ ; or their domains
+ ; some viewers by default only accept certificates signed by a oficial CA
+ ; to use others like self signed certificates with those viewers,
+ ; their debug option NoVerifySSLCert needs to be set true, You need to inform users about this
+ ; the main unsecure port will still open for some services. this may change in future.
+
+ ; set http_listener_ssl to enable main server ssl. it will replace unsecure port on most functions
+ ;# {http_listener_ssl}{} {enable main server ssl port)} {} false
+ ;http_listener_ssl = false
+
+ ; Set port for main SSL connections
+ ;# {http_listener_sslport}{} {main server ssl port)} {} 9001
+ ;http_listener_sslport = 9001 ;
+
+ ; currently if using ssl, regions ExternalHostName must the the same and equal to http_listener_cn
+ ; this may be removed in future
+ ;# {http_listener_cn}{} {main server ssl externalHostName)} {} ""
+ ;http_listener_cn = "myRegionsExternalHostName"
+
+ ; the path for the certificate path
+ ;# {http_listener_cert_path}{} {main server ssl certificate file path)} {} ""
+ ;http_listener_cert_path = "mycert.p12"
+
+ ;# {http_listener_cert_pass}{} {main server ssl certificate password)} {} ""
+ ;http_listener_cert_pass = "mycertpass" ; the cert passwork
+
; By default, OpenSimulator does not allow scripts to make HTTP calls to addresses on the simulator's LAN.
; See the OutboundDisallowForUserScripts parameter in OpenSimDefaults.ini for more information on this filter.
; If you need to allow scripts to make some LAN calls use the OutboundDisallowForUserScriptsExcept parameter below.
; We recommend that you do not override OutboundDisallowForUserScripts directly unless you are very sure about what you're doing.
+ ; this HTTP calls can also use ssl see opensimDefaults.ini
;
; You can whitelist individual endpoints by IP or FQDN, e.g.
;
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 01a44c3..bd37748 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -510,8 +510,8 @@
http_listener_cert_path = "mycert.p12" ; path for the cert file that is valid for the ExternalHostName
http_listener_cert_pass = "mycertpass" ; the cert passwork
- ; HTTPS for "Out of band" management applications such as the remote
- ; admin module
+ ; addicional HTTPS for "Out of band" management applications such as the remote
+ ; admin module or scripts
;
; Create https_listener = "True" will create a listener on the port
; specified. Provide the path to your server certificate along with it's
@@ -519,7 +519,7 @@
; https_listener = False
; Set our listener to this port
; https_port = 0
- ; Path to X509 certificate
+ ; Path to X509 certificate, can be the same as main or another
; cert_path = "path/to/cert.p12"
; Password for cert
; cert_pass = "password"
@@ -531,6 +531,7 @@
; HttpBodyMaxLenMAX=16384
; Hostname to use in llRequestURL/llRequestSecureURL
+ ; must be a valid hostname for the ssl cert.
; if not defined - default machine name is being used
; (on Windows this mean NETBIOS name - useably only inside local network)
; ExternalHostNameForLSL=127.0.0.1
--
cgit v1.1
From 08dee3fa34f72912cab3c5facdc79083e85b39ef Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 19 Nov 2016 15:46:47 +0000
Subject: fix pool parameters for httptests
---
OpenSim/Framework/Console/RemoteConsole.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index 9049b4b..b9c7537 100644
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -403,7 +403,7 @@ namespace OpenSim.Framework.Console
string uri = "/ReadResponses/" + sessionID.ToString() + "/";
m_Server.AddPollServiceHTTPHandler(
- uri, new PollServiceEventArgs(null, uri, HasEvents, GetEvents, NoEvents, sessionID,25000)); // 25 secs timeout
+ uri, new PollServiceEventArgs(null, uri, HasEvents, GetEvents, NoEvents, null, sessionID,25000)); // 25 secs timeout
// Our reply is an XML document.
// TODO: Change this to Linq.Xml
--
cgit v1.1
From 6b017f94ead6236a14db11a4d802ed259de1eb91 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 27 Nov 2016 15:23:08 +0000
Subject: update httpserver dll fixing a memory leak
---
bin/HttpServer_OpenSim.dll | Bin 118272 -> 130048 bytes
bin/HttpServer_OpenSim.pdb | Bin 325120 -> 353792 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index 605fa6a..6c9e5a5 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index 563b5e0..13910cf 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From 9df95afd8609a0b94ec63fb07182c7983f28cbe6 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 2 Dec 2016 13:54:11 +0000
Subject: update httpserver
---
bin/HttpServer_OpenSim.dll | Bin 130048 -> 130560 bytes
bin/HttpServer_OpenSim.pdb | Bin 353792 -> 355840 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index 6c9e5a5..121ec82 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index 13910cf..c2a3fd9 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From ccaa7a4a8ae986a5c6c77e03245159ee8bc1550f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 6 Dec 2016 10:26:36 +0000
Subject: save a few lists scaning
---
.../Handlers/FetchInventory/FetchInvDescHandler.cs | 138 ++++++++++++---------
1 file changed, 80 insertions(+), 58 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
index 2fb1c63..e3d285a 100644
--- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
+++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs
@@ -113,10 +113,7 @@ namespace OpenSim.Capabilities.Handlers
continue;
}
- // Filter duplicate folder ids that bad viewers may send
- if (folders.Find(f => f.folder_id == llsdRequest.folder_id) == null)
- folders.Add(llsdRequest);
-
+ folders.Add(llsdRequest);
}
if (folders.Count > 0)
@@ -431,34 +428,26 @@ namespace OpenSim.Capabilities.Handlers
}
- private void AddLibraryFolders(List fetchFolders, List result)
+ private void AddLibraryFolders(List libFolders, List result)
{
InventoryFolderImpl fold;
- if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null)
+ foreach (LLSDFetchInventoryDescendents f in libFolders)
{
- List libfolders = fetchFolders.FindAll(f => f.owner_id == m_LibraryService.LibraryRootFolder.Owner);
- fetchFolders.RemoveAll(f => libfolders.Contains(f));
-
- //m_log.DebugFormat("[XXX]: Found {0} library folders in request", libfolders.Count);
-
- foreach (LLSDFetchInventoryDescendents f in libfolders)
+ if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(f.folder_id)) != null)
{
- if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(f.folder_id)) != null)
- {
- InventoryCollectionWithDescendents ret = new InventoryCollectionWithDescendents();
- ret.Collection = new InventoryCollection();
+ InventoryCollectionWithDescendents ret = new InventoryCollectionWithDescendents();
+ ret.Collection = new InventoryCollection();
// ret.Collection.Folders = new List();
- ret.Collection.Folders = fold.RequestListOfFolders();
- ret.Collection.Items = fold.RequestListOfItems();
- ret.Collection.OwnerID = m_LibraryService.LibraryRootFolder.Owner;
- ret.Collection.FolderID = f.folder_id;
- ret.Collection.Version = fold.Version;
+ ret.Collection.Folders = fold.RequestListOfFolders();
+ ret.Collection.Items = fold.RequestListOfItems();
+ ret.Collection.OwnerID = m_LibraryService.LibraryRootFolder.Owner;
+ ret.Collection.FolderID = f.folder_id;
+ ret.Collection.Version = fold.Version;
- ret.Descendents = ret.Collection.Items.Count + ret.Collection.Folders.Count;
- result.Add(ret);
+ ret.Descendents = ret.Collection.Items.Count + ret.Collection.Folders.Count;
+ result.Add(ret);
- //m_log.DebugFormat("[XXX]: Added libfolder {0} ({1}) {2}", ret.Collection.FolderID, ret.Collection.OwnerID);
- }
+ //m_log.DebugFormat("[XXX]: Added libfolder {0} ({1}) {2}", ret.Collection.FolderID, ret.Collection.OwnerID);
}
}
}
@@ -471,64 +460,97 @@ namespace OpenSim.Capabilities.Handlers
// FIXME MAYBE: We're not handling sortOrder!
List result = new List();
+ if(fetchFolders.Count <= 0)
+ return result;
+
+ List libFolders = new List();
+ List otherFolders = new List();
+ HashSet libIDs = new HashSet();
+ HashSet otherIDs = new HashSet();
- AddLibraryFolders(fetchFolders, result);
+ bool dolib = (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null);
+ UUID libOwner = UUID.Zero;
+ if(dolib)
+ libOwner = m_LibraryService.LibraryRootFolder.Owner;
// Filter folder Zero right here. Some viewers (Firestorm) send request for folder Zero, which doesn't make sense
// and can kill the sim (all root folders have parent_id Zero)
// send something.
- LLSDFetchInventoryDescendents zero = fetchFolders.Find(f => f.folder_id == UUID.Zero);
- if (zero != null)
+ foreach(LLSDFetchInventoryDescendents f in fetchFolders)
{
- fetchFolders.Remove(zero);
- InventoryCollectionWithDescendents zeroColl = new InventoryCollectionWithDescendents();
- zeroColl.Collection = new InventoryCollection();
- zeroColl.Collection.OwnerID = zero.owner_id;
- zeroColl.Collection.Version = 0;
- zeroColl.Collection.FolderID = zero.folder_id;
- zeroColl.Descendents = 0;
- result.Add(zeroColl);
+ if (f.folder_id == UUID.Zero)
+ {
+ InventoryCollectionWithDescendents zeroColl = new InventoryCollectionWithDescendents();
+ zeroColl.Collection = new InventoryCollection();
+ zeroColl.Collection.OwnerID = f.owner_id;
+ zeroColl.Collection.Version = 0;
+ zeroColl.Collection.FolderID = f.folder_id;
+ zeroColl.Descendents = 0;
+ result.Add(zeroColl);
+ continue;
+ }
+ if(dolib && f.owner_id == libOwner)
+ {
+ if(libIDs.Contains(f.folder_id))
+ continue;
+ libIDs.Add(f.folder_id);
+ libFolders.Add(f);
+ continue;
+ }
+ if(otherIDs.Contains(f.folder_id))
+ continue;
+ otherIDs.Add(f.folder_id);
+ otherFolders.Add(f);
}
- if (fetchFolders.Count > 0)
- {
- UUID[] fids = new UUID[fetchFolders.Count];
+
+ if(otherFolders.Count > 0)
+ {
+ UUID[] fids = new UUID[otherFolders.Count];
int i = 0;
- foreach (LLSDFetchInventoryDescendents f in fetchFolders)
+ foreach (LLSDFetchInventoryDescendents f in otherFolders)
fids[i++] = f.folder_id;
//m_log.DebugFormat("[XXX]: {0}", string.Join(",", fids));
- InventoryCollection[] fetchedContents = m_InventoryService.GetMultipleFoldersContent(fetchFolders[0].owner_id, fids);
+ InventoryCollection[] fetchedContents = m_InventoryService.GetMultipleFoldersContent(otherFolders[0].owner_id, fids);
- if (fetchedContents == null || (fetchedContents != null && fetchedContents.Length == 0))
+ if (fetchedContents == null)
+ return null;
+
+ if (fetchedContents.Length == 0)
{
- m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Could not get contents of multiple folders for user {0}", fetchFolders[0].owner_id);
- foreach (LLSDFetchInventoryDescendents freq in fetchFolders)
+ foreach (LLSDFetchInventoryDescendents freq in otherFolders)
BadFolder(freq, null, bad_folders);
- return null;
}
-
- i = 0;
- // Do some post-processing. May need to fetch more from inv server for links
- foreach (InventoryCollection contents in fetchedContents)
+ else
{
- // Find the original request
- LLSDFetchInventoryDescendents freq = fetchFolders[i++];
+ i = 0;
+ // Do some post-processing. May need to fetch more from inv server for links
+ foreach (InventoryCollection contents in fetchedContents)
+ {
+ // Find the original request
+ LLSDFetchInventoryDescendents freq = otherFolders[i++];
- InventoryCollectionWithDescendents coll = new InventoryCollectionWithDescendents();
- coll.Collection = contents;
+ InventoryCollectionWithDescendents coll = new InventoryCollectionWithDescendents();
+ coll.Collection = contents;
- if (BadFolder(freq, contents, bad_folders))
- continue;
+ if (BadFolder(freq, contents, bad_folders))
+ continue;
- // Next: link management
- ProcessLinks(freq, coll);
+ // Next: link management
+ ProcessLinks(freq, coll);
- result.Add(coll);
+ result.Add(coll);
+ }
}
}
+ if(dolib && libFolders.Count > 0)
+ {
+ AddLibraryFolders(libFolders, result);
+ }
+
return result;
}
--
cgit v1.1
From 049dd374e9becc12b3e36e42d217f79ebf09ad45 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 7 Dec 2016 12:23:40 +0000
Subject: add SSL certs validation options for robust to allow simple
certificates, possible only for encriptation without any peer
autentification. disable validation by default for the small grids case
---
OpenSim/Server/ServerMain.cs | 27 +++++++++++++++++++++++++++
bin/Robust.HG.ini.example | 9 +++++++++
2 files changed, 36 insertions(+)
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index ed5a481..190f60f 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -30,6 +30,8 @@ using log4net;
using System.Reflection;
using System;
using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
using System.Collections.Generic;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
@@ -51,6 +53,26 @@ namespace OpenSim.Server
new List();
protected static PluginLoader loader;
+ private static bool m_NoVerifyCertChain = false;
+ private static bool m_NoVerifyCertHostname = false;
+
+ public static bool ValidateServerCertificate(
+ object sender,
+ X509Certificate certificate,
+ X509Chain chain,
+ SslPolicyErrors sslPolicyErrors)
+ {
+ if (m_NoVerifyCertChain)
+ sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateChainErrors;
+
+ if (m_NoVerifyCertHostname)
+ sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateNameMismatch;
+
+ if (sslPolicyErrors == SslPolicyErrors.None)
+ return true;
+
+ return false;
+ }
public static int Main(string[] args)
{
@@ -69,6 +91,11 @@ namespace OpenSim.Server
throw new Exception("Configuration error");
}
+ m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain);
+ m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname);
+
+ ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
+
string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
registryLocation = serverConfig.GetString("RegistryLocation",".");
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index c231a8a..08a3b8c 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -70,6 +70,15 @@
; How many lines of command history should we keep? (default is 100)
ConsoleHistoryFileLines = 100
+ ; peers SSL certificate validation options (if using ssl)
+ ; you should set this to false forcing all peers (like regions) to have valid certificates
+ ; but you can allow selfsigned certificates or no official CA with next option true
+ NoVerifyCertChain = true
+ ; you can also bypass the hostname or domain verification
+ NoVerifyCertHostname = true
+ ; having both options true does provide encriptation, but low security
+ ; possible enought for small grids, specially it not comercial
+
[ServiceList]
AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector"
--
cgit v1.1
From 3a81642d979a84c5c2e666cb500e080d56f887ed Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 7 Dec 2016 13:30:07 +0000
Subject: add SSL certs validation options for regions to allow simple
encriptation without any peer autentification using simple homemade (or even
shared) certs.
---
OpenSim/Framework/Servers/BaseOpenSimServer.cs | 30 +++++++++++++++++++++++++-
OpenSim/Server/ServerMain.cs | 2 +-
bin/OpenSim.ini.example | 13 +++++++++++
bin/OpenSimDefaults.ini | 15 ++++++++++++-
bin/Robust.HG.ini.example | 1 +
bin/Robust.ini.example | 10 +++++++++
6 files changed, 68 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 1d4deac..541b658 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -33,6 +33,9 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Timers;
+using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
using log4net;
using log4net.Appender;
using log4net.Core;
@@ -85,7 +88,27 @@ namespace OpenSim.Framework.Servers
// Random uuid for private data
m_osSecret = UUID.Random().ToString();
}
-
+
+ private static bool m_NoVerifyCertChain = false;
+ private static bool m_NoVerifyCertHostname = false;
+
+ public static bool ValidateServerCertificate(
+ object sender,
+ X509Certificate certificate,
+ X509Chain chain,
+ SslPolicyErrors sslPolicyErrors)
+ {
+ if (m_NoVerifyCertChain)
+ sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateChainErrors;
+
+ if (m_NoVerifyCertHostname)
+ sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateNameMismatch;
+
+ if (sslPolicyErrors == SslPolicyErrors.None)
+ return true;
+
+ return false;
+ }
///
/// Must be overriden by child classes for their own server specific startup behaviour.
///
@@ -96,6 +119,11 @@ namespace OpenSim.Framework.Servers
RegisterCommonComponents(Config);
IConfig startupConfig = Config.Configs["Startup"];
+
+ m_NoVerifyCertChain = startupConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain);
+ m_NoVerifyCertHostname = startupConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname);
+ ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
+
int logShowStatsSeconds = startupConfig.GetInt("LogShowStatsSeconds", m_periodDiagnosticTimerMS / 1000);
m_periodDiagnosticTimerMS = logShowStatsSeconds * 1000;
m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index 190f60f..9d6a3d0 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -79,6 +79,7 @@ namespace OpenSim.Server
// Make sure we don't get outbound connections queueing
ServicePointManager.DefaultConnectionLimit = 50;
ServicePointManager.UseNagleAlgorithm = false;
+ ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
m_Server = new HttpServerBase("R.O.B.U.S.T.", args);
@@ -94,7 +95,6 @@ namespace OpenSim.Server
m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain);
m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname);
- ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 4df6584..a4a6d0c 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -295,6 +295,19 @@
;; default is false
; TelehubAllowLandmark = false
+
+ ;; SSL certificate validation options
+ ;; used also on contacting other peers that require SSL and we don't
+ ;; you should set this to false forcing all peers (like regions) to have valid certificates
+ ;; but you can allow selfsigned certificates or no official CA with next option true
+ ;# {NoVerifyCertChain} {} {do not verify SSL Cert Chain} {true false} true
+ ; NoVerifyCertChain = true
+
+ ;; you can also bypass the hostname or domain verification
+ ;# {NoVerifyCertHostname} {} {do not verify SSL Cert name versus peer name} {true false} true
+ ; NoVerifyCertHostname = true
+ ;; having both options true does provide encriptation, but low security
+ ;; possible enought for small grids, specially it not comercial
[AccessControl]
;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {}
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 6539f6e..4884d3d 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -401,7 +401,20 @@
; routing and land at the landmark coordinates when set to true
; default is false
; TelehubAllowLandmark = false
-
+
+ ; #
+ ; # SSL certificates validation options
+ ; #
+
+ ; SSL certificate validation options
+ ; used also on contacting other peers that require SSL and we don't
+ ; you should set this to false forcing all peers (like regions) to have valid certificates
+ ; but you can allow selfsigned certificates or no official CA with next option true
+ ; NoVerifyCertChain = true
+ ; you can also bypass the hostname or domain verification
+ ; NoVerifyCertHostname = true
+ ; having both options true does provide encriptation, but low security
+ ; possible enought for small grids, specially it not comercial
[Map]
; Map tile options.
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index 08a3b8c..f66b245 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -71,6 +71,7 @@
ConsoleHistoryFileLines = 100
; peers SSL certificate validation options (if using ssl)
+ ; used also on contacting other peers that require SSL and we don't
; you should set this to false forcing all peers (like regions) to have valid certificates
; but you can allow selfsigned certificates or no official CA with next option true
NoVerifyCertChain = true
diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example
index 743b23d..5e6ce47 100644
--- a/bin/Robust.ini.example
+++ b/bin/Robust.ini.example
@@ -61,6 +61,16 @@
; How many lines of command history should we keep? (default is 100)
ConsoleHistoryFileLines = 100
+
+ ; peers SSL certificate validation options
+ ; used also on contacting other peers that require SSL and we don't
+ ; you should set this to false forcing all peers (like regions) to have valid certificates
+ ; but you can allow selfsigned certificates or no official CA with next option true
+ NoVerifyCertChain = true
+ ; you can also bypass the hostname or domain verification
+ NoVerifyCertHostname = true
+ ; having both options true does provide encriptation, but low security
+ ; possible enought for small grids, specially it not comercial
[ServiceList]
AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector"
--
cgit v1.1
From 95ff859484637fe1bedfc50f0a1d9be449113971 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 7 Dec 2016 20:33:38 +0000
Subject: change a few ssl config comments
---
bin/OpenSim.ini.example | 10 ++++------
bin/OpenSimDefaults.ini | 8 +++-----
bin/Robust.HG.ini.example | 10 ++++------
bin/Robust.ini.example | 8 +++-----
4 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index a4a6d0c..7426980 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -297,18 +297,16 @@
;; SSL certificate validation options
- ;; used also on contacting other peers that require SSL and we don't
- ;; you should set this to false forcing all peers (like regions) to have valid certificates
- ;; but you can allow selfsigned certificates or no official CA with next option true
+ ;; you can allow selfsigned certificates or no official CA with next option set to true
;# {NoVerifyCertChain} {} {do not verify SSL Cert Chain} {true false} true
; NoVerifyCertChain = true
;; you can also bypass the hostname or domain verification
;# {NoVerifyCertHostname} {} {do not verify SSL Cert name versus peer name} {true false} true
; NoVerifyCertHostname = true
- ;; having both options true does provide encriptation, but low security
- ;; possible enought for small grids, specially it not comercial
-
+ ;; having both options true does provide encryption but with low security
+ ;; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it.
+
[AccessControl]
;# {AllowedClients} {} {Bar (|) separated list of allowed clients} {}
;; Bar (|) separated list of viewers which may gain access to the regions.
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 4884d3d..a8566e2 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -407,14 +407,12 @@
; #
; SSL certificate validation options
- ; used also on contacting other peers that require SSL and we don't
- ; you should set this to false forcing all peers (like regions) to have valid certificates
- ; but you can allow selfsigned certificates or no official CA with next option true
+ ; you can allow selfsigned certificates or no official CA with next option set to true
; NoVerifyCertChain = true
; you can also bypass the hostname or domain verification
; NoVerifyCertHostname = true
- ; having both options true does provide encriptation, but low security
- ; possible enought for small grids, specially it not comercial
+ ; having both options true does provide encryption but with low security
+ ; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it.
[Map]
; Map tile options.
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index f66b245..0382d4b 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -70,15 +70,13 @@
; How many lines of command history should we keep? (default is 100)
ConsoleHistoryFileLines = 100
- ; peers SSL certificate validation options (if using ssl)
- ; used also on contacting other peers that require SSL and we don't
- ; you should set this to false forcing all peers (like regions) to have valid certificates
- ; but you can allow selfsigned certificates or no official CA with next option true
+ ; peers SSL certificate validation options
+ ; you can allow selfsigned certificates or no official CA with next option set to true
NoVerifyCertChain = true
; you can also bypass the hostname or domain verification
NoVerifyCertHostname = true
- ; having both options true does provide encriptation, but low security
- ; possible enought for small grids, specially it not comercial
+ ; having both options true does provide encryption but with low security
+ ; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it.
[ServiceList]
diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example
index 5e6ce47..51cf9d8 100644
--- a/bin/Robust.ini.example
+++ b/bin/Robust.ini.example
@@ -63,14 +63,12 @@
ConsoleHistoryFileLines = 100
; peers SSL certificate validation options
- ; used also on contacting other peers that require SSL and we don't
- ; you should set this to false forcing all peers (like regions) to have valid certificates
- ; but you can allow selfsigned certificates or no official CA with next option true
+ ; you can allow selfsigned certificates or no official CA with next option set to true
NoVerifyCertChain = true
; you can also bypass the hostname or domain verification
NoVerifyCertHostname = true
- ; having both options true does provide encriptation, but low security
- ; possible enought for small grids, specially it not comercial
+ ; having both options true does provide encryption but with low security
+ ; set both true if you don't care to use SSL, they are needed to contact regions or grids that do use it.
[ServiceList]
AssetServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:AssetServiceConnector"
--
cgit v1.1
From 806e75eefbba1a55a3cb22470af3adf8d87b8767 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 8 Dec 2016 23:39:55 +0000
Subject: remove not needed sslport parameter
---
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 14 ++++++++------
OpenSim/Region/Application/RegionApplicationBase.cs | 5 ++---
.../Linden/Caps/EventQueue/Tests/EventQueueTests.cs | 3 +--
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index bd8b681..01d427e 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -108,7 +108,6 @@ namespace OpenSim.Framework.Servers.HttpServer
new Dictionary();
protected uint m_port;
- protected uint m_sslport;
protected bool m_ssl;
private X509Certificate2 m_cert;
protected string m_SSLCommonName = "";
@@ -120,9 +119,14 @@ namespace OpenSim.Framework.Servers.HttpServer
public PollServiceRequestManager PollServiceRequestManager { get; private set; }
+ public string Protocol
+ {
+ get { return m_ssl ? "https://" : "http://"; }
+ }
+
public uint SSLPort
{
- get { return m_sslport; }
+ get { return m_port; }
}
public string SSLCommonName
@@ -184,7 +188,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
- public BaseHttpServer(uint port, bool ssl, uint sslport, string CN, string CPath, string CPass)
+ public BaseHttpServer(uint port, bool ssl, string CN, string CPath, string CPass)
{
m_port = port;
if (ssl)
@@ -200,7 +204,6 @@ namespace OpenSim.Framework.Servers.HttpServer
m_certCN= "";
m_ssl = true;
- m_sslport = sslport;
load_cert(CPath, CPass);
if(!CheckSSLCertHost(CN))
@@ -224,7 +227,6 @@ namespace OpenSim.Framework.Servers.HttpServer
if(m_cert.Issuer == m_cert.Subject )
m_log.Warn("Self signed certificate. Http clients need to allow this");
m_ssl = true;
- m_sslport = port;
}
else
m_ssl = false;
@@ -2101,7 +2103,7 @@ namespace OpenSim.Framework.Servers.HttpServer
catch (Exception e)
{
m_log.Error("[BASE HTTP SERVER]: Error - " + e.Message);
- m_log.Error("[BASE HTTP SERVER]: Tip: Do you have permission to listen on port " + m_port + ", " + m_sslport + "?");
+ m_log.Error("[BASE HTTP SERVER]: Tip: Do you have permission to listen on port " + m_port + "?");
// We want this exception to halt the entire server since in current configurations we aren't too
// useful without inbound HTTP.
diff --git a/OpenSim/Region/Application/RegionApplicationBase.cs b/OpenSim/Region/Application/RegionApplicationBase.cs
index 77b0138..09940b5 100644
--- a/OpenSim/Region/Application/RegionApplicationBase.cs
+++ b/OpenSim/Region/Application/RegionApplicationBase.cs
@@ -70,7 +70,7 @@ namespace OpenSim
Initialize();
uint mainport = m_networkServersInfo.HttpListenerPort;
- uint mainSSLport =m_networkServersInfo.httpSSLPort;
+ uint mainSSLport = m_networkServersInfo.httpSSLPort;
if (m_networkServersInfo.HttpUsesSSL && (mainport == mainSSLport))
{
@@ -81,11 +81,10 @@ namespace OpenSim
{
m_httpServer = new BaseHttpServer(
mainSSLport, m_networkServersInfo.HttpUsesSSL,
- mainSSLport, m_networkServersInfo.HttpSSLCN,
+ m_networkServersInfo.HttpSSLCN,
m_networkServersInfo.HttpSSLCertPath, m_networkServersInfo.HttpSSLCNCertPass);
m_httpServer.Start(true,true);
MainServer.AddHttpServer(m_httpServer);
-
}
// unsecure main server
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
index 507d9b8..54af246 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs
@@ -59,13 +59,12 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
base.SetUp();
uint port = 9999;
- uint sslPort = 9998;
// This is an unfortunate bit of clean up we have to do because MainServer manages things through static
// variables and the VM is not restarted between tests.
MainServer.RemoveHttpServer(port);
- BaseHttpServer server = new BaseHttpServer(port, false, sslPort, "","","");
+ BaseHttpServer server = new BaseHttpServer(port, false, "","","");
MainServer.AddHttpServer(server);
MainServer.Instance = server;
--
cgit v1.1
From 6627da693e48836334016e26ddc1cd71b99e0fa8 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 9 Dec 2016 04:07:06 +0000
Subject: suport client certificate validation per listenner, with a supplied
static callback
---
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 4 ++++
bin/HttpServer_OpenSim.dll | Bin 130560 -> 131584 bytes
bin/HttpServer_OpenSim.pdb | Bin 355840 -> 357888 bytes
3 files changed, 4 insertions(+)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 01d427e..0492b51 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -32,6 +32,7 @@ using System.Collections.Specialized;
using System.IO;
using System.Net;
using System.Net.Sockets;
+using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Reflection;
using System.Globalization;
@@ -114,6 +115,7 @@ namespace OpenSim.Framework.Servers.HttpServer
protected List m_certNames = new List();
protected List m_certIPs = new List();
protected string m_certCN= "";
+ protected RemoteCertificateValidationCallback m_certificateValidationCallback = null;
protected IPAddress m_listenIPAddress = IPAddress.Any;
@@ -2076,6 +2078,8 @@ namespace OpenSim.Framework.Servers.HttpServer
//m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/");
//m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
m_httpListener2 = CoolHTTPListener.Create(IPAddress.Any, (int)m_port, m_cert);
+ if(m_certificateValidationCallback != null)
+ m_httpListener2.CertificateValidationCallback = m_certificateValidationCallback;
m_httpListener2.ExceptionThrown += httpServerException;
m_httpListener2.LogWriter = httpserverlog;
}
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index 121ec82..3b49692 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index c2a3fd9..9f6691f 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From 30dccd57cd0e9fcc676e77cfed4214d8a1e7f85c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 9 Dec 2016 04:32:59 +0000
Subject: provide remote SSLcommonName to xmlRpcRequest methods, but in a away
it can be detected/parsed. This is used by some external modules like
DTLNSLMoneyServer. But this module does need to change on this ( and it
cannot override default validation rules, it needs to do it on its
httplistener with method provided in previus commits
---
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 0492b51..d7e5123 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -1231,6 +1231,17 @@ namespace OpenSim.Framework.Servers.HttpServer
if (gridproxy)
xmlRprcRequest.Params.Add("gridproxy"); // Param[4]
+
+ // reserve this for
+ // ... by Fumi.Iseki for DTLNSLMoneyServer
+ // BUT make its presence possible to detect/parse
+ string rcn = request.IHttpClientContext.SSLCommonName;
+ if(!string.IsNullOrWhiteSpace(rcn))
+ {
+ rcn = "SSLCN:" + rcn;
+ xmlRprcRequest.Params.Add(rcn); // Param[4] or Param[5]
+ }
+
try
{
xmlRpcResponse = method(xmlRprcRequest, request.RemoteIPEndPoint);
--
cgit v1.1
From bbbbf47507c36d00519ff7265f04933da3eaacd4 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 18 Dec 2016 20:09:02 +0000
Subject: add a missing file change
---
OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
index 1453204..f8b475a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
uint port = 9999;
MainServer.RemoveHttpServer(port);
- BaseHttpServer server = new BaseHttpServer(port, false, 0, "", "", "");
+ BaseHttpServer server = new BaseHttpServer(port, false, "", "", "");
MainServer.AddHttpServer(server);
MainServer.Instance = server;
--
cgit v1.1
From 4bdf89d59b7a2cc8f075795e8b25551ebf55d534 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 19 Dec 2016 09:07:17 +0000
Subject: update httpserver muting some socket errors that are normal
---
bin/HttpServer_OpenSim.dll | Bin 131584 -> 119808 bytes
bin/HttpServer_OpenSim.pdb | Bin 357888 -> 327168 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index 3b49692..8b83634 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index 9f6691f..309daee 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From 52e7fc31f74e7e4447aac757148ac4789def88dd Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 25 Dec 2016 16:48:27 +0000
Subject: fix typos (thanks you know who)
---
bin/config-include/FlotsamCache.ini.example | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/bin/config-include/FlotsamCache.ini.example b/bin/config-include/FlotsamCache.ini.example
index 6666812..c0d7430 100644
--- a/bin/config-include/FlotsamCache.ini.example
+++ b/bin/config-include/FlotsamCache.ini.example
@@ -21,7 +21,7 @@
; Set to false for no memory cache
; assets can be requested several times in short periods
- ; so even a small memory cache is usefull
+ ; so even a small memory cache is useful
MemoryCacheEnabled = true
; Set to false for no file cache
@@ -31,9 +31,8 @@
; even a few minutes may mean many assets loaded to memory, if not all.
; this is good if memory is not a problem.
; if memory is a problem then a few seconds may actually save same.
- ; reducing duplications.
; see hit rates with console comand: fcache status
- MemoryCacheTimeout = .001 // 3.6s ie around 4s (1s resolution)
+ MemoryCacheTimeout = .001 ; 3.6s ie around 4s (1s resolution)
; How long {in hours} to keep assets cached on disk, .5 == 30 minutes
; Specify 0 if you do not want your disk cache to expire
--
cgit v1.1
From 5c79e03f18dcb85f777debff60f46e1dff816ccf Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 27 Dec 2016 12:26:08 +0000
Subject: some cleanup
---
.../Handlers/GetMesh/GetMeshHandler.cs | 41 ++--------------------
.../ClientStack/Linden/Caps/GetMeshModule.cs | 7 +---
2 files changed, 3 insertions(+), 45 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
index a9b81f3..a0471bb 100644
--- a/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetMesh/GetMeshHandler.cs
@@ -64,10 +64,7 @@ namespace OpenSim.Capabilities.Handlers
Hashtable ret = new Hashtable();
ret["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound;
ret["content_type"] = "text/plain";
- ret["keepalive"] = false;
- ret["reusecontext"] = false;
ret["int_bytes"] = 0;
- ret["int_lod"] = 0;
string MeshStr = (string)request["mesh_id"];
@@ -76,6 +73,8 @@ namespace OpenSim.Capabilities.Handlers
if (m_assetService == null)
{
m_log.Error("[GETMESH]: Cannot fetch mesh " + MeshStr + " without an asset service");
+ ret["keepalive"] = false;
+ return ret;
}
UUID meshID;
@@ -101,10 +100,7 @@ namespace OpenSim.Capabilities.Handlers
Hashtable responsedata = new Hashtable();
responsedata["int_response_code"] = 400; //501; //410; //404;
responsedata["content_type"] = "text/plain";
- responsedata["keepalive"] = false;
responsedata["str_response_string"] = "Request wasn't what was expected";
- responsedata["reusecontext"] = false;
- responsedata["int_lod"] = 0;
responsedata["int_bytes"] = 0;
string meshStr = string.Empty;
@@ -118,10 +114,8 @@ namespace OpenSim.Capabilities.Handlers
if (m_assetService == null)
{
responsedata["int_response_code"] = 404; //501; //410; //404;
- responsedata["content_type"] = "text/plain";
responsedata["keepalive"] = false;
responsedata["str_response_string"] = "The asset service is unavailable. So is your mesh.";
- responsedata["reusecontext"] = false;
return responsedata;
}
@@ -155,10 +149,7 @@ namespace OpenSim.Capabilities.Handlers
{
responsedata["int_response_code"] = 404; //501; //410; //404;
responsedata["content_type"] = "text/plain";
- responsedata["keepalive"] = false;
responsedata["str_response_string"] = "This range doesnt exist.";
- responsedata["reusecontext"] = false;
- responsedata["int_lod"] = 3;
return responsedata;
}
else
@@ -169,28 +160,11 @@ namespace OpenSim.Capabilities.Handlers
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
- if (start > 20000)
- {
- responsedata["int_lod"] = 3;
- }
- else if (start < 4097)
- {
- responsedata["int_lod"] = 1;
- }
- else
- {
- responsedata["int_lod"] = 2;
- }
-
-
if (start == 0 && len == mesh.Data.Length) // well redudante maybe
{
responsedata["int_response_code"] = (int)System.Net.HttpStatusCode.OK;
responsedata["bin_response_data"] = mesh.Data;
responsedata["int_bytes"] = mesh.Data.Length;
- responsedata["reusecontext"] = false;
- responsedata["int_lod"] = 3;
-
}
else
{
@@ -203,7 +177,6 @@ namespace OpenSim.Capabilities.Handlers
Array.Copy(mesh.Data, start, d, 0, len);
responsedata["bin_response_data"] = d;
responsedata["int_bytes"] = len;
- responsedata["reusecontext"] = false;
}
}
}
@@ -213,8 +186,6 @@ namespace OpenSim.Capabilities.Handlers
responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
responsedata["content_type"] = "application/vnd.ll.mesh";
responsedata["int_response_code"] = 200;
- responsedata["reusecontext"] = false;
- responsedata["int_lod"] = 3;
}
}
else
@@ -222,8 +193,6 @@ namespace OpenSim.Capabilities.Handlers
responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
responsedata["content_type"] = "application/vnd.ll.mesh";
responsedata["int_response_code"] = 200;
- responsedata["reusecontext"] = false;
- responsedata["int_lod"] = 3;
}
}
// Optionally add additional mesh types here
@@ -231,10 +200,7 @@ namespace OpenSim.Capabilities.Handlers
{
responsedata["int_response_code"] = 404; //501; //410; //404;
responsedata["content_type"] = "text/plain";
- responsedata["keepalive"] = false;
responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh.";
- responsedata["reusecontext"] = false;
- responsedata["int_lod"] = 1;
return responsedata;
}
}
@@ -242,10 +208,7 @@ namespace OpenSim.Capabilities.Handlers
{
responsedata["int_response_code"] = 404; //501; //410; //404;
responsedata["content_type"] = "text/plain";
- responsedata["keepalive"] = false;
responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!";
- responsedata["reusecontext"] = false;
- responsedata["int_lod"] = 0;
return responsedata;
}
}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index 783c3de..06ecf97 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -76,7 +76,6 @@ namespace OpenSim.Region.ClientStack.Linden
{
public Hashtable response;
public int bytes;
- public int lod;
}
@@ -330,9 +329,7 @@ namespace OpenSim.Region.ClientStack.Linden
response["str_response_string"] = "Script timeout";
response["content_type"] = "text/plain";
response["keepalive"] = false;
- response["reusecontext"] = false;
-
- responses[requestID] = new aPollResponse() { bytes = 0, response = response, lod = 0 };
+ responses[requestID] = new aPollResponse() { bytes = 0, response = response};
return;
}
@@ -354,7 +351,6 @@ namespace OpenSim.Region.ClientStack.Linden
responses[requestID] = new aPollResponse()
{
bytes = (int)response["int_bytes"],
- lod = (int)response["int_lod"],
response = response
};
@@ -423,7 +419,6 @@ namespace OpenSim.Region.ClientStack.Linden
private volatile int lastTimeElapsed = 0;
private volatile int BytesSent = 0;
private int CapSetThrottle = 0;
- private float CapThrottleDistributon = 0.30f;
private readonly Scene m_scene;
private ThrottleOutPacketType Throttle;
private readonly UUID User;
--
cgit v1.1
From 5fc36059552231ac5f79592f7d1845643dd89524 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 30 Dec 2016 07:15:28 +0000
Subject: some cleanup, use more using(), more checks so http request mem
stream is closed
---
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 69 ++++++++-------------
bin/HttpServer_OpenSim.dll | Bin 119808 -> 119808 bytes
bin/HttpServer_OpenSim.pdb | Bin 327168 -> 327168 bytes
3 files changed, 27 insertions(+), 42 deletions(-)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index d7e5123..9c6ee9c 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -529,14 +529,10 @@ namespace OpenSim.Framework.Servers.HttpServer
if (psEvArgs.Request != null)
{
OSHttpRequest req = new OSHttpRequest(context, request);
-
- Stream requestStream = req.InputStream;
-
+ string requestBody = String.Empty;
Encoding encoding = Encoding.UTF8;
- StreamReader reader = new StreamReader(requestStream, encoding);
-
- string requestBody = reader.ReadToEnd();
- reader.Close();
+ using(StreamReader reader = new StreamReader(req.InputStream, encoding))
+ requestBody = reader.ReadToEnd();
Hashtable keysvals = new Hashtable();
Hashtable headervals = new Hashtable();
@@ -630,6 +626,8 @@ namespace OpenSim.Framework.Servers.HttpServer
byte[] buffer500 = SendHTML500(response);
response.OutputStream.Write(buffer500, 0, buffer500.Length);
response.Send();
+ if(request.InputStream.CanRead)
+ request.InputStream.Close();
}
catch
{
@@ -674,7 +672,6 @@ namespace OpenSim.Framework.Servers.HttpServer
// }
// }
- //response.KeepAlive = true;
response.SendChunked = false;
string path = request.RawUrl;
@@ -698,15 +695,10 @@ namespace OpenSim.Framework.Servers.HttpServer
{
//m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler");
IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler;
- Stream requestStream = request.InputStream;
-
+ string requestBody = String.Empty;
Encoding encoding = Encoding.UTF8;
- StreamReader reader = new StreamReader(requestStream, encoding);
-
- string requestBody = reader.ReadToEnd();
-
- reader.Close();
- //requestStream.Close();
+ using(StreamReader reader = new StreamReader(request.InputStream, encoding))
+ requestBody = reader.ReadToEnd();
Hashtable keysvals = new Hashtable();
Hashtable headervals = new Hashtable();
@@ -746,7 +738,6 @@ namespace OpenSim.Framework.Servers.HttpServer
else
{
IStreamHandler streamHandler = (IStreamHandler)requestHandler;
-
using (MemoryStream memoryStream = new MemoryStream())
{
streamHandler.Handle(path, request.InputStream, memoryStream, request, response);
@@ -823,8 +814,6 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
- request.InputStream.Close();
-
if (buffer != null)
{
if (WebUtil.DebugLevel >= 5)
@@ -856,10 +845,6 @@ namespace OpenSim.Framework.Servers.HttpServer
requestEndTick = Environment.TickCount;
response.Send();
-
- //response.OutputStream.Close();
-
- //response.FreeContext();
}
catch (SocketException e)
{
@@ -891,6 +876,9 @@ namespace OpenSim.Framework.Servers.HttpServer
}
finally
{
+ if(request.InputStream.CanRead)
+ request.InputStream.Close();
+
// Every month or so this will wrap and give bad numbers, not really a problem
// since its just for reporting
int tickdiff = requestEndTick - requestStartTick;
@@ -1148,9 +1136,10 @@ namespace OpenSim.Framework.Servers.HttpServer
}
finally
{
- if (innerStream != null)
+ if (innerStream != null && innerStream.CanRead)
innerStream.Dispose();
- requestStream.Dispose();
+ if (requestStream.CanRead)
+ requestStream.Dispose();
}
//m_log.Debug(requestBody);
@@ -1407,15 +1396,15 @@ namespace OpenSim.Framework.Servers.HttpServer
//m_log.Warn("[BASE HTTP SERVER]: We've figured out it's a LLSD Request");
Stream requestStream = request.InputStream;
+ string requestBody = string.Empty;
Encoding encoding = Encoding.UTF8;
- StreamReader reader = new StreamReader(requestStream, encoding);
+ using(StreamReader reader = new StreamReader(requestStream,encoding))
+ requestBody = reader.ReadToEnd();
- string requestBody = reader.ReadToEnd();
- reader.Close();
- requestStream.Close();
+ if(requestStream.CanRead)
+ requestStream.Close();
//m_log.DebugFormat("[OGP]: {0}:{1}", request.RawUrl, requestBody);
- response.KeepAlive = true;
OSD llsdRequest = null;
OSD llsdResponse = null;
@@ -1736,15 +1725,12 @@ namespace OpenSim.Framework.Servers.HttpServer
byte[] buffer;
Stream requestStream = request.InputStream;
-
+ string requestBody = string.Empty;
Encoding encoding = Encoding.UTF8;
- StreamReader reader = new StreamReader(requestStream, encoding);
-
- string requestBody = reader.ReadToEnd();
- // avoid warning for now
- reader.ReadToEnd();
- reader.Close();
- requestStream.Close();
+ using(StreamReader reader = new StreamReader(requestStream,encoding))
+ requestBody = reader.ReadToEnd();
+ if(requestStream.CanRead)
+ requestStream.Close();
Hashtable keysvals = new Hashtable();
Hashtable headervals = new Hashtable();
@@ -2283,10 +2269,9 @@ namespace OpenSim.Framework.Servers.HttpServer
string file = Path.Combine(".", "http_500.html");
if (!File.Exists(file))
return getDefaultHTTP500();
-
- StreamReader sr = File.OpenText(file);
- string result = sr.ReadToEnd();
- sr.Close();
+ string result = string.Empty;
+ using(StreamReader sr = File.OpenText(file))
+ result = sr.ReadToEnd();
return result;
}
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index 8b83634..33a1211 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index 309daee..2ab14a1 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From 6a35a965ff7085b5962745437a10d798c0fb611d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 31 Mar 2017 20:55:48 +0100
Subject: add OSSL functions to override linksets total mass, center of mass
and inertia. replacing the crude automatic estimation based on prims known to
physics and density. Changed parameters are still not saved, and are lost on
region crossings. only suported by UbODE. EXPERIMENTAL feature, only test it
for now.. don't try to use in products.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 41 ++++
.../PhysicsModules/SharedBase/PhysicsActor.cs | 36 +++
OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 253 +++++++++++++++++----
.../Shared/Api/Implementation/OSSL_Api.cs | 213 +++++++++++++++++
.../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 8 +
.../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 26 +++
6 files changed, 531 insertions(+), 46 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index bf4d60c..77658ef 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -5010,6 +5010,47 @@ namespace OpenSim.Region.Framework.Scenes
return Ptot;
}
+ public void GetInertiaData(out float TotalMass, out Vector3 CenterOfMass, out Vector3 Inertia, out Vector4 aux )
+ {
+ PhysicsActor pa = RootPart.PhysActor;
+
+ if(((RootPart.Flags & PrimFlags.Physics) !=0) && pa !=null)
+ {
+ PhysicsInertiaData inertia;
+
+ inertia = pa.GetInertiaData();
+
+ TotalMass = inertia.TotalMass;
+ CenterOfMass = inertia.CenterOfMass;
+ Inertia = inertia.Inertia;
+ aux = inertia.InertiaRotation;
+
+ return;
+ }
+
+ TotalMass = GetMass();
+ CenterOfMass = GetCenterOfMass() - AbsolutePosition;
+ CenterOfMass *= Quaternion.Conjugate(RootPart.RotationOffset);
+ Inertia = Vector3.Zero;
+ aux = Vector4.Zero;
+ }
+
+ public void SetInertiaData(float TotalMass, Vector3 CenterOfMass, Vector3 Inertia, Vector4 aux )
+ {
+ PhysicsActor pa = RootPart.PhysActor;
+
+ if(pa !=null)
+ {
+ PhysicsInertiaData inertia = new PhysicsInertiaData();
+ inertia.TotalMass = TotalMass;
+ inertia.CenterOfMass = CenterOfMass;
+ inertia.Inertia = Inertia;
+ inertia.InertiaRotation = aux;
+ pa.SetInertiaData(inertia);
+ }
+ }
+
+
///
/// Set the user group to which this scene object belongs.
///
diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
index 33f0337..ad9b28f 100644
--- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
+++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
@@ -55,6 +55,28 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
Absolute
}
+ public class PhysicsInertiaData
+ {
+ public float TotalMass; // the total mass of a linkset
+ public Vector3 CenterOfMass; // the center of mass position relative to root part position
+ public Vector3 Inertia; // (Ixx, Iyy, Izz) moment of inertia relative to center of mass and principal axis in local coords
+ public Vector4 InertiaRotation; // if principal axis don't match local axis, the principal axis rotation
+ // or the upper triangle of the inertia tensor
+ // Ixy (= Iyx), Ixz (= Izx), Iyz (= Izy))
+
+ public PhysicsInertiaData()
+ {
+ }
+
+ public PhysicsInertiaData(PhysicsInertiaData source)
+ {
+ TotalMass = source.TotalMass;
+ CenterOfMass = source.CenterOfMass;
+ Inertia = source.Inertia;
+ InertiaRotation = source.InertiaRotation;
+ }
+ }
+
public struct CameraData
{
public Quaternion CameraRotation;
@@ -463,6 +485,20 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
public virtual void AddCollisionEvent(uint CollidedWith, ContactPoint contact) { }
+ public virtual PhysicsInertiaData GetInertiaData()
+ {
+ PhysicsInertiaData data = new PhysicsInertiaData();
+ data.TotalMass = this.Mass;
+ data.CenterOfMass = CenterOfMass - Position;
+ data.Inertia = Vector3.Zero;
+ data.InertiaRotation = Vector4.Zero;
+ return data;
+ }
+
+ public virtual void SetInertiaData(PhysicsInertiaData inertia)
+ {
+ }
+
// Warning in a parent part it returns itself, not null
public virtual PhysicsActor ParentActor { get { return this; } }
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 45ef273..d560b41 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -182,14 +182,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private float m_streamCost;
public d.Mass primdMass; // prim inertia information on it's own referencial
+ private PhysicsInertiaData m_InertiaOverride;
float primMass; // prim own mass
float primVolume; // prim own volume;
- float _mass; // object mass acording to case
+ float m_mass; // object mass acording to case
public int givefakepos;
private Vector3 fakepos;
public int givefakeori;
private Quaternion fakeori;
+ private PhysicsInertiaData m_fakeInertiaOverride;
private int m_eventsubscription;
private int m_cureventsubscription;
@@ -465,10 +467,110 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
}
+ public override PhysicsInertiaData GetInertiaData()
+ {
+ PhysicsInertiaData inertia;
+ if(childPrim)
+ {
+ if(_parent != null)
+ return _parent.GetInertiaData();
+ else
+ {
+ inertia = new PhysicsInertiaData();
+ inertia.TotalMass = -1;
+ return inertia;
+ }
+ }
+
+ inertia = new PhysicsInertiaData();
+
+ // double buffering
+ if(m_fakeInertiaOverride != null)
+ {
+ d.Mass objdmass = new d.Mass();
+ objdmass.I.M00 = m_fakeInertiaOverride.Inertia.X;
+ objdmass.I.M11 = m_fakeInertiaOverride.Inertia.Y;
+ objdmass.I.M22 = m_fakeInertiaOverride.Inertia.Z;
+
+ objdmass.mass = m_fakeInertiaOverride.TotalMass;
+
+ if(Math.Abs(m_fakeInertiaOverride.InertiaRotation.W) < 0.999)
+ {
+ d.Matrix3 inertiarotmat = new d.Matrix3();
+ d.Quaternion inertiarot = new d.Quaternion();
+
+ inertiarot.X = m_fakeInertiaOverride.InertiaRotation.X;
+ inertiarot.Y = m_fakeInertiaOverride.InertiaRotation.Y;
+ inertiarot.Z = m_fakeInertiaOverride.InertiaRotation.Z;
+ inertiarot.W = m_fakeInertiaOverride.InertiaRotation.W;
+ d.RfromQ(out inertiarotmat, ref inertiarot);
+ d.MassRotate(ref objdmass, ref inertiarotmat);
+ }
+
+ inertia.TotalMass = m_fakeInertiaOverride.TotalMass;
+ inertia.CenterOfMass = m_fakeInertiaOverride.CenterOfMass;
+ inertia.Inertia.X = objdmass.I.M00;
+ inertia.Inertia.Y = objdmass.I.M11;
+ inertia.Inertia.Z = objdmass.I.M22;
+ inertia.InertiaRotation.X = objdmass.I.M01;
+ inertia.InertiaRotation.Y = objdmass.I.M02;
+ inertia.InertiaRotation.Z = objdmass.I.M12;
+ return inertia;
+ }
+
+ inertia.TotalMass = m_mass;
+
+ if(Body == IntPtr.Zero || prim_geom == IntPtr.Zero)
+ {
+ inertia.CenterOfMass = Vector3.Zero;
+ inertia.Inertia = Vector3.Zero;
+ inertia.InertiaRotation = Vector4.Zero;
+ return inertia;
+ }
+
+ d.Vector3 dtmp;
+ d.Mass m = new d.Mass();
+ lock(_parent_scene.OdeLock)
+ {
+ d.AllocateODEDataForThread(0);
+ dtmp = d.GeomGetOffsetPosition(prim_geom);
+ d.BodyGetMass(Body, out m);
+ }
+
+ Vector3 cm = new Vector3(-dtmp.X, -dtmp.Y, -dtmp.Z);
+ inertia.CenterOfMass = cm;
+ inertia.Inertia = new Vector3(m.I.M00, m.I.M11, m.I.M22);
+ inertia.InertiaRotation = new Vector4(m.I.M01, m.I.M02 , m.I.M12, 0);
+
+ return inertia;
+ }
+
+ public override void SetInertiaData(PhysicsInertiaData inertia)
+ {
+ if(childPrim)
+ {
+ if(_parent != null)
+ _parent.SetInertiaData(inertia);
+ return;
+ }
+
+ if(inertia.TotalMass > 0)
+ m_fakeInertiaOverride = new PhysicsInertiaData(inertia);
+ else
+ m_fakeInertiaOverride = null;
+
+ if (inertia.TotalMass > _parent_scene.maximumMassObject)
+ inertia.TotalMass = _parent_scene.maximumMassObject;
+ AddChange(changes.SetInertia,(object)m_fakeInertiaOverride);
+ }
+
public override Vector3 CenterOfMass
{
get
{
+ if(!childPrim && m_fakeInertiaOverride != null)
+ return m_fakeInertiaOverride.CenterOfMass;
+
lock (_parent_scene.OdeLock)
{
d.AllocateODEDataForThread(0);
@@ -922,8 +1024,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
float old = m_density;
m_density = value / 100f;
- if(m_density != old)
- UpdatePrimBodyData();
+ // if(m_density != old)
+ // UpdatePrimBodyData();
}
}
public override float GravModifier
@@ -1716,26 +1818,29 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_log.Warn("[PHYSICS]: MakeBody root geom already had a body");
}
- d.Matrix3 mymat = new d.Matrix3();
- d.Quaternion myrot = new d.Quaternion();
- d.Mass objdmass = new d.Mass { };
+ bool noInertiaOverride = (m_InertiaOverride == null);
Body = d.BodyCreate(_parent_scene.world);
- objdmass = primdMass;
+ d.Matrix3 mymat = new d.Matrix3();
+ d.Quaternion myrot = new d.Quaternion();
+ d.Mass objdmass = new d.Mass { };
- // rotate inertia
myrot.X = _orientation.X;
myrot.Y = _orientation.Y;
myrot.Z = _orientation.Z;
myrot.W = _orientation.W;
-
d.RfromQ(out mymat, ref myrot);
- d.MassRotate(ref objdmass, ref mymat);
// set the body rotation
d.BodySetRotation(Body, ref mymat);
+ if(noInertiaOverride)
+ {
+ objdmass = primdMass;
+ d.MassRotate(ref objdmass, ref mymat);
+ }
+
// recompute full object inertia if needed
if (childrenPrim.Count > 0)
{
@@ -1758,27 +1863,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
continue;
}
- tmpdmass = prm.primdMass;
-
- // apply prim current rotation to inertia
quat.X = prm._orientation.X;
quat.Y = prm._orientation.Y;
quat.Z = prm._orientation.Z;
quat.W = prm._orientation.W;
d.RfromQ(out mat, ref quat);
- d.MassRotate(ref tmpdmass, ref mat);
-
- Vector3 ppos = prm._position;
- ppos.X -= rcm.X;
- ppos.Y -= rcm.Y;
- ppos.Z -= rcm.Z;
- // refer inertia to root prim center of mass position
- d.MassTranslate(ref tmpdmass,
- ppos.X,
- ppos.Y,
- ppos.Z);
-
- d.MassAdd(ref objdmass, ref tmpdmass); // add to total object inertia
+
// fix prim colision cats
if (d.GeomGetBody(prm.prim_geom) != IntPtr.Zero)
@@ -1791,6 +1881,24 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.GeomSetBody(prm.prim_geom, Body);
prm.Body = Body;
d.GeomSetOffsetWorldRotation(prm.prim_geom, ref mat); // set relative rotation
+
+ if(noInertiaOverride)
+ {
+ tmpdmass = prm.primdMass;
+
+ d.MassRotate(ref tmpdmass, ref mat);
+ Vector3 ppos = prm._position;
+ ppos.X -= rcm.X;
+ ppos.Y -= rcm.Y;
+ ppos.Z -= rcm.Z;
+ // refer inertia to root prim center of mass position
+ d.MassTranslate(ref tmpdmass,
+ ppos.X,
+ ppos.Y,
+ ppos.Z);
+
+ d.MassAdd(ref objdmass, ref tmpdmass); // add to total object inertia
+ }
}
}
}
@@ -1799,19 +1907,60 @@ namespace OpenSim.Region.PhysicsModule.ubOde
// associate root geom with body
d.GeomSetBody(prim_geom, Body);
- d.BodySetPosition(Body, _position.X + objdmass.c.X, _position.Y + objdmass.c.Y, _position.Z + objdmass.c.Z);
+ if(noInertiaOverride)
+ d.BodySetPosition(Body, _position.X + objdmass.c.X, _position.Y + objdmass.c.Y, _position.Z + objdmass.c.Z);
+ else
+ {
+ Vector3 ncm = m_InertiaOverride.CenterOfMass * _orientation;
+ d.BodySetPosition(Body,
+ _position.X + ncm.X,
+ _position.Y + ncm.Y,
+ _position.Z + ncm.Z);
+ }
+
d.GeomSetOffsetWorldPosition(prim_geom, _position.X, _position.Y, _position.Z);
- d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body
- myrot.X = -myrot.X;
- myrot.Y = -myrot.Y;
- myrot.Z = -myrot.Z;
+ if(noInertiaOverride)
+ {
+ d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body
+ myrot.X = -myrot.X;
+ myrot.Y = -myrot.Y;
+ myrot.Z = -myrot.Z;
- d.RfromQ(out mymat, ref myrot);
- d.MassRotate(ref objdmass, ref mymat);
+ d.RfromQ(out mymat, ref myrot);
+ d.MassRotate(ref objdmass, ref mymat);
- d.BodySetMass(Body, ref objdmass);
- _mass = objdmass.mass;
+ d.BodySetMass(Body, ref objdmass);
+ m_mass = objdmass.mass;
+ }
+ else
+ {
+ objdmass.c.X = 0;
+ objdmass.c.Y = 0;
+ objdmass.c.Z = 0;
+
+ objdmass.I.M00 = m_InertiaOverride.Inertia.X;
+ objdmass.I.M11 = m_InertiaOverride.Inertia.Y;
+ objdmass.I.M22 = m_InertiaOverride.Inertia.Z;
+
+ objdmass.mass = m_InertiaOverride.TotalMass;
+
+ if(Math.Abs(m_InertiaOverride.InertiaRotation.W) < 0.999)
+ {
+ d.Matrix3 inertiarotmat = new d.Matrix3();
+ d.Quaternion inertiarot = new d.Quaternion();
+
+ inertiarot.X = m_InertiaOverride.InertiaRotation.X;
+ inertiarot.Y = m_InertiaOverride.InertiaRotation.Y;
+ inertiarot.Z = m_InertiaOverride.InertiaRotation.Z;
+ inertiarot.W = m_InertiaOverride.InertiaRotation.W;
+ d.RfromQ(out inertiarotmat, ref inertiarot);
+ d.MassRotate(ref objdmass, ref inertiarotmat);
+ }
+ d.BodySetMass(Body, ref objdmass);
+
+ m_mass = objdmass.mass;
+ }
// disconnect from world gravity so we can apply buoyancy
d.BodySetGravityMode(Body, false);
@@ -1990,7 +2139,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
SetInStaticSpace(prm);
}
prm.Body = IntPtr.Zero;
- prm._mass = prm.primMass;
+ prm.m_mass = prm.primMass;
prm.m_collisionscore = 0;
}
}
@@ -2004,7 +2153,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
Body = IntPtr.Zero;
}
- _mass = primMass;
+ m_mass = primMass;
m_collisionscore = 0;
}
@@ -2081,7 +2230,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z);
d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body
d.BodySetMass(Body, ref objdmass);
- _mass = objdmass.mass;
+ m_mass = objdmass.mass;
}
private void FixInertia(Vector3 NewPos)
@@ -2145,7 +2294,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z);
d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body
d.BodySetMass(Body, ref objdmass);
- _mass = objdmass.mass;
+ m_mass = objdmass.mass;
}
private void FixInertia(Quaternion newrot)
@@ -2211,7 +2360,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z);
d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body
d.BodySetMass(Body, ref objdmass);
- _mass = objdmass.mass;
+ m_mass = objdmass.mass;
}
@@ -2226,7 +2375,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (primMass > _parent_scene.maximumMassObject)
primMass = _parent_scene.maximumMassObject;
- _mass = primMass; // just in case
+ m_mass = primMass; // just in case
d.MassSetBoxTotal(out primdMass, primMass, 2.0f * m_OBB.X, 2.0f * m_OBB.Y, 2.0f * m_OBB.Z);
@@ -3306,6 +3455,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_useHoverPID = active;
}
+ private void changeInertia(PhysicsInertiaData inertia)
+ {
+ m_InertiaOverride = inertia;
+
+ if (Body != IntPtr.Zero)
+ DestroyBody();
+ MakeBody();
+ }
+
#endregion
public void Move()
@@ -3346,7 +3504,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
float fy = 0;
float fz = 0;
- float m_mass = _mass;
+ float mass = m_mass;
if (m_usePID && m_PIDTau > 0)
{
@@ -3453,9 +3611,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
fz = _parent_scene.gravityz * b;
}
- fx *= m_mass;
- fy *= m_mass;
- fz *= m_mass;
+ fx *= mass;
+ fy *= mass;
+ fz *= mass;
// constant force
fx += m_force.X;
@@ -3941,6 +4099,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
changePIDHoverActive((bool)arg);
break;
+ case changes.SetInertia:
+ changeInertia((PhysicsInertiaData) arg);
+ break;
+
case changes.Null:
donullchange();
break;
@@ -3957,7 +4119,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
_parent_scene.AddChange((PhysicsActor) this, what, arg);
}
-
private struct strVehicleBoolParam
{
public int param;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 4c3f7ee..6c094ee 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -4404,5 +4404,218 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.ScriptSetVolumeDetect(detect != 0);
}
+ ///
+ /// Get inertial data
+ ///
+ ///
+ ///
+ ///
+ /// a LSL list with contents:
+ /// LSL_Float mass, the total mass of a linkset
+ /// LSL_Vector CenterOfMass, center mass relative to root prim
+ /// LSL_Vector Inertia, elements of diagonal of inertia Ixx,Iyy,Izz divided by total mass
+ /// LSL_Vector aux, elements of upper triagle of inertia Ixy (= Iyx), Ixz (= Izx), Iyz(= Izy) divided by total mass
+ ///
+ public LSL_List osGetInertiaData()
+ {
+ LSL_List result = new LSL_List();
+ float TotalMass;
+ Vector3 CenterOfMass;
+ Vector3 Inertia;
+ Vector4 aux;
+
+ SceneObjectGroup sog = m_host.ParentGroup;
+ if(sog== null || sog.IsDeleted)
+ return result;
+
+ sog.GetInertiaData(out TotalMass, out CenterOfMass, out Inertia, out aux );
+ if(TotalMass > 0)
+ {
+ float t = 1.0f/TotalMass;
+ Inertia.X *= t;
+ Inertia.Y *= t;
+ Inertia.Z *= t;
+
+ aux.X *= t;
+ aux.Y *= t;
+ aux.Z *= t;
+ }
+
+ result.Add(new LSL_Float(TotalMass));
+ result.Add(new LSL_Vector(CenterOfMass.X, CenterOfMass.Y, CenterOfMass.Z));
+ result.Add(new LSL_Vector(Inertia.X, Inertia.Y, Inertia.Z));
+ result.Add(new LSL_Vector(aux.X, aux.Y, aux.Z));
+ return result;
+ }
+
+ ///
+ /// set inertial data
+ /// replaces the automatic calculation of mass, center of mass and inertia
+ ///
+ ///
+ /// total mass of linkset
+ /// location of center of mass relative to root prim in local coords
+ /// moment of inertia relative to principal axis and center of mass,Ixx, Iyy, Izz divided by mass
+ /// rotation of the inertia, relative to local axis
+ ///
+ /// the inertia argument is is inertia divided by mass, so corresponds only to the geometric distribution of mass and both can be changed independently.
+ ///
+
+ public void osSetInertia(LSL_Float mass, LSL_Vector centerOfMass, LSL_Vector principalInertiaScaled, LSL_Rotation lslrot)
+ {
+ SceneObjectGroup sog = m_host.ParentGroup;
+ if(sog== null || sog.IsDeleted)
+ return;
+
+ if(mass < 0 || principalInertiaScaled.x < 0 || principalInertiaScaled.y < 0 || principalInertiaScaled.z < 0)
+ return;
+
+ // need more checks
+
+ Vector3 CenterOfMass = new Vector3((float)centerOfMass.x,(float)centerOfMass.y,(float)centerOfMass.z);
+ Vector3 Inertia;
+ float m = (float)mass;
+
+ Inertia.X = m * (float)principalInertiaScaled.x;
+ Inertia.Y = m * (float)principalInertiaScaled.y;
+ Inertia.Z = m * (float)principalInertiaScaled.z;
+
+ Vector4 rot = new Vector4((float)lslrot.x, (float)lslrot.y, (float)lslrot.y, (float)lslrot.s);
+ rot.Normalize();
+
+ sog.SetInertiaData(m, CenterOfMass, Inertia, rot );
+ }
+
+ ///
+ /// set inertial data as a sphere
+ /// replaces the automatic calculation of mass, center of mass and inertia
+ ///
+ ///
+ /// total mass of linkset
+ /// size of the Box
+ /// location of center of mass relative to root prim in local coords
+ /// rotation of the box, and so inertia, relative to local axis
+ ///
+ ///
+ public void osSetInertiaAsBox(LSL_Float mass, LSL_Vector boxSize, LSL_Vector centerOfMass, LSL_Rotation lslrot)
+ {
+ SceneObjectGroup sog = m_host.ParentGroup;
+ if(sog== null || sog.IsDeleted)
+ return;
+
+ if(mass < 0)
+ return;
+
+ // need more checks
+
+ Vector3 CenterOfMass = new Vector3((float)centerOfMass.x,(float)centerOfMass.y,(float)centerOfMass.z);
+ Vector3 Inertia;
+ float lx = (float)boxSize.x;
+ float ly = (float)boxSize.y;
+ float lz = (float)boxSize.z;
+ float m = (float)mass;
+ float t = m / 12.0f;
+
+ Inertia.X = t * (ly*ly + lz*lz);
+ Inertia.Y = t * (lx*lx + lz*lz);
+ Inertia.Z = t * (lx*lx + ly*ly);
+
+ Vector4 rot = new Vector4((float)lslrot.x, (float)lslrot.y, (float)lslrot.z, (float)lslrot.s);
+ rot.Normalize();
+
+ sog.SetInertiaData(m, CenterOfMass, Inertia, rot );
+ }
+
+ ///
+ /// set inertial data as a sphere
+ /// replaces the automatic calculation of mass, center of mass and inertia
+ ///
+ ///
+ /// total mass of linkset
+ /// radius of the sphere
+ /// location of center of mass relative to root prim in local coords
+ ///
+ ///
+ public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, LSL_Vector centerOfMass)
+ {
+ SceneObjectGroup sog = m_host.ParentGroup;
+ if(sog== null || sog.IsDeleted)
+ return;
+
+ if(mass < 0)
+ return;
+
+ // need more checks
+
+ Vector3 CenterOfMass = new Vector3((float)centerOfMass.x,(float)centerOfMass.y,(float)centerOfMass.z);
+ Vector3 Inertia;
+ float r = (float)radius;
+ float m = (float)mass;
+ float t = 0.4f * m * r * r;
+
+ Inertia.X = t;
+ Inertia.Y = t;
+ Inertia.Z = t;
+
+ sog.SetInertiaData(m, CenterOfMass, Inertia, new Vector4(0f, 0f, 0f,1.0f));
+ }
+
+ ///
+ /// set inertial data as a cylinder
+ /// replaces the automatic calculation of mass, center of mass and inertia
+ ///
+ ///
+ /// total mass of linkset
+ /// radius of the cylinder
+ /// lenght of the cylinder
+ /// location of center of mass relative to root prim in local coords
+ /// rotation of the cylinder, and so inertia, relative to local axis
+ ///
+ /// cylinder axis aligned with Z axis. For other orientations provide the rotation.
+ ///
+ public void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, LSL_Vector centerOfMass, LSL_Rotation lslrot)
+ {
+ SceneObjectGroup sog = m_host.ParentGroup;
+ if(sog== null || sog.IsDeleted)
+ return;
+
+ if(mass < 0)
+ return;
+
+ // need more checks
+
+ Vector3 CenterOfMass = new Vector3((float)centerOfMass.x,(float)centerOfMass.y,(float)centerOfMass.z);
+ Vector3 Inertia;
+ float m = (float)mass;
+ float r = (float)radius;
+ r *= r;
+ Inertia.Z = 0.5f * m * r;
+ float t = (float)lenght;
+ t *= t;
+ t += 3.0f * r;
+ t *= 8.333333e-2f * m;
+
+ Inertia.X = t;
+ Inertia.Y = t;
+
+ Vector4 rot = new Vector4((float)lslrot.x, (float)lslrot.y, (float)lslrot.z, (float)lslrot.s);
+ rot.Normalize();
+
+ sog.SetInertiaData(m, CenterOfMass, Inertia, rot);
+ }
+
+ ///
+ /// removes inertial data manual override
+ /// default automatic calculation is used again
+ ///
+ ///
+ public void osClearInertia()
+ {
+ SceneObjectGroup sog = m_host.ParentGroup;
+ if(sog== null || sog.IsDeleted)
+ return;
+
+ sog.SetInertiaData(-1, Vector3.Zero, Vector3.Zero, Vector4.Zero );
+ }
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index bee060a..f76ff7f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -38,6 +38,7 @@ using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
+
namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
{
///
@@ -486,6 +487,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String osRequestURL(LSL_List options);
LSL_String osRequestSecureURL(LSL_List options);
void osCollisionSound(string impact_sound, double impact_volume);
+
void osVolumeDetect(int detect);
+
+ LSL_List osGetInertiaData();
+ void osClearInertia();
+ void osSetInertiaAsBox(LSL_Float mass, vector boxSize, vector centerOfMass, rotation rot);
+ void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, vector centerOfMass);
+ void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, vector centerOfMass,rotation lslrot);
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 6164734..09337e5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -1114,5 +1114,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
m_OSSL_Functions.osVolumeDetect(detect);
}
+
+ public LSL_List osGetInertiaData()
+ {
+ return m_OSSL_Functions.osGetInertiaData();
+ }
+
+ public void osSetInertiaAsBox(LSL_Float mass, vector boxSize, vector centerOfMass, rotation rot)
+ {
+ m_OSSL_Functions.osSetInertiaAsBox(mass, boxSize, centerOfMass, rot);
+ }
+
+ public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, vector centerOfMass)
+ {
+ m_OSSL_Functions.osSetInertiaAsSphere(mass, radius, centerOfMass);
+ }
+
+ public void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, vector centerOfMass,rotation lslrot)
+ {
+ m_OSSL_Functions.osSetInertiaAsCylinder( mass, radius, lenght, centerOfMass, lslrot);
+ }
+
+ public void osClearInertia()
+ {
+ m_OSSL_Functions.osClearInertia();
+ }
+
}
}
--
cgit v1.1
From 24b7903cd02a2d86cdf535f86b093af0a63c99a2 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 31 Mar 2017 21:03:18 +0100
Subject: add missing file. Changes of inertia data of objects running does
not produce correct physical results, namely linear and angular momentum
are not conserved.
---
OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index bed66cc..6279d6a 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -155,6 +155,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
VehicleRotationParam,
VehicleFlags,
SetVehicle,
+ SetInertia,
Null //keep this last used do dim the methods array. does nothing but pulsing the prim
}
@@ -502,7 +503,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.WorldSetGravity(world, gravityx, gravityy, gravityz);
- d.WorldSetLinearDamping(world, 0.002f);
+ d.WorldSetLinearDamping(world, 0.001f);
d.WorldSetAngularDamping(world, 0.002f);
d.WorldSetAngularDampingThreshold(world, 0f);
d.WorldSetLinearDampingThreshold(world, 0f);
--
cgit v1.1
From 443fc60cdf399a49832e787ca58c2644bef7e457 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 1 Apr 2017 17:49:17 +0100
Subject: store the physics inertia override in Mysql and add it to
serializer. run prebuild is required
---
OpenSim/Data/MySQL/MySQLSimulationData.cs | 17 +-
.../Data/MySQL/Resources/RegionStore.migrations | 6 +
OpenSim/Framework/PhysicsInertia.cs | 262 +++++++++++++++++++++
.../Region/Framework/Scenes/SceneObjectGroup.cs | 20 +-
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 21 +-
.../Scenes/Serialization/SceneObjectSerializer.cs | 23 +-
.../PhysicsModules/SharedBase/PhysicsActor.cs | 22 --
OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 3 -
8 files changed, 336 insertions(+), 38 deletions(-)
create mode 100644 OpenSim/Framework/PhysicsInertia.cs
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 8278c0e..97a433f 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -187,7 +187,7 @@ namespace OpenSim.Data.MySQL
"LinkNumber, MediaURL, KeyframeMotion, AttachedPosX, " +
"AttachedPosY, AttachedPosZ, " +
"PhysicsShapeType, Density, GravityModifier, " +
- "Friction, Restitution, Vehicle, DynAttrs, " +
+ "Friction, Restitution, Vehicle, PhysInertia, DynAttrs, " +
"RotationAxisLocks" +
") values (" + "?UUID, " +
"?CreationDate, ?Name, ?Text, " +
@@ -224,7 +224,7 @@ namespace OpenSim.Data.MySQL
"?LinkNumber, ?MediaURL, ?KeyframeMotion, ?AttachedPosX, " +
"?AttachedPosY, ?AttachedPosZ, " +
"?PhysicsShapeType, ?Density, ?GravityModifier, " +
- "?Friction, ?Restitution, ?Vehicle, ?DynAttrs," +
+ "?Friction, ?Restitution, ?Vehicle, ?PhysInertia, ?DynAttrs," +
"?RotationAxisLocks)";
FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
@@ -1452,6 +1452,14 @@ namespace OpenSim.Data.MySQL
prim.VehicleParams = vehicle;
}
+ PhysicsInertiaData pdata;
+ if (row["PhysInertia"].ToString() != String.Empty)
+ {
+ pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString());
+ if (pdata != null)
+ prim.PhysicsInertia = pdata;
+ }
+
return prim;
}
@@ -1810,6 +1818,11 @@ namespace OpenSim.Data.MySQL
else
cmd.Parameters.AddWithValue("KeyframeMotion", new Byte[0]);
+ if (prim.PhysicsInertia != null)
+ cmd.Parameters.AddWithValue("PhysInertia", prim.PhysicsInertia.ToXml2());
+ else
+ cmd.Parameters.AddWithValue("PhysInertia", String.Empty);
+
if (prim.VehicleParams != null)
cmd.Parameters.AddWithValue("Vehicle", prim.VehicleParams.ToXml2());
else
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index c63cc95..0577392 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -461,3 +461,9 @@ BEGIN;
ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL;
COMMIT;
+
+:VERSION 57 #----- Add physics inertia data
+
+BEGIN;
+ALTER TABLE `prims` ADD COLUMN `PhysInertia` TEXT default NULL;
+COMMIT;
diff --git a/OpenSim/Framework/PhysicsInertia.cs b/OpenSim/Framework/PhysicsInertia.cs
new file mode 100644
index 0000000..af70634
--- /dev/null
+++ b/OpenSim/Framework/PhysicsInertia.cs
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections.Generic;
+using OpenMetaverse;
+using System.Text;
+using System.IO;
+using System.Xml;
+
+namespace OpenSim.Framework
+{
+ public class PhysicsInertiaData
+ {
+ public float TotalMass; // the total mass of a linkset
+ public Vector3 CenterOfMass; // the center of mass position relative to root part position
+ public Vector3 Inertia; // (Ixx, Iyy, Izz) moment of inertia relative to center of mass and principal axis in local coords
+ public Vector4 InertiaRotation; // if principal axis don't match local axis, the principal axis rotation
+ // or the upper triangle of the inertia tensor
+ // Ixy (= Iyx), Ixz (= Izx), Iyz (= Izy))
+
+ public PhysicsInertiaData()
+ {
+ }
+
+ public PhysicsInertiaData(PhysicsInertiaData source)
+ {
+ TotalMass = source.TotalMass;
+ CenterOfMass = source.CenterOfMass;
+ Inertia = source.Inertia;
+ InertiaRotation = source.InertiaRotation;
+ }
+
+ private XmlTextWriter writer;
+
+ private void XWint(string name, int i)
+ {
+ writer.WriteElementString(name, i.ToString());
+ }
+
+ private void XWfloat(string name, float f)
+ {
+ writer.WriteElementString(name, f.ToString(Utils.EnUsCulture));
+ }
+
+ private void XWVector(string name, Vector3 vec)
+ {
+ writer.WriteStartElement(name);
+ writer.WriteElementString("X", vec.X.ToString(Utils.EnUsCulture));
+ writer.WriteElementString("Y", vec.Y.ToString(Utils.EnUsCulture));
+ writer.WriteElementString("Z", vec.Z.ToString(Utils.EnUsCulture));
+ writer.WriteEndElement();
+ }
+
+ private void XWVector4(string name, Vector4 quat)
+ {
+ writer.WriteStartElement(name);
+ writer.WriteElementString("X", quat.X.ToString(Utils.EnUsCulture));
+ writer.WriteElementString("Y", quat.Y.ToString(Utils.EnUsCulture));
+ writer.WriteElementString("Z", quat.Z.ToString(Utils.EnUsCulture));
+ writer.WriteElementString("W", quat.W.ToString(Utils.EnUsCulture));
+ writer.WriteEndElement();
+ }
+
+ public void ToXml2(XmlTextWriter twriter)
+ {
+ writer = twriter;
+ writer.WriteStartElement("PhysicsInertia");
+
+ XWfloat("MASS", TotalMass);
+ XWVector("CM", CenterOfMass);
+ XWVector("INERTIA", Inertia);
+ XWVector4("IROT", InertiaRotation);
+
+ writer.WriteEndElement();
+ writer = null;
+ }
+
+ XmlReader reader;
+
+ private int XRint()
+ {
+ return reader.ReadElementContentAsInt();
+ }
+
+ private float XRfloat()
+ {
+ return reader.ReadElementContentAsFloat();
+ }
+
+ public Vector3 XRvector()
+ {
+ Vector3 vec;
+ reader.ReadStartElement();
+ vec.X = reader.ReadElementContentAsFloat();
+ vec.Y = reader.ReadElementContentAsFloat();
+ vec.Z = reader.ReadElementContentAsFloat();
+ reader.ReadEndElement();
+ return vec;
+ }
+
+ public Vector4 XRVector4()
+ {
+ Vector4 q;
+ reader.ReadStartElement();
+ q.X = reader.ReadElementContentAsFloat();
+ q.Y = reader.ReadElementContentAsFloat();
+ q.Z = reader.ReadElementContentAsFloat();
+ q.W = reader.ReadElementContentAsFloat();
+ reader.ReadEndElement();
+ return q;
+ }
+
+ public static bool EReadProcessors(
+ Dictionary processors,
+ XmlReader xtr)
+ {
+ bool errors = false;
+
+ string nodeName = string.Empty;
+ while (xtr.NodeType != XmlNodeType.EndElement)
+ {
+ nodeName = xtr.Name;
+
+ Action p = null;
+ if (processors.TryGetValue(xtr.Name, out p))
+ {
+ try
+ {
+ p();
+ }
+ catch
+ {
+ errors = true;
+ if (xtr.NodeType == XmlNodeType.EndElement)
+ xtr.Read();
+ }
+ }
+ else
+ {
+ xtr.ReadOuterXml(); // ignore
+ }
+ }
+
+ return errors;
+ }
+
+ public string ToXml2()
+ {
+ using (StringWriter sw = new StringWriter())
+ {
+ using (XmlTextWriter xwriter = new XmlTextWriter(sw))
+ {
+ ToXml2(xwriter);
+ }
+
+ return sw.ToString();
+ }
+ }
+
+ public static PhysicsInertiaData FromXml2(string text)
+ {
+ if (text == String.Empty)
+ return null;
+
+ UTF8Encoding enc = new UTF8Encoding();
+ MemoryStream ms = new MemoryStream(enc.GetBytes(text));
+ XmlTextReader xreader = new XmlTextReader(ms);
+
+ PhysicsInertiaData v = new PhysicsInertiaData();
+ bool error;
+
+ v.FromXml2(xreader, out error);
+
+ xreader.Close();
+
+ if (error)
+ return null;
+
+ return v;
+ }
+
+ public static PhysicsInertiaData FromXml2(XmlReader reader)
+ {
+ PhysicsInertiaData data = new PhysicsInertiaData();
+
+ bool errors = false;
+
+ data.FromXml2(reader, out errors);
+ if (errors)
+ return null;
+
+ return data;
+ }
+
+ private void FromXml2(XmlReader _reader, out bool errors)
+ {
+ errors = false;
+ reader = _reader;
+
+ Dictionary m_XmlProcessors = new Dictionary();
+
+ m_XmlProcessors.Add("MASS", ProcessXR_Mass);
+ m_XmlProcessors.Add("CM", ProcessXR_CM);
+ m_XmlProcessors.Add("INERTIA", ProcessXR_Inertia);
+ m_XmlProcessors.Add("IROT", ProcessXR_InertiaRotation);
+
+ reader.ReadStartElement("PhysicsInertia", String.Empty);
+
+ errors = EReadProcessors(
+ m_XmlProcessors,
+ reader);
+
+ reader.ReadEndElement();
+ reader = null;
+ }
+
+ private void ProcessXR_Mass()
+ {
+ TotalMass = XRfloat();
+ }
+
+ private void ProcessXR_CM()
+ {
+ CenterOfMass = XRvector();
+ }
+
+ private void ProcessXR_Inertia()
+ {
+ Inertia = XRvector();
+ }
+
+ private void ProcessXR_InertiaRotation()
+ {
+ InertiaRotation = XRVector4();
+ }
+ }
+}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 77658ef..719a5dd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -5037,20 +5037,22 @@ namespace OpenSim.Region.Framework.Scenes
public void SetInertiaData(float TotalMass, Vector3 CenterOfMass, Vector3 Inertia, Vector4 aux )
{
- PhysicsActor pa = RootPart.PhysActor;
+ PhysicsInertiaData inertia = new PhysicsInertiaData();
+ inertia.TotalMass = TotalMass;
+ inertia.CenterOfMass = CenterOfMass;
+ inertia.Inertia = Inertia;
+ inertia.InertiaRotation = aux;
+
+ if(TotalMass < 0)
+ RootPart.PhysicsInertia = null;
+ else
+ RootPart.PhysicsInertia = new PhysicsInertiaData(inertia);
+ PhysicsActor pa = RootPart.PhysActor;
if(pa !=null)
- {
- PhysicsInertiaData inertia = new PhysicsInertiaData();
- inertia.TotalMass = TotalMass;
- inertia.CenterOfMass = CenterOfMass;
- inertia.Inertia = Inertia;
- inertia.InertiaRotation = aux;
pa.SetInertiaData(inertia);
- }
}
-
///
/// Set the user group to which this scene object belongs.
///
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index bf0e31b..46b7b86 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -406,6 +406,8 @@ namespace OpenSim.Region.Framework.Scenes
private SOPVehicle m_vehicleParams = null;
+ private PhysicsInertiaData m_physicsInertia;
+
public KeyframeMotion KeyframeMotion
{
get; set;
@@ -3548,6 +3550,18 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
Force = force;
}
+ public PhysicsInertiaData PhysicsInertia
+ {
+ get
+ {
+ return m_physicsInertia;
+ }
+ set
+ {
+ m_physicsInertia = value;
+ }
+ }
+
public SOPVehicle VehicleParams
{
get
@@ -4748,8 +4762,13 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
if (VolumeDetectActive) // change if not the default only
pa.SetVolumeDetect(1);
+
+ bool isroot = (m_localId == ParentGroup.RootPart.LocalId);
+
+ if(isroot && m_physicsInertia != null)
+ pa.SetInertiaData(m_physicsInertia);
- if (m_vehicleParams != null && m_localId == ParentGroup.RootPart.LocalId)
+ if (isroot && m_vehicleParams != null )
{
m_vehicleParams.SetVehicle(pa);
if(isPhysical && !isPhantom && m_vehicleParams.CameraDecoupled)
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index a12a401..87d1ace 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -453,9 +453,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("Torque", ProcessTorque);
m_SOPXmlProcessors.Add("VolumeDetectActive", ProcessVolumeDetectActive);
-
m_SOPXmlProcessors.Add("Vehicle", ProcessVehicle);
+ m_SOPXmlProcessors.Add("PhysicsInertia", ProcessPhysicsInertia);
+
m_SOPXmlProcessors.Add("RotationAxisLocks", ProcessRotationAxisLocks);
m_SOPXmlProcessors.Add("PhysicsShapeType", ProcessPhysicsShapeType);
m_SOPXmlProcessors.Add("Density", ProcessDensity);
@@ -781,6 +782,23 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
}
}
+ private static void ProcessPhysicsInertia(SceneObjectPart obj, XmlReader reader)
+ {
+ PhysicsInertiaData pdata = PhysicsInertiaData.FromXml2(reader);
+
+ if (pdata == null)
+ {
+ obj.PhysicsInertia = null;
+ m_log.DebugFormat(
+ "[SceneObjectSerializer]: Parsing PhysicsInertiaData for object part {0} {1} encountered errors. Please see earlier log entries.",
+ obj.Name, obj.UUID);
+ }
+ else
+ {
+ obj.PhysicsInertia = pdata;
+ }
+ }
+
private static void ProcessShape(SceneObjectPart obj, XmlReader reader)
{
List errorNodeNames;
@@ -1498,6 +1516,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
if (sop.VehicleParams != null)
sop.VehicleParams.ToXml2(writer);
+ if (sop.PhysicsInertia != null)
+ sop.PhysicsInertia.ToXml2(writer);
+
if(sop.RotationAxisLocks != 0)
writer.WriteElementString("RotationAxisLocks", sop.RotationAxisLocks.ToString().ToLower());
writer.WriteElementString("PhysicsShapeType", sop.PhysicsShapeType.ToString().ToLower());
diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
index ad9b28f..d23d9c1 100644
--- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
+++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
@@ -55,28 +55,6 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
Absolute
}
- public class PhysicsInertiaData
- {
- public float TotalMass; // the total mass of a linkset
- public Vector3 CenterOfMass; // the center of mass position relative to root part position
- public Vector3 Inertia; // (Ixx, Iyy, Izz) moment of inertia relative to center of mass and principal axis in local coords
- public Vector4 InertiaRotation; // if principal axis don't match local axis, the principal axis rotation
- // or the upper triangle of the inertia tensor
- // Ixy (= Iyx), Ixz (= Izx), Iyz (= Izy))
-
- public PhysicsInertiaData()
- {
- }
-
- public PhysicsInertiaData(PhysicsInertiaData source)
- {
- TotalMass = source.TotalMass;
- CenterOfMass = source.CenterOfMass;
- Inertia = source.Inertia;
- InertiaRotation = source.InertiaRotation;
- }
- }
-
public struct CameraData
{
public Quaternion CameraRotation;
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index d560b41..f784990 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -568,9 +568,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
get
{
- if(!childPrim && m_fakeInertiaOverride != null)
- return m_fakeInertiaOverride.CenterOfMass;
-
lock (_parent_scene.OdeLock)
{
d.AllocateODEDataForThread(0);
--
cgit v1.1
From 44993550a85f411e5ea88a889fb652744e2d3d1b Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 1 Apr 2017 18:15:47 +0100
Subject: store the physics inertia override in SQlite
---
OpenSim/Data/MySQL/MySQLSimulationData.cs | 7 ++-----
OpenSim/Data/SQLite/Resources/RegionStore.migrations | 6 ++++++
OpenSim/Data/SQLite/SQLiteSimulationData.cs | 11 +++++++++++
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 97a433f..5740b91 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -1452,13 +1452,10 @@ namespace OpenSim.Data.MySQL
prim.VehicleParams = vehicle;
}
- PhysicsInertiaData pdata;
+ PhysicsInertiaData pdata = null;
if (row["PhysInertia"].ToString() != String.Empty)
- {
pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString());
- if (pdata != null)
- prim.PhysicsInertia = pdata;
- }
+ prim.PhysicsInertia = pdata;
return prim;
}
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
index eef14d6..fb154cf 100644
--- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
@@ -371,3 +371,9 @@ BEGIN;
ALTER TABLE `prims` ADD COLUMN `RezzerID` char(36) DEFAULT NULL;
COMMIT;
+
+:VERSION 36 #----- Add physics inertia data
+
+BEGIN;
+ALTER TABLE `prims` ADD COLUMN `PhysInertia` TEXT default NULL;
+COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index eec386f..19880de 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -1843,6 +1843,12 @@ namespace OpenSim.Data.SQLite
if (vehicle != null)
prim.VehicleParams = vehicle;
}
+
+ PhysicsInertiaData pdata = null;
+ if (!(row["PhysInertia"] is DBNull) && row["PhysInertia"].ToString() != String.Empty)
+ pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString());
+ prim.PhysicsInertia = pdata;
+
return prim;
}
@@ -2266,6 +2272,11 @@ namespace OpenSim.Data.SQLite
else
row["Vehicle"] = String.Empty;
+ if (prim.PhysicsInertia != null)
+ row["PhysInertia"] = prim.PhysicsInertia.ToXml2();
+ else
+ row["PhysInertia"] = String.Empty;
+
}
///
--
cgit v1.1
From eb11505d19be8c2b22776d927ac5b836bd5493c3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 3 Apr 2017 16:10:05 +0100
Subject: add bool CanObjectEnterWithScripts(SceneObjectGroup sog, ILandObject
land) permissions check
---
.../World/Permissions/PermissionsModule.cs | 52 ++++++++++++++++++++++
.../Region/Framework/Scenes/Scene.Permissions.cs | 17 +++++++
.../PrimLimitsModule/PrimLimitsModule.cs | 22 +++++++++
3 files changed, 91 insertions(+)
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index ab8fb51..8eee864 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -286,6 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
scenePermissions.OnRezObject += CanRezObject;
scenePermissions.OnObjectEntry += CanObjectEntry;
+ scenePermissions.OnObjectEnterWithScripts += OnObjectEnterWithScripts;
scenePermissions.OnDuplicateObject += CanDuplicateObject;
scenePermissions.OnDeleteObjectByIDs += CanDeleteObjectByIDs;
@@ -381,6 +382,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
scenePermissions.OnRezObject -= CanRezObject;
scenePermissions.OnObjectEntry -= CanObjectEntry;
+ scenePermissions.OnObjectEnterWithScripts -= OnObjectEnterWithScripts;
+
scenePermissions.OnReturnObjects -= CanReturnObjects;
scenePermissions.OnDuplicateObject -= CanDuplicateObject;
@@ -1627,6 +1630,55 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false;
}
+ private bool OnObjectEnterWithScripts(SceneObjectGroup sog, ILandObject parcel)
+ {
+ DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
+
+ if(sog == null || sog.IsDeleted)
+ return false;
+
+ if (m_bypassPermissions)
+ return m_bypassPermissionsValue;
+
+ if (parcel == null)
+ return true;
+
+ int checkflags = ((int)ParcelFlags.AllowAPrimitiveEntry);
+ bool scripts = (sog.ScriptCount() > 0);
+ if(scripts)
+ checkflags |= ((int)ParcelFlags.AllowOtherScripts);
+
+ if ((parcel.LandData.Flags & checkflags) == checkflags)
+ return true;
+
+ UUID userID = sog.OwnerID;
+ LandData landdata = parcel.LandData;
+
+ if (landdata.OwnerID == userID)
+ return true;
+
+ if (IsAdministrator(userID))
+ return true;
+
+ UUID landGroupID = landdata.GroupID;
+ if (landGroupID != UUID.Zero)
+ {
+ checkflags = (int)ParcelFlags.AllowGroupObjectEntry;
+ if(scripts)
+ checkflags |= ((int)ParcelFlags.AllowGroupScripts);
+
+ if ((parcel.LandData.Flags & checkflags) == checkflags)
+ return IsGroupMember(landGroupID, userID, 0);
+
+ if (landdata.IsGroupOwned && IsGroupMember(landGroupID, userID, (ulong)GroupPowers.AllowRez))
+ return true;
+ }
+
+ //Otherwise, false!
+ return false;
+ }
+
+
private bool CanReturnObjects(ILandObject land, ScenePresence sp, List objects)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index 7d69a9b..c55a7a6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -56,6 +56,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID);
public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp);
public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint);
+ public delegate bool ObjectEnterWithScriptsHandler(SceneObjectGroup sog, ILandObject land);
public delegate bool ReturnObjectsHandler(ILandObject land, ScenePresence sp, List objects);
public delegate bool InstantMessageHandler(UUID user, UUID target);
public delegate bool InventoryTransferHandler(UUID user, UUID target);
@@ -135,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes
public event EditObjectInventoryHandler OnEditObjectInventory;
public event MoveObjectHandler OnMoveObject;
public event ObjectEntryHandler OnObjectEntry;
+ public event ObjectEnterWithScriptsHandler OnObjectEnterWithScripts;
public event ReturnObjectsHandler OnReturnObjects;
public event InstantMessageHandler OnInstantMessage;
public event InventoryTransferHandler OnInventoryTransfer;
@@ -565,6 +567,21 @@ namespace OpenSim.Region.Framework.Scenes
return true;
}
+ public bool CanObjectEnterWithScripts(SceneObjectGroup sog, ILandObject land)
+ {
+ ObjectEnterWithScriptsHandler handler = OnObjectEnterWithScripts;
+ if (handler != null)
+ {
+ Delegate[] list = handler.GetInvocationList();
+ foreach (ObjectEnterWithScriptsHandler h in list)
+ {
+ if (h(sog, land) == false)
+ return false;
+ }
+ }
+ return true;
+ }
+
#endregion
#region RETURN OBJECT
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
index af32d05..61b6d68 100644
--- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
+++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
@@ -83,6 +83,7 @@ namespace OpenSim.Region.OptionalModules
m_scene = scene;
scene.Permissions.OnRezObject += CanRezObject;
scene.Permissions.OnObjectEntry += CanObjectEnter;
+ scene.Permissions.OnObjectEnterWithScripts += CanObjectEnterWithScripts;
scene.Permissions.OnDuplicateObject += CanDuplicateObject;
m_log.DebugFormat("[PRIM LIMITS]: Region {0} added", scene.RegionInfo.RegionName);
@@ -95,6 +96,7 @@ namespace OpenSim.Region.OptionalModules
m_scene.Permissions.OnRezObject -= CanRezObject;
m_scene.Permissions.OnObjectEntry -= CanObjectEnter;
+ scene.Permissions.OnObjectEnterWithScripts -= CanObjectEnterWithScripts;
m_scene.Permissions.OnDuplicateObject -= CanDuplicateObject;
}
@@ -173,6 +175,26 @@ namespace OpenSim.Region.OptionalModules
return true;
}
+ private bool CanObjectEnterWithScripts(SceneObjectGroup sog, ILandObject newParcel)
+ {
+ if (sog == null)
+ return false;
+
+ if (newParcel == null)
+ return true;
+
+ int objectCount = sog.PrimCount;
+
+ // TODO: Add Special Case here for temporary prims
+
+ string response = DoCommonChecks(objectCount, sog.OwnerID, newParcel);
+
+ if (response != null)
+ return false;
+
+ return true;
+ }
+
private string DoCommonChecks(int objectCount, UUID ownerID, ILandObject lo)
{
string response = null;
--
cgit v1.1
From 2bb5e985740b7c6aa75cd31aa057d39d56f024b6 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 3 Apr 2017 17:19:28 +0100
Subject: add EXPERIMENTAL osObjectTeleport(LSL_Key objectUUID, LSL_Vector
targetPos, LSL_Rotation rotation, LSL_Integer stop)
---
OpenSim/Region/Framework/Scenes/Scene.cs | 31 ++++++--
.../Region/Framework/Scenes/SceneObjectGroup.cs | 85 ++++++++++++++++++++++
.../Shared/Api/Implementation/OSSL_Api.cs | 46 ++++++++++++
.../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 +
.../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 4 +
5 files changed, 161 insertions(+), 7 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index c5b082c..3b9f551 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -808,6 +808,8 @@ namespace OpenSim.Region.Framework.Scenes
private float m_minReprioritizationDistance = 32f;
public bool ObjectsCullingByDistance = false;
+ private ExpiringCache TeleportTargetsCoolDown = new ExpiringCache();
+
public AgentCircuitManager AuthenticateHandler
{
get { return m_authenticateHandler; }
@@ -2983,15 +2985,14 @@ namespace OpenSim.Region.Framework.Scenes
// Return 'true' if position inside region.
public bool PositionIsInCurrentRegion(Vector3 pos)
{
- bool ret = false;
- int xx = (int)Math.Floor(pos.X);
- int yy = (int)Math.Floor(pos.Y);
- if (xx < 0 || yy < 0)
+ int xx = (int)pos.X;
+ if (xx < 0 || xx >= RegionInfo.RegionSizeX)
return false;
- if (xx < RegionInfo.RegionSizeX && yy < RegionInfo.RegionSizeY )
- ret = true;
- return ret;
+ int yy = (int)pos.Y;
+ if (yy < 0 || yy >= RegionInfo.RegionSizeX)
+ return false;
+ return true;
}
///
@@ -6526,5 +6527,21 @@ Environment.Exit(1);
m_eventManager.TriggerExtraSettingChanged(this, name, String.Empty);
}
+
+ public bool InTeleportTargetsCoolDown(UUID sourceID, UUID targetID, double timeout)
+ {
+ lock(TeleportTargetsCoolDown)
+ {
+ UUID lastSource = UUID.Zero;
+ TeleportTargetsCoolDown.TryGetValue(targetID, out lastSource);
+ if(lastSource == UUID.Zero)
+ {
+ TeleportTargetsCoolDown.Add(targetID, sourceID, timeout);
+ return false;
+ }
+ TeleportTargetsCoolDown.AddOrUpdate(targetID, sourceID, timeout);
+ return lastSource == sourceID;
+ }
+ }
}
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 719a5dd..402e5f7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -853,6 +853,91 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
}
*/
+ public void ObjectTeleport(UUID sourceID, Vector3 targetPosition, Quaternion rotation, bool stop)
+ {
+ if(inTransit || IsDeleted || IsAttachmentCheckFull() || IsSelected || Scene == null)
+ return;
+
+ inTransit = true;
+
+ PhysicsActor pa = RootPart.PhysActor;
+ if(pa == null || RootPart.KeyframeMotion != null /*|| m_sittingAvatars.Count == 0*/)
+ {
+ inTransit = false;
+ return;
+ }
+
+ if(Scene.PositionIsInCurrentRegion(targetPosition))
+ {
+ if(Scene.InTeleportTargetsCoolDown(UUID, sourceID, 1.0))
+ {
+ inTransit = false;
+ return;
+ }
+
+ Vector3 curPos = AbsolutePosition;
+ ILandObject curLand = Scene.LandChannel.GetLandObject(curPos.X, curPos.Y);
+ float posX = targetPosition.X;
+ float posY = targetPosition.Y;
+ ILandObject land = Scene.LandChannel.GetLandObject(posX, posY);
+ if(land != null && land != curLand)
+ {
+ if(!Scene.Permissions.CanObjectEnterWithScripts(this, land))
+ {
+ inTransit = false;
+ return;
+ }
+
+ UUID agentID;
+ foreach (ScenePresence av in m_sittingAvatars)
+ {
+ agentID = av.UUID;
+ if(land.IsRestrictedFromLand(agentID) || land.IsBannedFromLand(agentID))
+ {
+ inTransit = false;
+ return;
+ }
+ }
+ }
+
+ if(stop)
+ RootPart.Stop();
+ else
+ {
+ rotation.Normalize();
+ if(Math.Abs(rotation.W) < 0.999)
+ {
+ Quaternion rot = RootPart.RotationOffset;
+ Vector3 vel = RootPart.Velocity;
+ Vector3 avel = RootPart.AngularVelocity;
+ Vector3 acc = RootPart.Acceleration;
+
+ rot *= rotation;
+ vel *= rotation;
+ avel *= rotation;
+ acc *= rotation;
+
+ RootPart.RotationOffset = rot;
+ RootPart.Velocity = vel;
+ RootPart.AngularVelocity = avel;
+ RootPart.Acceleration = acc;
+ }
+ }
+
+ Vector3 s = RootPart.Scale * RootPart.RotationOffset;
+ float h = Scene.GetGroundHeight(posX, posY) + 0.5f * (float)Math.Abs(s.Z) + 0.01f;
+ if(targetPosition.Z < h)
+ targetPosition.Z = h;
+
+ inTransit = false;
+ AbsolutePosition = targetPosition;
+ RootPart.ScheduleTerseUpdate();
+ return;
+ }
+
+ inTransit = false;
+ }
+
public override Vector3 Velocity
{
get { return RootPart.Velocity; }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 6c094ee..ddf5078 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -4418,6 +4418,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public LSL_List osGetInertiaData()
{
+ m_host.AddScriptLPS(1);
+
LSL_List result = new LSL_List();
float TotalMass;
Vector3 CenterOfMass;
@@ -4463,6 +4465,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osSetInertia(LSL_Float mass, LSL_Vector centerOfMass, LSL_Vector principalInertiaScaled, LSL_Rotation lslrot)
{
+ m_host.AddScriptLPS(1);
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
@@ -4499,6 +4502,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osSetInertiaAsBox(LSL_Float mass, LSL_Vector boxSize, LSL_Vector centerOfMass, LSL_Rotation lslrot)
{
+ m_host.AddScriptLPS(1);
+
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
@@ -4538,6 +4543,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, LSL_Vector centerOfMass)
{
+ m_host.AddScriptLPS(1);
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
@@ -4575,6 +4581,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, LSL_Vector centerOfMass, LSL_Rotation lslrot)
{
+ m_host.AddScriptLPS(1);
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
@@ -4611,11 +4618,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osClearInertia()
{
+ m_host.AddScriptLPS(1);
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
sog.SetInertiaData(-1, Vector3.Zero, Vector3.Zero, Vector4.Zero );
}
+
+ ///
+ /// teleports a object (full linkset)
+ ///
+ /// the id of the linkset to teleport
+ /// target position
+ /// a rotation to apply
+ /// if TRUE (!=0) stop at destination
+ ///
+ /// only does teleport local to region
+ /// object owner must have rights to run scripts on target location
+ /// object owner must have rights to enter ojects on target location
+ /// target location parcel must have enought free prims capacity for the linkset prims
+ /// all avatars siting on the object must have access to target location
+ /// has a cool down time. retries before expire reset it
+ /// fail conditions are silent ignored
+ ///
+ public void osObjectTeleport(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer stop)
+ {
+ CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent");
+ m_host.AddScriptLPS(1);
+
+ UUID objUUID;
+ if (!UUID.TryParse(objectUUID, out objUUID))
+ {
+ OSSLShoutError("osObjectTeleport() invalid object Key");
+ return;
+ }
+
+ SceneObjectGroup sog = World.GetSceneObjectGroup(objUUID);
+ if(sog== null || sog.IsDeleted)
+ return;
+
+ UUID myid = m_host.ParentGroup.UUID;
+
+ sog.ObjectTeleport(myid, targetPos, rotation, stop != 0);
+ // a delay here may break vehicles
+ }
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index f76ff7f..4722fed 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -495,5 +495,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetInertiaAsBox(LSL_Float mass, vector boxSize, vector centerOfMass, rotation rot);
void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, vector centerOfMass);
void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, vector centerOfMass,rotation lslrot);
+
+ void osObjectTeleport(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer stop);
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 09337e5..37e7a17 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -1140,5 +1140,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osClearInertia();
}
+ public void osObjectTeleport(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer stop)
+ {
+ m_OSSL_Functions.osObjectTeleport(objectUUID, targetPos, targetrotation, stop);
+ }
}
}
--
cgit v1.1
From 1264069b412822cd50a080576460d5dd8c165017 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 3 Apr 2017 17:29:02 +0100
Subject: fix typo
---
OpenSim/Region/Framework/Scenes/Scene.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3b9f551..0fb62a4 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2990,8 +2990,9 @@ namespace OpenSim.Region.Framework.Scenes
return false;
int yy = (int)pos.Y;
- if (yy < 0 || yy >= RegionInfo.RegionSizeX)
+ if (yy < 0 || yy >= RegionInfo.RegionSizeY)
return false;
+
return true;
}
--
cgit v1.1
From 4bb27917f4c4caf8eece794b80d5cf89e5e1398c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 3 Apr 2017 18:09:48 +0100
Subject: oops
---
OpenSim/Region/Framework/Scenes/Scene.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0fb62a4..715ae5c 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2985,12 +2985,12 @@ namespace OpenSim.Region.Framework.Scenes
// Return 'true' if position inside region.
public bool PositionIsInCurrentRegion(Vector3 pos)
{
- int xx = (int)pos.X;
- if (xx < 0 || xx >= RegionInfo.RegionSizeX)
+ float t = pos.X;
+ if (t < 0 || t >= RegionInfo.RegionSizeX)
return false;
- int yy = (int)pos.Y;
- if (yy < 0 || yy >= RegionInfo.RegionSizeY)
+ t = pos.Y;
+ if (t < 0 || t >= RegionInfo.RegionSizeY)
return false;
return true;
--
cgit v1.1
From c6150c206618fe50a45bd8673e010f862147daba Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 4 Apr 2017 00:30:19 +0100
Subject: mantis 8140: fix objectTeleport rotation if stop TRUE
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 402e5f7..24cdc7a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -900,11 +900,19 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ rotation.Normalize();
if(stop)
+ {
RootPart.Stop();
+ if(Math.Abs(rotation.W) < 0.999)
+ {
+ Quaternion rot = RootPart.RotationOffset;
+ rot *= rotation;
+ RootPart.RotationOffset = rot;
+ }
+ }
else
{
- rotation.Normalize();
if(Math.Abs(rotation.W) < 0.999)
{
Quaternion rot = RootPart.RotationOffset;
--
cgit v1.1
From 056b765fbc17b2702ca35c9211144db881f7b9e3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 4 Apr 2017 12:38:23 +0100
Subject: mantis 8130: improve keyframes motion
---
OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 133 ++++++++++------------
1 file changed, 63 insertions(+), 70 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
index e4aa196..d81d8a2 100644
--- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
+++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
@@ -495,6 +495,7 @@ namespace OpenSim.Region.Framework.Scenes
m_group.RootPart.Velocity = Vector3.Zero;
m_group.RootPart.AngularVelocity = Vector3.Zero;
+ m_skippedUpdates = 1000;
m_group.SendGroupRootTerseUpdate();
// m_group.RootPart.ScheduleTerseUpdate();
}
@@ -517,6 +518,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
if (m_running && !m_waitingCrossing)
StartTimer();
+ m_skippedUpdates = 1000;
}
}
@@ -643,10 +645,15 @@ namespace OpenSim.Region.Framework.Scenes
m_group.RootPart.Velocity = Vector3.Zero;
m_group.RootPart.AngularVelocity = Vector3.Zero;
m_group.SendGroupRootTerseUpdate();
- // m_group.RootPart.ScheduleTerseUpdate();
+
m_frames.Clear();
}
+ Vector3 m_lastPosUpdate;
+ Quaternion m_lastRotationUpdate;
+ Vector3 m_currentVel;
+ int m_skippedUpdates;
+
private void DoOnTimer(double tickDuration)
{
if (m_skipLoops > 0)
@@ -665,6 +672,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_group.RootPart.Velocity != Vector3.Zero)
{
m_group.RootPart.Velocity = Vector3.Zero;
+ m_skippedUpdates = 1000;
m_group.SendGroupRootTerseUpdate();
}
return;
@@ -677,7 +685,9 @@ namespace OpenSim.Region.Framework.Scenes
// retry to set the position that evtually caused the outbound
// if still outside region this will call startCrossing below
m_isCrossing = false;
+ m_skippedUpdates = 1000;
m_group.AbsolutePosition = m_nextPosition;
+
if (!m_isCrossing)
{
StopTimer();
@@ -700,10 +710,12 @@ namespace OpenSim.Region.Framework.Scenes
}
m_currentFrame = m_frames[0];
- m_currentFrame.TimeMS += (int)tickDuration;
}
- //force a update on a keyframe transition
m_nextPosition = m_group.AbsolutePosition;
+ m_currentVel = (Vector3)m_currentFrame.Position - m_nextPosition;
+ m_currentVel /= (m_currentFrame.TimeMS * 0.001f);
+
+ m_currentFrame.TimeMS += (int)tickDuration;
update = true;
}
@@ -712,7 +724,7 @@ namespace OpenSim.Region.Framework.Scenes
// Do the frame processing
double remainingSteps = (double)m_currentFrame.TimeMS / tickDuration;
- if (remainingSteps <= 0.0)
+ if (remainingSteps <= 1.0)
{
m_group.RootPart.Velocity = Vector3.Zero;
m_group.RootPart.AngularVelocity = Vector3.Zero;
@@ -720,92 +732,71 @@ namespace OpenSim.Region.Framework.Scenes
m_nextPosition = (Vector3)m_currentFrame.Position;
m_group.AbsolutePosition = m_nextPosition;
- // we are sending imediate updates, no doing force a extra terseUpdate
- // m_group.UpdateGroupRotationR((Quaternion)m_currentFrame.Rotation);
-
m_group.RootPart.RotationOffset = (Quaternion)m_currentFrame.Rotation;
lock (m_frames)
{
m_frames.RemoveAt(0);
if (m_frames.Count > 0)
+ {
m_currentFrame = m_frames[0];
+ m_currentVel = (Vector3)m_currentFrame.Position - m_nextPosition;
+ m_currentVel /= (m_currentFrame.TimeMS * 0.001f);
+ m_group.RootPart.Velocity = m_currentVel;
+ m_currentFrame.TimeMS += (int)tickDuration;
+ }
+ else
+ m_group.RootPart.Velocity = Vector3.Zero;
}
-
update = true;
}
else
{
- float completed = ((float)m_currentFrame.TimeTotal - (float)m_currentFrame.TimeMS) / (float)m_currentFrame.TimeTotal;
- bool lastStep = m_currentFrame.TimeMS <= tickDuration;
-
- Vector3 v = (Vector3)m_currentFrame.Position - m_group.AbsolutePosition;
- Vector3 motionThisFrame = v / (float)remainingSteps;
- v = v * 1000 / m_currentFrame.TimeMS;
+ bool lastSteps = remainingSteps < 4;
+ Vector3 currentPosition = m_group.AbsolutePosition;
+ Vector3 motionThisFrame = (Vector3)m_currentFrame.Position - currentPosition;
+ motionThisFrame /= (float)remainingSteps;
+
+ m_nextPosition = currentPosition + motionThisFrame;
- m_nextPosition = m_group.AbsolutePosition + motionThisFrame;
-
- if (Vector3.Mag(motionThisFrame) >= 0.05f)
- update = true;
-
- //int totalSteps = m_currentFrame.TimeTotal / (int)tickDuration;
- //m_log.DebugFormat("KeyframeMotion.OnTimer: step {0}/{1}, curPosition={2}, finalPosition={3}, motionThisStep={4} (scene {5})",
- // totalSteps - remainingSteps + 1, totalSteps, m_group.AbsolutePosition, m_currentFrame.Position, motionThisStep, m_scene.RegionInfo.RegionName);
-
- if ((Quaternion)m_currentFrame.Rotation != m_group.GroupRotation)
+ Quaternion currentRotation = m_group.GroupRotation;
+ if ((Quaternion)m_currentFrame.Rotation != currentRotation)
{
- Quaternion current = m_group.GroupRotation;
-
+ float completed = ((float)m_currentFrame.TimeTotal - (float)m_currentFrame.TimeMS) / (float)m_currentFrame.TimeTotal;
Quaternion step = Quaternion.Slerp(m_currentFrame.StartRotation, (Quaternion)m_currentFrame.Rotation, completed);
step.Normalize();
- /* use simpler change detection
- * float angle = 0;
-
- float aa = current.X * current.X + current.Y * current.Y + current.Z * current.Z + current.W * current.W;
- float bb = step.X * step.X + step.Y * step.Y + step.Z * step.Z + step.W * step.W;
- float aa_bb = aa * bb;
-
- if (aa_bb == 0)
- {
- angle = 0;
- }
- else
- {
- float ab = current.X * step.X +
- current.Y * step.Y +
- current.Z * step.Z +
- current.W * step.W;
- float q = (ab * ab) / aa_bb;
-
- if (q > 1.0f)
- {
- angle = 0;
- }
- else
- {
- angle = (float)Math.Acos(2 * q - 1);
- }
- }
-
- if (angle > 0.01f)
- */
- if (Math.Abs(step.X - current.X) > 0.001f
- || Math.Abs(step.Y - current.Y) > 0.001f
- || Math.Abs(step.Z - current.Z) > 0.001f)
- // assuming w is a dependente var
- {
-// m_group.UpdateGroupRotationR(step);
- m_group.RootPart.RotationOffset = step;
-
- //m_group.RootPart.UpdateAngularVelocity(m_currentFrame.AngularVelocity / 2);
+ m_group.RootPart.RotationOffset = step;
+ if (Math.Abs(step.X - m_lastRotationUpdate.X) > 0.001f
+ || Math.Abs(step.Y - m_lastRotationUpdate.Y) > 0.001f
+ || Math.Abs(step.Z - m_lastRotationUpdate.Z) > 0.001f)
update = true;
- }
}
- }
- if (update)
- {
m_group.AbsolutePosition = m_nextPosition;
+ if(lastSteps)
+ m_group.RootPart.Velocity = Vector3.Zero;
+ else
+ m_group.RootPart.Velocity = m_currentVel;
+
+ if(!update && (
+ lastSteps ||
+ m_skippedUpdates * tickDuration > 0.5 ||
+ Math.Abs(m_nextPosition.X - currentPosition.X) > 5f ||
+ Math.Abs(m_nextPosition.Y - currentPosition.Y) > 5f ||
+ Math.Abs(m_nextPosition.Z - currentPosition.Z) > 5f
+ ))
+ {
+ update = true;
+ }
+ else
+ m_skippedUpdates++;
+
+ }
+ if(update)
+ {
+ m_lastPosUpdate = m_nextPosition;
+ m_lastRotationUpdate = m_group.GroupRotation;
+ m_skippedUpdates = 0;
m_group.SendGroupRootTerseUpdate();
}
}
@@ -850,6 +841,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_group.RootPart.Velocity != Vector3.Zero)
{
m_group.RootPart.Velocity = Vector3.Zero;
+ m_skippedUpdates = 1000;
m_group.SendGroupRootTerseUpdate();
// m_group.RootPart.ScheduleTerseUpdate();
}
@@ -862,6 +854,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_group != null)
{
m_group.RootPart.Velocity = Vector3.Zero;
+ m_skippedUpdates = 1000;
m_group.SendGroupRootTerseUpdate();
// m_group.RootPart.ScheduleTerseUpdate();
--
cgit v1.1
From ca250e0b0b564efaaeb5c0b80760126cfd710c5e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 4 Apr 2017 14:34:25 +0100
Subject: mantis 8740: rename osObjectTeleport as osTeleportObject, replaced
the stop parameter by flags, add flags OSTPOBJ_STOPATTARRGET and
OSTPOBJ_SETROT
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 34 +++++++++++++++-------
.../Shared/Api/Implementation/OSSL_Api.cs | 8 ++---
.../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 +-
.../Shared/Api/Runtime/LSL_Constants.cs | 7 +++++
.../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 4 +--
5 files changed, 37 insertions(+), 18 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 24cdc7a..a0d7bfd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -853,7 +853,13 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
}
*/
- public void ObjectTeleport(UUID sourceID, Vector3 targetPosition, Quaternion rotation, bool stop)
+
+ // copy from LSL_constants.cs
+ const int OSTPOBJ_STOPATTARRGET = 0x1; // stops at destination
+ const int OSTPOBJ_STOPONFAIL = 0x2; // stops at start if tp fails
+ const int OSTPOBJ_SETROT = 0x4; // the rotation is the final rotation, otherwise is a added rotation
+
+ public void TeleportObject(UUID sourceID, Vector3 targetPosition, Quaternion rotation, int flags)
{
if(inTransit || IsDeleted || IsAttachmentCheckFull() || IsSelected || Scene == null)
return;
@@ -900,38 +906,44 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ bool stop = (flags & OSTPOBJ_STOPATTARRGET) != 0;
+ bool setrot = (flags & OSTPOBJ_SETROT) != 0;
+
rotation.Normalize();
+ bool dorot = (Math.Abs(rotation.W) < 0.999);
+
+ Quaternion currentRot = RootPart.RotationOffset;
+ if(dorot && setrot)
+ rotation = rotation * Quaternion.Conjugate(currentRot);
+
if(stop)
{
RootPart.Stop();
- if(Math.Abs(rotation.W) < 0.999)
- {
- Quaternion rot = RootPart.RotationOffset;
- rot *= rotation;
- RootPart.RotationOffset = rot;
- }
}
else
{
- if(Math.Abs(rotation.W) < 0.999)
+ if(dorot)
{
- Quaternion rot = RootPart.RotationOffset;
Vector3 vel = RootPart.Velocity;
Vector3 avel = RootPart.AngularVelocity;
Vector3 acc = RootPart.Acceleration;
- rot *= rotation;
vel *= rotation;
avel *= rotation;
acc *= rotation;
- RootPart.RotationOffset = rot;
RootPart.Velocity = vel;
RootPart.AngularVelocity = avel;
RootPart.Acceleration = acc;
}
}
+ if(dorot)
+ {
+ currentRot *= rotation;
+ RootPart.RotationOffset = currentRot;
+ }
+
Vector3 s = RootPart.Scale * RootPart.RotationOffset;
float h = Scene.GetGroundHeight(posX, posY) + 0.5f * (float)Math.Abs(s.Z) + 0.01f;
if(targetPosition.Z < h)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index ddf5078..b50ae28 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -4632,17 +4632,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// the id of the linkset to teleport
/// target position
/// a rotation to apply
- /// if TRUE (!=0) stop at destination
+ /// several flags/param>
///
/// only does teleport local to region
- /// object owner must have rights to run scripts on target location
+ /// if object has scripts, owner must have rights to run scripts on target location
/// object owner must have rights to enter ojects on target location
/// target location parcel must have enought free prims capacity for the linkset prims
/// all avatars siting on the object must have access to target location
/// has a cool down time. retries before expire reset it
/// fail conditions are silent ignored
///
- public void osObjectTeleport(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer stop)
+ public void osTeleportObject(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer flags)
{
CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent");
m_host.AddScriptLPS(1);
@@ -4660,7 +4660,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID myid = m_host.ParentGroup.UUID;
- sog.ObjectTeleport(myid, targetPos, rotation, stop != 0);
+ sog.TeleportObject(myid, targetPos, rotation, flags);
// a delay here may break vehicles
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 4722fed..879fe51 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -496,6 +496,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, vector centerOfMass);
void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, vector centerOfMass,rotation lslrot);
- void osObjectTeleport(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer stop);
+ void osTeleportObject(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer flags);
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 3a90c77..59493a3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -853,5 +853,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
/// process message parameter as regex
///
public const int OS_LISTEN_REGEX_MESSAGE = 0x2;
+
+ // for osTeleportObject
+ public const int OSTPOBJ_NONE = 0x0;
+ public const int OSTPOBJ_STOPATTARRGET = 0x1; // stops at destination
+ public const int OSTPOBJ_STOPONFAIL = 0x2; // stops at jump point if tp fails
+ public const int OSTPOBJ_SETROT = 0x4; // the rotation is the final rotation, otherwise is a added rotation
+
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 37e7a17..3c8e02d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -1140,9 +1140,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osClearInertia();
}
- public void osObjectTeleport(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer stop)
+ public void osTeleportObject(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer flags)
{
- m_OSSL_Functions.osObjectTeleport(objectUUID, targetPos, targetrotation, stop);
+ m_OSSL_Functions.osTeleportObject(objectUUID, targetPos, targetrotation, flags);
}
}
}
--
cgit v1.1
From e237e1b2fa444b0bf0077036c9436f919e344e2b Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 4 Apr 2017 19:27:45 +0100
Subject: add LSL_Integer osGetLinkNumber(LSL_String name). uses a cache for
the string to linknumber map, cache invalidations may still be missing :(
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +
.../Region/Framework/Scenes/SceneObjectGroup.cs | 61 ++++++++++++++++++++++
.../Shared/Api/Implementation/OSSL_Api.cs | 9 ++++
.../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 ++
4 files changed, 77 insertions(+)
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 49e98e7..6b29ec1 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1985,6 +1985,7 @@ namespace OpenSim.Region.Framework.Scenes
{
newRoot.TriggerScriptChangedEvent(Changed.LINK);
newRoot.ParentGroup.HasGroupChanged = true;
+ newRoot.ParentGroup.InvalidatePartsLinkMaps();
newRoot.ParentGroup.ScheduleGroupForFullUpdate();
}
}
@@ -2001,6 +2002,7 @@ namespace OpenSim.Region.Framework.Scenes
// from the database. They will be rewritten immediately,
// minus the rows for the unlinked child prims.
m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID);
+ g.InvalidatePartsLinkMaps();
g.TriggerScriptChangedEvent(Changed.LINK);
g.HasGroupChanged = true; // Persist
g.ScheduleGroupForFullUpdate();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a0d7bfd..b410b74 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2004,6 +2004,7 @@ namespace OpenSim.Region.Framework.Scenes
if (part.LinkNum == 2)
RootPart.LinkNum = 1;
+ InvalidatePartsLinkMaps();
}
///
@@ -2560,6 +2561,7 @@ namespace OpenSim.Region.Framework.Scenes
dupe.ScheduleGroupForFullUpdate();
}
+ dupe.InvalidatePartsLinkMaps();
m_dupeInProgress = false;
return dupe;
}
@@ -3321,6 +3323,7 @@ namespace OpenSim.Region.Framework.Scenes
ResetChildPrimPhysicsPositions();
InvalidBoundsRadius();
+ InvalidatePartsLinkMaps();
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = false;
@@ -3477,6 +3480,7 @@ namespace OpenSim.Region.Framework.Scenes
objectGroup.HasGroupChangedDueToDelink = true;
InvalidBoundsRadius();
+ InvalidatePartsLinkMaps();
objectGroup.AggregatePerms();
if (sendEvents)
@@ -5333,6 +5337,63 @@ namespace OpenSim.Region.Framework.Scenes
m_PlaySoundSlavePrims.Clear();
m_LoopSoundMasterPrim = null;
m_targets.Clear();
+ m_partsNameToLinkMap.Clear();
+ }
+
+ Dictionary m_partsNameToLinkMap = new Dictionary();
+
+ // this scales bad but so does GetLinkNumPart
+ public int GetLinkNumber(string name)
+ {
+ if(String.IsNullOrEmpty(name) || name == "Object")
+ return -1;
+
+ lock(m_partsNameToLinkMap)
+ {
+ if(m_partsNameToLinkMap.Count == 0)
+ {
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ string s = parts[i].Name;
+ if(String.IsNullOrEmpty(s) || s == "Object" || s == "Primitive")
+ continue;
+
+ if(m_partsNameToLinkMap.ContainsKey(s))
+ {
+ int ol = parts[i].LinkNum;
+ if(ol < m_partsNameToLinkMap[s])
+ m_partsNameToLinkMap[s] = ol;
+ }
+ else
+ m_partsNameToLinkMap[s] = parts[i].LinkNum;
+ }
+ }
+
+ if(m_partsNameToLinkMap.ContainsKey(name))
+ return m_partsNameToLinkMap[name];
+ }
+
+ if(m_sittingAvatars.Count > 0)
+ {
+ int j = m_parts.Count;
+ if(j > 1)
+ j++;
+ ScenePresence[] avs = m_sittingAvatars.ToArray();
+ for (int i = 0; i < avs.Length; i++, j++)
+ {
+ if (avs[i].Name == name)
+ return j;
+ }
+ }
+
+ return -1;
+ }
+
+ public void InvalidatePartsLinkMaps()
+ {
+ lock(m_partsNameToLinkMap)
+ m_partsNameToLinkMap.Clear();
}
#endregion
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b50ae28..0275cf4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -4663,5 +4663,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
sog.TeleportObject(myid, targetPos, rotation, flags);
// a delay here may break vehicles
}
+
+ public LSL_Integer osGetLinkNumber(LSL_String name)
+ {
+ m_host.AddScriptLPS(1);
+ SceneObjectGroup sog = m_host.ParentGroup;
+ if(sog== null || sog.IsDeleted)
+ return -1;
+ return sog.GetLinkNumber(name);
+ }
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 3c8e02d..7c08628 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -1144,5 +1144,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
m_OSSL_Functions.osTeleportObject(objectUUID, targetPos, targetrotation, flags);
}
+
+ public LSL_Integer osGetLinkNumber(LSL_String name)
+ {
+ return m_OSSL_Functions.osGetLinkNumber(name);
+ }
}
}
--
cgit v1.1
From d085c337a9d08788837a2f54a2400e91c807f59f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 4 Apr 2017 20:11:11 +0100
Subject: add a little speedup on repeated requests for same name on
osGetLinkNumber.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 35 +++++++++++++++++-----
.../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 +
2 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b410b74..d3490c2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -5340,7 +5340,9 @@ namespace OpenSim.Region.Framework.Scenes
m_partsNameToLinkMap.Clear();
}
- Dictionary m_partsNameToLinkMap = new Dictionary();
+ private Dictionary m_partsNameToLinkMap = new Dictionary();
+ private string GetLinkNumber_lastname;
+ private int GetLinkNumber_lastnumber;
// this scales bad but so does GetLinkNumPart
public int GetLinkNumber(string name)
@@ -5352,6 +5354,8 @@ namespace OpenSim.Region.Framework.Scenes
{
if(m_partsNameToLinkMap.Count == 0)
{
+ GetLinkNumber_lastname = String.Empty;
+ GetLinkNumber_lastnumber = -1;
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
@@ -5370,20 +5374,33 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ if(name == GetLinkNumber_lastname)
+ return GetLinkNumber_lastnumber;
+
if(m_partsNameToLinkMap.ContainsKey(name))
- return m_partsNameToLinkMap[name];
- }
+ {
+ lock(m_partsNameToLinkMap)
+ {
+ GetLinkNumber_lastname = name;
+ GetLinkNumber_lastnumber = m_partsNameToLinkMap[name];
+ return GetLinkNumber_lastnumber;
+ }
+ }
+ }
if(m_sittingAvatars.Count > 0)
{
- int j = m_parts.Count;
- if(j > 1)
- j++;
+ int j = m_parts.Count + 1;
+
ScenePresence[] avs = m_sittingAvatars.ToArray();
for (int i = 0; i < avs.Length; i++, j++)
{
if (avs[i].Name == name)
- return j;
+ {
+ GetLinkNumber_lastname = name;
+ GetLinkNumber_lastnumber = j;
+ return j;
+ }
}
}
@@ -5393,7 +5410,11 @@ namespace OpenSim.Region.Framework.Scenes
public void InvalidatePartsLinkMaps()
{
lock(m_partsNameToLinkMap)
+ {
m_partsNameToLinkMap.Clear();
+ GetLinkNumber_lastname = String.Empty;
+ GetLinkNumber_lastnumber = -1;
+ }
}
#endregion
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 879fe51..08b144a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -497,5 +497,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, vector centerOfMass,rotation lslrot);
void osTeleportObject(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer flags);
+ LSL_Integer osGetLinkNumber(LSL_String name);
}
}
--
cgit v1.1
From 2805cb9dec567cdfb7a25d771527510b7a6284af Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 5 Apr 2017 01:15:44 +0100
Subject: give osTeleportObject proper OSFunctionThreatLevel setting on
osslEnable.ini
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 ++--
bin/config-include/osslEnable.ini | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 0275cf4..a6f6a80 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -4644,13 +4644,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osTeleportObject(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer flags)
{
- CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent");
+ CheckThreatLevel(ThreatLevel.Severe, "osTeleportObject");
m_host.AddScriptLPS(1);
UUID objUUID;
if (!UUID.TryParse(objectUUID, out objUUID))
{
- OSSLShoutError("osObjectTeleport() invalid object Key");
+ OSSLShoutError("osTeleportObject() invalid object Key");
return;
}
diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini
index 45eddf7..de5f957 100644
--- a/bin/config-include/osslEnable.ini
+++ b/bin/config-include/osslEnable.ini
@@ -236,4 +236,5 @@
Allow_osKickAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osRevokeScriptPermissions = false
Allow_osTeleportAgent = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
+ Allow_osObjectTeleport = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
--
cgit v1.1
From c58f2167bb8bc6dbbb1d575cf0a4534e47d2a3db Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 5 Apr 2017 13:55:51 +0100
Subject: fix osTeleportObject OSFunctionThreatLevel setting on
osslEnable.ini
---
bin/config-include/osslEnable.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/config-include/osslEnable.ini b/bin/config-include/osslEnable.ini
index de5f957..dca1c0c 100644
--- a/bin/config-include/osslEnable.ini
+++ b/bin/config-include/osslEnable.ini
@@ -236,5 +236,5 @@
Allow_osKickAvatar = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Allow_osRevokeScriptPermissions = false
Allow_osTeleportAgent = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
- Allow_osObjectTeleport = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
+ Allow_osTeleportObject = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
--
cgit v1.1
From c0904a32cb281bad39497b091e758f2433adc196 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 5 Apr 2017 15:11:19 +0100
Subject: OSSL CheckThreatLevel() with no arguments only tests if OSSL is
enabled. Faster test for safe functions that are always allowed with OSSL
enabled. other name could be CheckOSSLenabled, but this name preserves
functions template.
---
.../Shared/Api/Implementation/OSSL_Api.cs | 32 +++++++++++++++++++---
1 file changed, 28 insertions(+), 4 deletions(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index a6f6a80..b3bd8c4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -260,7 +260,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
}
- // Returns of the function is allowed. Throws a script exception if not allowed.
+ // Returns if OSSL is enabled. Throws a script exception if OSSL is not allowed..
+ // for safe funtions always active
+ public void CheckThreatLevel()
+ {
+ if (!m_OSFunctionsEnabled)
+ OSSLError(String.Format("{0} permission denied. All OS functions are disabled.")); // throws
+ }
+
+ // Returns if the function is allowed. Throws a script exception if not allowed.
public void CheckThreatLevel(ThreatLevel level, string function)
{
if (!m_OSFunctionsEnabled)
@@ -1716,7 +1724,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer osCheckODE()
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
+
LSL_Integer ret = 0; // false
if (m_ScriptEngine.World.PhysicsScene != null)
{
@@ -1757,10 +1767,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public string osGetPhysicsEngineName()
{
- // not doing security checks
- // this whould limit the use of this
-
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
+
string ret = "NoEngine";
if (m_ScriptEngine.World.PhysicsScene != null)
{
@@ -1771,6 +1780,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
return ret;
}
+
public string osGetSimulatorVersion()
{
// High because it can be used to target attacks to known weaknesses
@@ -4364,6 +4374,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osCollisionSound(string impact_sound, double impact_volume)
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
if(impact_sound == "")
@@ -4396,6 +4407,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// still not very usefull, detector is lost on rez, restarts, etc
public void osVolumeDetect(int detect)
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
if (m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted || m_host.ParentGroup.IsAttachment)
@@ -4418,6 +4430,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public LSL_List osGetInertiaData()
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
LSL_List result = new LSL_List();
@@ -4465,7 +4478,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osSetInertia(LSL_Float mass, LSL_Vector centerOfMass, LSL_Vector principalInertiaScaled, LSL_Rotation lslrot)
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
+
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
@@ -4502,6 +4517,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osSetInertiaAsBox(LSL_Float mass, LSL_Vector boxSize, LSL_Vector centerOfMass, LSL_Rotation lslrot)
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
SceneObjectGroup sog = m_host.ParentGroup;
@@ -4543,7 +4559,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, LSL_Vector centerOfMass)
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
+
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
@@ -4581,7 +4599,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, LSL_Vector centerOfMass, LSL_Rotation lslrot)
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
+
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
@@ -4618,7 +4638,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
///
public void osClearInertia()
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
+
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return;
@@ -4666,7 +4688,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer osGetLinkNumber(LSL_String name)
{
+ CheckThreatLevel();
m_host.AddScriptLPS(1);
+
SceneObjectGroup sog = m_host.ParentGroup;
if(sog== null || sog.IsDeleted)
return -1;
--
cgit v1.1
From a41924d1f851c4aa807da71dc44d665d187473bf Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 5 Apr 2017 19:42:55 +0100
Subject: add missing invalidation of osGetLinkNumber cache
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 46b7b86..8d04c9f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -638,6 +638,8 @@ namespace OpenSim.Region.Framework.Scenes
set
{
m_name = value;
+ if(ParentGroup != null)
+ ParentGroup.InvalidatePartsLinkMaps();
PhysicsActor pa = PhysActor;
--
cgit v1.1
From 1848b1fdb143462e6d0db47142e5f50bd8a9632c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 6 Apr 2017 12:56:00 +0100
Subject: mantis 8740: fix osTeleportObject set rotation
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d3490c2..af70848 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -910,11 +910,12 @@ namespace OpenSim.Region.Framework.Scenes
bool setrot = (flags & OSTPOBJ_SETROT) != 0;
rotation.Normalize();
- bool dorot = (Math.Abs(rotation.W) < 0.999);
-
Quaternion currentRot = RootPart.RotationOffset;
- if(dorot && setrot)
- rotation = rotation * Quaternion.Conjugate(currentRot);
+
+ if(setrot)
+ rotation = Quaternion.Conjugate(currentRot) * rotation;
+
+ bool dorot = setrot | (Math.Abs(rotation.W) < 0.999);
if(stop)
{
--
cgit v1.1
From 040037d713adb0f7a36d08e53978cf659d636650 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 12 Apr 2017 06:50:34 +0100
Subject: update ode.dll for windows. Other platforms need fo be compiled from
opensim-libs repo, folder ODE-OpenSim.0.13.2. This adds OsTerrain, a
replacevment for Heightfield that ubOde can use. Its already rotated as
needed and has a diferent Sphere collider, rest is still almost identical.
Keep previus ode version in case this goes wrong.
---
bin/lib32/ode.dll | Bin 552448 -> 552960 bytes
bin/lib64/ode.dll | Bin 651776 -> 650752 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/lib32/ode.dll b/bin/lib32/ode.dll
index 62aa4df..2166c68 100755
Binary files a/bin/lib32/ode.dll and b/bin/lib32/ode.dll differ
diff --git a/bin/lib64/ode.dll b/bin/lib64/ode.dll
index 543b900..070bad8 100755
Binary files a/bin/lib64/ode.dll and b/bin/lib64/ode.dll differ
--
cgit v1.1
From 9d8220ac9fe4fe01676beaf9b2a82db82d37a7f8 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 14 Apr 2017 03:14:41 +0100
Subject: some reduction on large colision repulsive force on non physical
placement of physical prims
---
.../PhysicsModules/SharedBase/PhysicsActor.cs | 4 +
OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 357 ++++++++++++++-------
OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 18 +-
3 files changed, 255 insertions(+), 124 deletions(-)
diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
index d23d9c1..2fa98b5 100644
--- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
+++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsActor.cs
@@ -256,6 +256,7 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
///
public string SOPName;
+ public virtual void CrossingStart() { }
public abstract void CrossingFailure();
public abstract void link(PhysicsActor obj);
@@ -462,6 +463,7 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
public abstract bool SubscribedEvents();
public virtual void AddCollisionEvent(uint CollidedWith, ContactPoint contact) { }
+ public virtual void AddVDTCCollisionEvent(uint CollidedWith, ContactPoint contact) { }
public virtual PhysicsInertiaData GetInertiaData()
{
@@ -477,6 +479,8 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
{
}
+ public virtual float SimulationSuspended { get; set; }
+
// Warning in a parent part it returns itself, not null
public virtual PhysicsActor ParentActor { get { return this; } }
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index f784990..98bea09 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -109,8 +109,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private float m_waterHeight;
private float m_buoyancy; //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle.
- private int body_autodisable_frames;
- public int bodydisablecontrol = 0;
+ private int m_body_autodisable_frames;
+ public int m_bodydisablecontrol = 0;
+ public int m_bodyMoveCoolDown = 0;
private float m_gravmod = 1.0f;
// Default we're a Geometry
@@ -196,6 +197,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private int m_eventsubscription;
private int m_cureventsubscription;
private CollisionEventUpdate CollisionEventsThisFrame = null;
+ private CollisionEventUpdate CollisionVDTCEventsThisFrame = null;
private bool SentEmptyCollisionsEvent;
public volatile bool childPrim;
@@ -668,7 +670,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
if (value.IsFinite())
{
- AddChange(changes.Velocity, value);
+ if(m_outbounds)
+ _velocity = value;
+ else
+ AddChange(changes.Velocity, value);
}
else
{
@@ -972,31 +977,70 @@ namespace OpenSim.Region.PhysicsModule.ubOde
public override void CrossingFailure()
{
- if (m_outbounds)
+ lock(_parent_scene.OdeLock)
{
- _position.X = Util.Clip(_position.X, 0.5f, _parent_scene.WorldExtents.X - 0.5f);
- _position.Y = Util.Clip(_position.Y, 0.5f, _parent_scene.WorldExtents.Y - 0.5f);
- _position.Z = Util.Clip(_position.Z + 0.2f, -100f, 50000f);
+ if (m_outbounds)
+ {
+ _position.X = Util.Clip(_position.X, 0.5f, _parent_scene.WorldExtents.X - 0.5f);
+ _position.Y = Util.Clip(_position.Y, 0.5f, _parent_scene.WorldExtents.Y - 0.5f);
+ _position.Z = Util.Clip(_position.Z + 0.2f, -100f, 50000f);
- m_lastposition = _position;
- _velocity.X = 0;
- _velocity.Y = 0;
- _velocity.Z = 0;
+ m_lastposition = _position;
+ _velocity.X = 0;
+ _velocity.Y = 0;
+ _velocity.Z = 0;
- d.AllocateODEDataForThread(0);
+ d.AllocateODEDataForThread(0);
- m_lastVelocity = _velocity;
- if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
- m_vehicle.Stop();
+ m_lastVelocity = _velocity;
+ if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
+ m_vehicle.Stop();
+ if(Body != IntPtr.Zero)
+ d.BodySetLinearVel(Body, 0, 0, 0); // stop it
+ if (prim_geom != IntPtr.Zero)
+ d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
+
+ m_outbounds = false;
+ changeDisable(false);
+ base.RequestPhysicsterseUpdate();
+ }
+ }
+ }
+
+ public override void CrossingStart()
+ {
+ lock(_parent_scene.OdeLock)
+ {
+ if (m_outbounds || childPrim)
+ return;
+
+ m_outbounds = true;
+
+ m_lastposition = _position;
+ m_lastorientation = _orientation;
+
+ d.AllocateODEDataForThread(0);
if(Body != IntPtr.Zero)
- d.BodySetLinearVel(Body, 0, 0, 0); // stop it
- if (prim_geom != IntPtr.Zero)
- d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
+ {
+ if(m_bodyMoveCoolDown >= 0)
+ {
+ d.Vector3 dtmp = d.BodyGetAngularVel(Body);
+ m_rotationalVelocity.X = dtmp.X;
+ m_rotationalVelocity.Y = dtmp.Y;
+ m_rotationalVelocity.Z = dtmp.Z;
- m_outbounds = false;
- changeDisable(false);
- base.RequestPhysicsterseUpdate();
+ dtmp = d.BodyGetLinearVel(Body);
+ _velocity.X = dtmp.X;
+ _velocity.Y = dtmp.Y;
+ _velocity.Z = dtmp.Z;
+ }
+ d.BodySetLinearVel(Body, 0, 0, 0); // stop it
+ d.BodySetAngularVel(Body, 0, 0, 0);
+ }
+ d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
+ disableBodySoft(); // stop collisions
+ UnSubscribeEvents();
}
}
@@ -1090,11 +1134,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_cureventsubscription = 0;
if (CollisionEventsThisFrame == null)
CollisionEventsThisFrame = new CollisionEventUpdate();
+ if (CollisionVDTCEventsThisFrame == null)
+ CollisionVDTCEventsThisFrame = new CollisionEventUpdate();
SentEmptyCollisionsEvent = false;
}
public override void UnSubscribeEvents()
{
+ if (CollisionVDTCEventsThisFrame != null)
+ {
+ CollisionVDTCEventsThisFrame.Clear();
+ CollisionVDTCEventsThisFrame = null;
+ }
if (CollisionEventsThisFrame != null)
{
CollisionEventsThisFrame.Clear();
@@ -1113,21 +1164,44 @@ namespace OpenSim.Region.PhysicsModule.ubOde
_parent_scene.AddCollisionEventReporting(this);
}
+ public override void AddVDTCCollisionEvent(uint CollidedWith, ContactPoint contact)
+ {
+ if (CollisionVDTCEventsThisFrame == null)
+ CollisionVDTCEventsThisFrame = new CollisionEventUpdate();
+
+ CollisionVDTCEventsThisFrame.AddCollider(CollidedWith, contact);
+ _parent_scene.AddCollisionEventReporting(this);
+ }
+
internal void SleeperAddCollisionEvents()
{
- if (CollisionEventsThisFrame == null)
- return;
- if(CollisionEventsThisFrame.m_objCollisionList.Count == 0)
- return;
- foreach(KeyValuePair kvp in CollisionEventsThisFrame.m_objCollisionList)
+ if(CollisionEventsThisFrame != null && CollisionEventsThisFrame.m_objCollisionList.Count != 0)
+ {
+ foreach(KeyValuePair kvp in CollisionEventsThisFrame.m_objCollisionList)
+ {
+ if(kvp.Key == 0)
+ continue;
+ OdePrim other = _parent_scene.getPrim(kvp.Key);
+ if(other == null)
+ continue;
+ ContactPoint cp = kvp.Value;
+ cp.SurfaceNormal = - cp.SurfaceNormal;
+ cp.RelativeSpeed = -cp.RelativeSpeed;
+ other.AddCollisionEvent(ParentActor.LocalID,cp);
+ }
+ }
+ if(CollisionVDTCEventsThisFrame != null && CollisionVDTCEventsThisFrame.m_objCollisionList.Count != 0)
{
- OdePrim other = _parent_scene.getPrim(kvp.Key);
- if(other == null)
- continue;
- ContactPoint cp = kvp.Value;
- cp.SurfaceNormal = - cp.SurfaceNormal;
- cp.RelativeSpeed = -cp.RelativeSpeed;
- other.AddCollisionEvent(ParentActor.LocalID,cp);
+ foreach(KeyValuePair kvp in CollisionVDTCEventsThisFrame.m_objCollisionList)
+ {
+ OdePrim other = _parent_scene.getPrim(kvp.Key);
+ if(other == null)
+ continue;
+ ContactPoint cp = kvp.Value;
+ cp.SurfaceNormal = - cp.SurfaceNormal;
+ cp.RelativeSpeed = -cp.RelativeSpeed;
+ other.AddCollisionEvent(ParentActor.LocalID,cp);
+ }
}
}
@@ -1160,6 +1234,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
CollisionEventsThisFrame.Clear();
}
}
+ if(CollisionVDTCEventsThisFrame != null && (Body == IntPtr.Zero || d.BodyIsEnabled(Body)))
+ CollisionVDTCEventsThisFrame.Clear();
}
public override bool SubscribedEvents()
@@ -1192,7 +1268,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_invTimeStep = 1f / m_timeStep;
m_density = parent_scene.geomDefaultDensity;
- body_autodisable_frames = parent_scene.bodyFramesAutoDisable;
+ m_body_autodisable_frames = parent_scene.bodyFramesAutoDisable;
prim_geom = IntPtr.Zero;
collide_geom = IntPtr.Zero;
@@ -1257,6 +1333,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
bounce = parent_scene.m_materialContactsData[(int)Material.Wood].bounce;
m_building = true; // control must set this to false when done
+ m_bodyMoveCoolDown = 0;
AddChange(changes.Add, null);
@@ -1963,7 +2040,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.BodySetGravityMode(Body, false);
d.BodySetAutoDisableFlag(Body, true);
- d.BodySetAutoDisableSteps(Body, body_autodisable_frames);
+ d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
d.BodySetAutoDisableAngularThreshold(Body, 0.05f);
d.BodySetAutoDisableLinearThreshold(Body, 0.05f);
d.BodySetDamping(Body, .004f, .001f);
@@ -2055,11 +2132,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
else
{
+ /*
d.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z);
d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
+ */
_zeroFlag = false;
- bodydisablecontrol = 0;
+ m_bodydisablecontrol = 0;
}
+ m_bodyMoveCoolDown = -5;
_parent_scene.addActiveGroups(this);
}
@@ -2152,6 +2232,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
m_mass = primMass;
m_collisionscore = 0;
+ m_bodyMoveCoolDown = 0;
}
private void FixInertia(Vector3 NewPos,Quaternion newrot)
@@ -2814,6 +2895,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
_zeroFlag = true;
d.BodyEnable(Body);
+ m_bodyMoveCoolDown = -5;
}
}
// else if (_parent != null)
@@ -2856,6 +2938,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z);
_position = newPos;
+ m_bodyMoveCoolDown = -5;
}
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
{
@@ -2915,8 +2998,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
myrot.W = newOri.W;
d.GeomSetQuaternion(prim_geom, ref myrot);
_orientation = newOri;
- if (Body != IntPtr.Zero && m_angularlocks != 0)
- createAMotor(m_angularlocks);
+
+ if (Body != IntPtr.Zero)
+ {
+ if(m_angularlocks != 0)
+ createAMotor(m_angularlocks);
+ m_bodyMoveCoolDown = -5;
+ }
}
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
{
@@ -3212,7 +3300,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private void changeSetTorque(Vector3 newtorque)
{
- if (!m_isSelected)
+ if (!m_isSelected && !m_outbounds)
{
if (m_isphysical && Body != IntPtr.Zero)
{
@@ -3229,14 +3317,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private void changeForce(Vector3 force)
{
m_force = force;
- if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
+ if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
d.BodyEnable(Body);
}
private void changeAddForce(Vector3 theforce)
{
m_forceacc += theforce;
- if (!m_isSelected)
+ if (!m_isSelected && !m_outbounds)
{
lock (this)
{
@@ -3257,7 +3345,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private void changeAddAngularImpulse(Vector3 aimpulse)
{
m_angularForceacc += aimpulse * m_invTimeStep;
- if (!m_isSelected)
+ if (!m_isSelected && !m_outbounds)
{
lock (this)
{
@@ -3282,7 +3370,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
newVel *= len;
}
- if (!m_isSelected)
+ if (!m_isSelected && !m_outbounds)
{
if (Body != IntPtr.Zero)
{
@@ -3290,8 +3378,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
enableBodySoft();
else if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
-
- d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
+ if(m_bodyMoveCoolDown >= 0)
+ d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
}
//resetCollisionAccounting();
}
@@ -3307,7 +3395,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
newAngVel *= len;
}
- if (!m_isSelected)
+ if (!m_isSelected && !m_outbounds)
{
if (Body != IntPtr.Zero)
{
@@ -3316,8 +3404,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
else if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
-
- d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
+ if(m_bodyMoveCoolDown >= 0);
+ d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
}
//resetCollisionAccounting();
}
@@ -3468,13 +3556,33 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (!childPrim && m_isphysical && Body != IntPtr.Zero &&
!m_disabled && !m_isSelected && !m_building && !m_outbounds)
{
+ if(m_bodyMoveCoolDown < 0)
+ {
+ m_bodyMoveCoolDown++;
+// if(!IsColliding)
+// m_bodyCoolDown +=2;
+ if(m_bodyMoveCoolDown >= 0)
+ {
+ d.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z);
+ d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
+ }
+ else
+ {
+ d.BodySetAngularVel(Body, 0, 0, 0);
+ d.BodySetLinearVel(Body, 0, 0, 0);
+ m_forceacc = Vector3.Zero;
+ m_angularForceacc = Vector3.Zero;
+ _zeroFlag = false;
+ return;
+ }
+ }
if (!d.BodyIsEnabled(Body))
{
// let vehicles sleep
if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
return;
- if (++bodydisablecontrol < 50)
+ if (++m_bodydisablecontrol < 50)
return;
// clear residuals
@@ -3482,11 +3590,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.BodySetLinearVel(Body,0f,0f,0f);
_zeroFlag = true;
d.BodyEnable(Body);
- bodydisablecontrol = -4;
+ m_bodydisablecontrol = -4;
}
- if(bodydisablecontrol < 0)
- bodydisablecontrol ++;
+ if(m_bodydisablecontrol < 0)
+ m_bodydisablecontrol ++;
d.Vector3 lpos = d.GeomGetPosition(prim_geom); // root position that is seem by rest of simulator
@@ -3655,7 +3763,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
bool bodyenabled = d.BodyIsEnabled(Body);
- if(bodydisablecontrol < 0)
+ if(m_bodydisablecontrol < 0)
return;
if (bodyenabled || !_zeroFlag)
@@ -3723,15 +3831,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_lastposition = _position;
m_lastorientation = _orientation;
- d.Vector3 dtmp = d.BodyGetAngularVel(Body);
- m_rotationalVelocity.X = dtmp.X;
- m_rotationalVelocity.Y = dtmp.Y;
- m_rotationalVelocity.Z = dtmp.Z;
-
- dtmp = d.BodyGetLinearVel(Body);
- _velocity.X = dtmp.X;
- _velocity.Y = dtmp.Y;
- _velocity.Z = dtmp.Z;
+ if(m_bodyMoveCoolDown >= 0)
+ {
+ d.Vector3 dtmp = d.BodyGetAngularVel(Body);
+ m_rotationalVelocity.X = dtmp.X;
+ m_rotationalVelocity.Y = dtmp.Y;
+ m_rotationalVelocity.Z = dtmp.Z;
+
+ dtmp = d.BodyGetLinearVel(Body);
+ _velocity.X = dtmp.X;
+ _velocity.Y = dtmp.Y;
+ _velocity.Z = dtmp.Z;
+ }
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
d.BodySetAngularVel(Body, 0, 0, 0);
@@ -3756,30 +3867,33 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
else
{
- float poserror;
- float angerror;
- if(_zeroFlag)
- {
- poserror = 0.01f;
- angerror = 0.001f;
- }
- else
+ if(m_bodyMoveCoolDown >= 0)
{
- poserror = 0.005f;
- angerror = 0.0005f;
- }
+ float poserror;
+ float angerror;
+ if(_zeroFlag)
+ {
+ poserror = 0.01f;
+ angerror = 0.001f;
+ }
+ else
+ {
+ poserror = 0.005f;
+ angerror = 0.0005f;
+ }
- if (
- (Math.Abs(_position.X - lpos.X) < poserror)
- && (Math.Abs(_position.Y - lpos.Y) < poserror)
- && (Math.Abs(_position.Z - lpos.Z) < poserror)
- && (Math.Abs(_orientation.X - ori.X) < angerror)
- && (Math.Abs(_orientation.Y - ori.Y) < angerror)
- && (Math.Abs(_orientation.Z - ori.Z) < angerror) // ignore W
- )
- _zeroFlag = true;
- else
- _zeroFlag = false;
+ if (
+ (Math.Abs(_position.X - lpos.X) < poserror)
+ && (Math.Abs(_position.Y - lpos.Y) < poserror)
+ && (Math.Abs(_position.Z - lpos.Z) < poserror)
+ && (Math.Abs(_orientation.X - ori.X) < angerror)
+ && (Math.Abs(_orientation.Y - ori.Y) < angerror)
+ && (Math.Abs(_orientation.Z - ori.Z) < angerror) // ignore W
+ )
+ _zeroFlag = true;
+ else
+ _zeroFlag = false;
+ }
}
// update position
@@ -3805,46 +3919,49 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
else
{
- d.Vector3 vel = d.BodyGetLinearVel(Body);
+ if(m_bodyMoveCoolDown >= 0)
+ {
+ d.Vector3 vel = d.BodyGetLinearVel(Body);
- _acceleration = _velocity;
+ _acceleration = _velocity;
- if ((Math.Abs(vel.X) < 0.005f) &&
- (Math.Abs(vel.Y) < 0.005f) &&
- (Math.Abs(vel.Z) < 0.005f))
- {
- _velocity = Vector3.Zero;
- float t = -m_invTimeStep;
- _acceleration = _acceleration * t;
- }
- else
- {
- _velocity.X = vel.X;
- _velocity.Y = vel.Y;
- _velocity.Z = vel.Z;
- _acceleration = (_velocity - _acceleration) * m_invTimeStep;
- }
+ if ((Math.Abs(vel.X) < 0.005f) &&
+ (Math.Abs(vel.Y) < 0.005f) &&
+ (Math.Abs(vel.Z) < 0.005f))
+ {
+ _velocity = Vector3.Zero;
+ float t = -m_invTimeStep;
+ _acceleration = _acceleration * t;
+ }
+ else
+ {
+ _velocity.X = vel.X;
+ _velocity.Y = vel.Y;
+ _velocity.Z = vel.Z;
+ _acceleration = (_velocity - _acceleration) * m_invTimeStep;
+ }
- if ((Math.Abs(_acceleration.X) < 0.01f) &&
- (Math.Abs(_acceleration.Y) < 0.01f) &&
- (Math.Abs(_acceleration.Z) < 0.01f))
- {
- _acceleration = Vector3.Zero;
- }
+ if ((Math.Abs(_acceleration.X) < 0.01f) &&
+ (Math.Abs(_acceleration.Y) < 0.01f) &&
+ (Math.Abs(_acceleration.Z) < 0.01f))
+ {
+ _acceleration = Vector3.Zero;
+ }
- vel = d.BodyGetAngularVel(Body);
- if ((Math.Abs(vel.X) < 0.0001) &&
- (Math.Abs(vel.Y) < 0.0001) &&
- (Math.Abs(vel.Z) < 0.0001)
- )
- {
- m_rotationalVelocity = Vector3.Zero;
- }
- else
- {
- m_rotationalVelocity.X = vel.X;
- m_rotationalVelocity.Y = vel.Y;
- m_rotationalVelocity.Z = vel.Z;
+ vel = d.BodyGetAngularVel(Body);
+ if ((Math.Abs(vel.X) < 0.0001) &&
+ (Math.Abs(vel.Y) < 0.0001) &&
+ (Math.Abs(vel.Z) < 0.0001)
+ )
+ {
+ m_rotationalVelocity = Vector3.Zero;
+ }
+ else
+ {
+ m_rotationalVelocity.X = vel.X;
+ m_rotationalVelocity.Y = vel.Y;
+ m_rotationalVelocity.Z = vel.Z;
+ }
}
}
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index 6279d6a..4a82f77 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -186,7 +186,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
float frictionMovementMult = 0.8f;
- float TerrainBounce = 0.1f;
+ float TerrainBounce = 0.001f;
float TerrainFriction = 0.3f;
public float AvatarFriction = 0;// 0.9f * 0.5f;
@@ -1083,9 +1083,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
case ActorTypes.Prim:
if (p2events)
{
- AddCollisionEventReporting(p2);
+ //AddCollisionEventReporting(p2);
p2.AddCollisionEvent(p1.ParentActor.LocalID, contact);
}
+ else if(p1.IsVolumeDtc)
+ p2.AddVDTCCollisionEvent(p1.ParentActor.LocalID, contact);
+
obj2LocalID = p2.ParentActor.LocalID;
break;
@@ -1099,9 +1102,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
contact.SurfaceNormal = -contact.SurfaceNormal;
contact.RelativeSpeed = -contact.RelativeSpeed;
- AddCollisionEventReporting(p1);
+ //AddCollisionEventReporting(p1);
p1.AddCollisionEvent(obj2LocalID, contact);
}
+ else if(p2.IsVolumeDtc)
+ {
+ contact.SurfaceNormal = -contact.SurfaceNormal;
+ contact.RelativeSpeed = -contact.RelativeSpeed;
+ //AddCollisionEventReporting(p1);
+ p1.AddVDTCCollisionEvent(obj2LocalID, contact);
+ }
break;
}
case ActorTypes.Ground:
@@ -1110,7 +1120,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
if (p2events && !p2.IsVolumeDtc)
{
- AddCollisionEventReporting(p2);
+ //AddCollisionEventReporting(p2);
p2.AddCollisionEvent(0, contact);
}
break;
--
cgit v1.1
From 22e9647748f0ca5b5bcd0c31667d2d5f263715bc Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 14 Apr 2017 03:45:03 +0100
Subject: update ode binaries for windows
---
bin/lib32/ode.dll | Bin 552960 -> 553472 bytes
bin/lib64/ode.dll | Bin 650752 -> 651776 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/lib32/ode.dll b/bin/lib32/ode.dll
index 2166c68..5bb9319 100755
Binary files a/bin/lib32/ode.dll and b/bin/lib32/ode.dll differ
diff --git a/bin/lib64/ode.dll b/bin/lib64/ode.dll
index 070bad8..637b105 100755
Binary files a/bin/lib64/ode.dll and b/bin/lib64/ode.dll differ
--
cgit v1.1
From 63383bf3c5f5923b33e43ddd6b24b5616288ff4f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 14 Apr 2017 21:55:37 +0100
Subject: add functions to send entity updates imediatly, except for avatars
(or now) they should be use to bypass normal delayed updates, for debug
---
OpenSim/Framework/IClientAPI.cs | 10 ++--
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 64 +++++++++++++++++++---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 45 +++++++++++++--
.../Server/IRCClientView.cs | 7 ++-
.../Region/OptionalModules/World/NPC/NPCAvatar.cs | 6 +-
OpenSim/Tests/Common/Mock/TestClient.cs | 6 +-
6 files changed, 119 insertions(+), 19 deletions(-)
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index ab6d58f..6cb37b2 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -685,9 +685,10 @@ namespace OpenSim.Framework
ExtraData = 1 << 20,
Sound = 1 << 21,
Joint = 1 << 22,
- FullUpdate = 0x3fffffff,
- CancelKill = 0x7fffffff,
- Kill = 0x80000000
+ FullUpdate = 0x0fffffff,
+ SendInTransit = 1 << 30,
+ CancelKill = 0x4fffffff, // 1 << 31
+ Kill = 0x80000000 // 1 << 32
}
/* included in .net 4.0
@@ -1187,7 +1188,8 @@ namespace OpenSim.Framework
void SetAgentThrottleSilent(int throttle, int setting);
int GetAgentThrottleSilent(int throttle);
- void SendAvatarDataImmediate(ISceneEntity avatar);
+ void SendEntityFullUpdateImmediate(ISceneEntity entity);
+ void SendEntityTerseUpdateImmediate(ISceneEntity entity);
///
/// Send a positional, velocity, etc. update to the viewer for a given entity.
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 410ac00..4c77c18 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3950,24 +3950,68 @@ namespace OpenSim.Region.ClientStack.LindenUDP
///
/// Send an ObjectUpdate packet with information about an avatar
///
- public void SendAvatarDataImmediate(ISceneEntity avatar)
+ public void SendEntityFullUpdateImmediate(ISceneEntity ent)
{
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Sending immediate object update for avatar {0} {1} to {2} {3}",
// avatar.Name, avatar.UUID, Name, AgentId);
- ScenePresence presence = avatar as ScenePresence;
- if (presence == null)
+ if (ent == null)
return;
ObjectUpdatePacket objupdate = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
objupdate.Header.Zerocoded = true;
- objupdate.RegionData.RegionHandle = presence.RegionHandle;
-// objupdate.RegionData.TimeDilation = ushort.MaxValue;
objupdate.RegionData.TimeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
- objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence);
+
+ if(ent is ScenePresence)
+ {
+ ScenePresence presence = ent as ScenePresence;
+ objupdate.RegionData.RegionHandle = presence.RegionHandle;
+ objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence);
+ }
+ else if(ent is SceneObjectPart)
+ {
+ SceneObjectPart part = ent as SceneObjectPart;
+ objupdate.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
+ objupdate.ObjectData[0] = CreatePrimUpdateBlock(part, (ScenePresence)SceneAgent);
+ }
+
+ OutPacket(objupdate, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
+
+ // We need to record the avatar local id since the root prim of an attachment points to this.
+// m_attachmentsSent.Add(avatar.LocalId);
+ }
+
+ public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
+ {
+// m_log.DebugFormat(
+// "[LLCLIENTVIEW]: Sending immediate object update for avatar {0} {1} to {2} {3}",
+// avatar.Name, avatar.UUID, Name, AgentId);
+
+ if (ent == null)
+ return;
+
+ ImprovedTerseObjectUpdatePacket objupdate =
+ (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
+ objupdate.Header.Zerocoded = true;
+
+ objupdate.RegionData.TimeDilation = Utils.FloatToUInt16(m_scene.TimeDilation, 0.0f, 1.0f);
+ objupdate.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
+
+ if(ent is ScenePresence)
+ {
+ ScenePresence presence = ent as ScenePresence;
+ objupdate.RegionData.RegionHandle = presence.RegionHandle;
+ objupdate.ObjectData[0] = CreateImprovedTerseBlock(ent, false);
+ }
+ else if(ent is SceneObjectPart)
+ {
+ SceneObjectPart part = ent as SceneObjectPart;
+ objupdate.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
+ objupdate.ObjectData[0] = CreateImprovedTerseBlock(ent, false);
+ }
OutPacket(objupdate, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
@@ -4021,7 +4065,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Primitive Packet/Data Sending Methods
-
///
/// Generate one of the object update packets based on PrimUpdateFlags
/// and broadcast the packet to clients
@@ -4157,8 +4200,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
SceneObjectPart part = (SceneObjectPart)update.Entity;
SceneObjectGroup grp = part.ParentGroup;
- if (grp.inTransit)
+ if (grp.inTransit && !update.Flags.HasFlag(PrimUpdateFlags.SendInTransit))
continue;
+ if (update.Flags.HasFlag(PrimUpdateFlags.SendInTransit))
+ {
+
+
+ }
if (grp.IsDeleted)
{
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a5af7e1..d50de27 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1778,6 +1778,20 @@ namespace OpenSim.Region.Framework.Scenes
private Dictionary m_knownChildRegionsSizeInfo = new Dictionary();
+ public void AddNeighbourRegion(GridRegion region, string capsPath)
+ {
+ lock (m_knownChildRegions)
+ {
+ ulong regionHandle = region.RegionHandle;
+ m_knownChildRegions.Add(regionHandle,capsPath);
+
+ spRegionSizeInfo sizeInfo = new spRegionSizeInfo();
+ sizeInfo.sizeX = region.RegionSizeX;
+ sizeInfo.sizeY = region.RegionSizeY;
+ m_knownChildRegionsSizeInfo[regionHandle] = sizeInfo;
+ }
+ }
+
public void AddNeighbourRegionSizeInfo(GridRegion region)
{
lock (m_knownChildRegions)
@@ -1826,6 +1840,12 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ public bool knowsNeighbourRegion(ulong regionHandle)
+ {
+ lock (m_knownChildRegions)
+ return m_knownChildRegions.ContainsKey(regionHandle);
+ }
+
public void DropOldNeighbours(List oldRegions)
{
foreach (ulong handle in oldRegions)
@@ -2010,6 +2030,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
+
m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
if(!haveGroupInformation && !IsChildAgent && !IsNPC)
@@ -2069,6 +2090,16 @@ namespace OpenSim.Region.Framework.Scenes
if (!IsChildAgent)
{
+ if( ParentPart != null && !IsNPC && (crossingFlags & 0x08) != 0)
+ {
+
+// SceneObjectPart root = ParentPart.ParentGroup.RootPart;
+// if(root.LocalId != ParentPart.LocalId)
+// ControllingClient.SendEntityTerseUpdateImmediate(root);
+// ControllingClient.SendEntityTerseUpdateImmediate(ParentPart);
+ ParentPart.ParentGroup.SendFullUpdateToClient(ControllingClient);
+ }
+
// verify baked textures and cache
bool cachedbaked = false;
@@ -2130,6 +2161,7 @@ namespace OpenSim.Region.Framework.Scenes
// send avatar object to all presences including us, so they cross it into region
// then hide if necessary
+
SendInitialAvatarDataToAllAgents(allpresences);
// send this look
@@ -2237,13 +2269,18 @@ namespace OpenSim.Region.Framework.Scenes
m_lastChildAgentUpdateDrawDistance = DrawDistance;
m_lastChildAgentUpdatePosition = AbsolutePosition;
m_childUpdatesBusy = false; // allow them
+
+
}
m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
+
+
// send the rest of the world
if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide)
SendInitialDataToMe();
+
// priority uses avatar position only
// m_reprioritizationLastPosition = AbsolutePosition;
@@ -3979,7 +4016,7 @@ namespace OpenSim.Region.Framework.Scenes
int count = 0;
foreach (ScenePresence p in presences)
{
- p.ControllingClient.SendAvatarDataImmediate(this);
+ p.ControllingClient.SendEntityFullUpdateImmediate(this);
if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
// either just kill the object
// p.ControllingClient.SendKillObject(new List {LocalId});
@@ -3992,7 +4029,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendInitialAvatarDataToAgent(ScenePresence p)
{
- p.ControllingClient.SendAvatarDataImmediate(this);
+ p.ControllingClient.SendEntityFullUpdateImmediate(this);
if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod)
// either just kill the object
// p.ControllingClient.SendKillObject(new List {LocalId});
@@ -4009,12 +4046,12 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID);
if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.IsViewerUIGod)
return;
- avatar.ControllingClient.SendAvatarDataImmediate(this);
+ avatar.ControllingClient.SendEntityFullUpdateImmediate(this);
}
public void SendAvatarDataToAgentNF(ScenePresence avatar)
{
- avatar.ControllingClient.SendAvatarDataImmediate(this);
+ avatar.ControllingClient.SendEntityFullUpdateImmediate(this);
}
///
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 83b534b..d39c224 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1097,7 +1097,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
}
- public void SendAvatarDataImmediate(ISceneEntity avatar)
+ public void SendEntityFullUpdateImmediate(ISceneEntity ent)
+ {
+
+ }
+
+ public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
{
}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 6a7c735..151a202 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -813,7 +813,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{
}
- public void SendAvatarDataImmediate(ISceneEntity avatar)
+ public void SendEntityFullUpdateImmediate(ISceneEntity avatar)
+ {
+ }
+
+ public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
{
}
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index e2f57b5..a835925 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -760,7 +760,11 @@ namespace OpenSim.Tests.Common
{
}
- public void SendAvatarDataImmediate(ISceneEntity avatar)
+ public void SendEntityFullUpdateImmediate(ISceneEntity ent)
+ {
+ }
+
+ public void SendEntityTerseUpdateImmediate(ISceneEntity ent)
{
}
--
cgit v1.1
From 73be6cb269527348a2f1be7c74eac7b5145d583a Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 14 Apr 2017 22:02:40 +0100
Subject: increase the updates priority of linkset where avatar is sitting
---
OpenSim/Region/Framework/Scenes/Prioritizer.cs | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index cbf40c8..53ca849 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -172,14 +172,22 @@ namespace OpenSim.Region.Framework.Scenes
if (entity is SceneObjectPart)
{
+ SceneObjectGroup sog = ((SceneObjectPart)entity).ParentGroup;
// Attachments are high priority,
- if (((SceneObjectPart)entity).ParentGroup.IsAttachment)
+ if (sog.IsAttachment)
return 2;
+
+
+ if(presence.ParentPart != null)
+ {
+ if(presence.ParentPart.ParentGroup == sog)
+ return 2;
+ }
pqueue = ComputeDistancePriority(client, entity, false);
// Non physical prims are lower priority than physical prims
- PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
+ PhysicsActor physActor = sog.RootPart.PhysActor;
if (physActor == null || !physActor.IsPhysical)
pqueue++;
}
@@ -302,6 +310,17 @@ namespace OpenSim.Region.Framework.Scenes
else
{
SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
+ if(presence.ParentPart != null)
+ {
+ if(presence.ParentPart.ParentGroup == group)
+ return pqueue;
+ }
+ if(group.IsAttachment)
+ {
+ if(group.RootPart.LocalId == presence.LocalId)
+ return pqueue;
+ }
+
float bradius = group.GetBoundsRadius();
Vector3 grppos = group.AbsolutePosition + group.getBoundsCenter();
distance = Vector3.Distance(presencePos, grppos);
--
cgit v1.1
From 4f8f04d9499f040631a4056dfd11aa2ff95761dd Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 15 Apr 2017 01:21:47 +0100
Subject: still issues with volume detectors and sleeping bodies
---
OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 14 ++++---
OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 50 ++++++++++++++++---------
2 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 98bea09..f8ee6c0 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -1210,14 +1210,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (m_cureventsubscription < 50000)
m_cureventsubscription += timestep;
+ if(CollisionVDTCEventsThisFrame != null && CollisionVDTCEventsThisFrame.Count >0 && (Body == IntPtr.Zero || d.BodyIsEnabled(Body)))
+ CollisionVDTCEventsThisFrame.Clear();
+
+ if (m_cureventsubscription < m_eventsubscription)
+ return;
+
if (CollisionEventsThisFrame == null)
return;
int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count;
- if (m_cureventsubscription < m_eventsubscription)
- return;
-
if (!SentEmptyCollisionsEvent || ncolisions > 0)
{
base.SendCollisionUpdate(CollisionEventsThisFrame);
@@ -1234,8 +1237,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
CollisionEventsThisFrame.Clear();
}
}
- if(CollisionVDTCEventsThisFrame != null && (Body == IntPtr.Zero || d.BodyIsEnabled(Body)))
- CollisionVDTCEventsThisFrame.Clear();
}
public override bool SubscribedEvents()
@@ -2938,7 +2939,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z);
_position = newPos;
- m_bodyMoveCoolDown = -5;
+ if (Body != IntPtr.Zero && !m_disabled)
+ m_bodyMoveCoolDown = -5;
}
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
{
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index 4a82f77..883038f 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -1668,11 +1668,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde
// d.WorldSetQuickStepNumIterations(world, curphysiteractions);
- int loopstartMS = Util.EnvironmentTickCount();
- int looptimeMS = 0;
- int changestimeMS = 0;
- int maxChangestime = (int)(reqTimeStep * 500f); // half the time
- int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time
+ double loopstartMS = Util.GetTimeStampMS();
+ double looptimeMS = 0;
+ double changestimeMS = 0;
+ double maxChangestime = (int)(reqTimeStep * 500f); // half the time
+ double maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time
+
+// double collisionTime = 0;
+// double qstepTIme = 0;
+// double tmpTime = 0;
d.AllocateODEDataForThread(~0U);
@@ -1695,7 +1699,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
item.actor.Name, item.what.ToString());
}
}
- changestimeMS = Util.EnvironmentTickCountSubtract(loopstartMS);
+ changestimeMS = Util.GetTimeStampMS() - loopstartMS;
if (changestimeMS > maxChangestime)
break;
}
@@ -1740,9 +1744,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_rayCastManager.ProcessQueuedRequests();
+// tmpTime = Util.GetTimeStampMS();
collision_optimized();
- List sleepers = new List();
+// collisionTime += Util.GetTimeStampMS() - tmpTime;
+
+ lock(_collisionEventPrimRemove)
+ {
+ foreach (PhysicsActor obj in _collisionEventPrimRemove)
+ _collisionEventPrim.Remove(obj);
+
+ _collisionEventPrimRemove.Clear();
+ }
+ List sleepers = new List();
foreach (PhysicsActor obj in _collisionEventPrim)
{
if (obj == null)
@@ -1772,18 +1786,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
foreach(OdePrim prm in sleepers)
prm.SleeperAddCollisionEvents();
sleepers.Clear();
-
- lock(_collisionEventPrimRemove)
- {
- foreach (PhysicsActor obj in _collisionEventPrimRemove)
- _collisionEventPrim.Remove(obj);
-
- _collisionEventPrimRemove.Clear();
- }
-
+
// do a ode simulation step
+// tmpTime = Util.GetTimeStampMS();
d.WorldQuickStep(world, ODE_STEPSIZE);
d.JointGroupEmpty(contactgroup);
+// qstepTIme += Util.GetTimeStampMS() - tmpTime;
// update managed ideia of physical data and do updates to core
/*
@@ -1824,7 +1832,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
step_time -= ODE_STEPSIZE;
nodeframes++;
- looptimeMS = Util.EnvironmentTickCountSubtract(loopstartMS);
+ looptimeMS = Util.GetTimeStampMS() - loopstartMS;
if (looptimeMS > maxLoopTime)
break;
}
@@ -1893,6 +1901,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
int nbodies = d.NTotalBodies;
int ngeoms = d.NTotalGeoms;
*/
+/*
+ looptimeMS /= nodeframes;
+ if(looptimeMS > 0.080)
+ {
+ collisionTime /= nodeframes;
+ qstepTIme /= nodeframes;
+ }
+*/
// Finished with all sim stepping. If requested, dump world state to file for debugging.
// TODO: This call to the export function is already inside lock (OdeLock) - but is an extra lock needed?
// TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots?
--
cgit v1.1
From 156ef0bbe37ae97c2ec75ddbb2662edc2156dbda Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 15 Apr 2017 02:48:58 +0100
Subject: still issues with volume detectors and sleeping bodies
---
OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 8 ++++++--
OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index f8ee6c0..0d8eeec 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -1205,13 +1205,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
}
+ internal void clearSleeperCollisions()
+ {
+ if(CollisionVDTCEventsThisFrame != null && CollisionVDTCEventsThisFrame.Count >0 )
+ CollisionVDTCEventsThisFrame.Clear();
+ }
+
public void SendCollisions(int timestep)
{
if (m_cureventsubscription < 50000)
m_cureventsubscription += timestep;
- if(CollisionVDTCEventsThisFrame != null && CollisionVDTCEventsThisFrame.Count >0 && (Body == IntPtr.Zero || d.BodyIsEnabled(Body)))
- CollisionVDTCEventsThisFrame.Clear();
if (m_cureventsubscription < m_eventsubscription)
return;
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index 883038f..a4c3f92 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -1172,6 +1172,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
aprim.CollisionScore = 0;
aprim.IsColliding = false;
+ if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body))
+ aprim.clearSleeperCollisions();
}
}
lock (_activegroups)
--
cgit v1.1
From 0f7ffc56cee22aa95af58d19d3ea2193cea07340 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 15 Apr 2017 10:46:18 +0100
Subject: several changes for osTeleportObject
---
OpenSim/Framework/IClientAPI.cs | 8 +-
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 14 +-
.../EntityTransfer/EntityTransferModule.cs | 92 ++++-
.../Region/Framework/Scenes/SceneObjectGroup.cs | 407 ++++++++++++++-------
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 35 +-
OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 43 ++-
.../Shared/Api/Implementation/OSSL_Api.cs | 8 +-
.../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 3 +-
.../Shared/Api/Runtime/LSL_Constants.cs | 2 +-
.../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 4 +-
10 files changed, 413 insertions(+), 203 deletions(-)
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 6cb37b2..5ca8c88 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -685,10 +685,10 @@ namespace OpenSim.Framework
ExtraData = 1 << 20,
Sound = 1 << 21,
Joint = 1 << 22,
- FullUpdate = 0x0fffffff,
- SendInTransit = 1 << 30,
- CancelKill = 0x4fffffff, // 1 << 31
- Kill = 0x80000000 // 1 << 32
+ FullUpdate = 0x0fffffff,
+ SendInTransit = 0x20000000,
+ CancelKill = 0x4fffffff, // 1 << 30
+ Kill = 0x80000000 // 1 << 31
}
/* included in .net 4.0
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 4c77c18..dc8d267 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -4087,10 +4087,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
*/
if (entity is SceneObjectPart)
{
- SceneObjectPart e = (SceneObjectPart)entity;
- SceneObjectGroup g = e.ParentGroup;
+ SceneObjectPart p = (SceneObjectPart)entity;
+ SceneObjectGroup g = p.ParentGroup;
if (g.HasPrivateAttachmentPoint && g.OwnerID != AgentId)
return; // Don't send updates for other people's HUDs
+
+ if((updateFlags ^ PrimUpdateFlags.SendInTransit) == 0)
+ {
+ List partIDs = (new List {p.LocalId});
+ lock (m_entityProps.SyncRoot)
+ m_entityProps.Remove(partIDs);
+ lock (m_entityUpdates.SyncRoot)
+ m_entityUpdates.Remove(partIDs);
+ return;
+ }
}
//double priority = m_prioritizer.GetUpdatePriority(this, entity);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 92485a1..87b76dc 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1703,11 +1703,81 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return agent;
}
+ public bool CrossAgentCreateFarChild(ScenePresence agent, GridRegion neighbourRegion, Vector3 pos, EntityTransferContext ctx)
+ {
+ ulong regionhandler = neighbourRegion.RegionHandle;
+
+ if(agent.knowsNeighbourRegion(regionhandler))
+ return true;
+
+ string reason;
+ ulong currentRegionHandler = agent.Scene.RegionInfo.RegionHandle;
+ GridRegion source = new GridRegion(agent.Scene.RegionInfo);
+
+ AgentCircuitData currentAgentCircuit =
+ agent.Scene.AuthenticateHandler.GetAgentCircuitData(agent.ControllingClient.CircuitCode);
+ AgentCircuitData agentCircuit = agent.ControllingClient.RequestClientInfo();
+ agentCircuit.startpos = pos;
+ agentCircuit.child = true;
+
+ agentCircuit.Appearance = new AvatarAppearance();
+ agentCircuit.Appearance.AvatarHeight = agent.Appearance.AvatarHeight;
+
+ if (currentAgentCircuit != null)
+ {
+ agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs;
+ agentCircuit.IPAddress = currentAgentCircuit.IPAddress;
+ agentCircuit.Viewer = currentAgentCircuit.Viewer;
+ agentCircuit.Channel = currentAgentCircuit.Channel;
+ agentCircuit.Mac = currentAgentCircuit.Mac;
+ agentCircuit.Id0 = currentAgentCircuit.Id0;
+ }
+
+ agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
+ agent.AddNeighbourRegion(neighbourRegion, agentCircuit.CapsPath);
+
+ IPEndPoint endPoint = neighbourRegion.ExternalEndPoint;
+ if (Scene.SimulationService.CreateAgent(source, neighbourRegion, agentCircuit, (int)TeleportFlags.Default, ctx, out reason))
+ {
+ string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
+ int newSizeX = neighbourRegion.RegionSizeX;
+ int newSizeY = neighbourRegion.RegionSizeY;
+
+ if (m_eqModule != null)
+ {
+ #region IP Translation for NAT
+ IClientIPEndpoint ipepClient;
+ if (agent.ClientView.TryGet(out ipepClient))
+ endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
+
+ m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " +
+ "and EstablishAgentCommunication with seed cap {8}", LogHeader,
+ source.RegionName, agent.Name,
+ neighbourRegion.RegionName, neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, newSizeX, newSizeY , capsPath);
+
+ m_eqModule.EnableSimulator(regionhandler,
+ endPoint, agent.UUID, newSizeX, newSizeY);
+ m_eqModule.EstablishAgentCommunication(agent.UUID, endPoint, capsPath,
+ regionhandler, newSizeX, newSizeY);
+ }
+ else
+ {
+ agent.ControllingClient.InformClientOfNeighbour(regionhandler, endPoint);
+ }
+ return true;
+ }
+ agent.RemoveNeighbourRegion(regionhandler);
+ return false;
+ }
+
public bool CrossAgentIntoNewRegionMain(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx)
{
int ts = Util.EnvironmentTickCount();
+ bool sucess = true;
+ string reason = String.Empty;
try
{
+
AgentData cAgent = new AgentData();
agent.CopyTo(cAgent,true);
@@ -1725,18 +1795,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Beyond this point, extra cleanup is needed beyond removing transit state
m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.Transferring);
- if (!agent.Scene.SimulationService.UpdateAgent(neighbourRegion, cAgent, ctx))
+ if (sucess && !agent.Scene.SimulationService.UpdateAgent(neighbourRegion, cAgent, ctx))
+ {
+ sucess = false;
+ reason = "agent update failed";
+ }
+
+ if(!sucess)
{
// region doesn't take it
m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);
m_log.WarnFormat(
- "[ENTITY TRANSFER MODULE]: Region {0} would not accept update for agent {1} on cross attempt. Returning to original region.",
- neighbourRegion.RegionName, agent.Name);
+ "[ENTITY TRANSFER MODULE]: agent {0} crossing to {1} failed: {2}",
+ agent.Name, neighbourRegion.RegionName, reason);
ReInstantiateScripts(agent);
if(agent.ParentID == 0 && agent.ParentUUID == UUID.Zero)
+ {
agent.AddToPhysicalScene(isFlying);
+ }
return false;
}
@@ -1777,7 +1855,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
- Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
+ Vector3 vel2 = Vector3.Zero;
+ if((agent.crossingFlags & 2) != 0)
+ vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
if (m_eqModule != null)
{
@@ -1804,7 +1884,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// this may need the attachments
- agent.HasMovedAway(true);
+ agent.HasMovedAway((agent.crossingFlags & 8) == 0);
agent.MakeChildAgent(neighbourRegion.RegionHandle);
@@ -2135,7 +2215,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.Scene.RegionInfo.WorldLocY - neighbour.RegionLocY,
0f);
}
-
+ #endregion
#region NotFoundLocationCache class
// A collection of not found locations to make future lookups 'not found' lookups quick.
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index af70848..0e7ac58 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -538,7 +538,7 @@ namespace OpenSim.Region.Framework.Scenes
public bool inTransit = false;
- public delegate SceneObjectGroup SOGCrossDelegate(SceneObjectGroup sog,Vector3 pos);
+ private delegate SceneObjectGroup SOGCrossDelegate(SceneObjectGroup sog,Vector3 pos, TeleportObjectData tpData);
///
/// The absolute position of this scene object in the scene
@@ -560,7 +560,7 @@ namespace OpenSim.Region.Framework.Scenes
{
inTransit = true;
SOGCrossDelegate d = CrossAsync;
- d.BeginInvoke(this, val, CrossAsyncCompleted, d);
+ d.BeginInvoke(this, val, null, CrossAsyncCompleted, d);
}
return;
}
@@ -601,7 +601,6 @@ namespace OpenSim.Region.Framework.Scenes
av.sitSOGmoved();
}
-
// now that position is changed tell it to scripts
if (triggerScriptEvent)
{
@@ -617,64 +616,75 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public SceneObjectGroup CrossAsync(SceneObjectGroup sog, Vector3 val)
+ private SceneObjectGroup CrossAsync(SceneObjectGroup sog, Vector3 val, TeleportObjectData tpdata)
{
Scene sogScene = sog.m_scene;
- IEntityTransferModule entityTransfer = sogScene.RequestModuleInterface();
+ SceneObjectPart root = sog.RootPart;
- Vector3 newpos = Vector3.Zero;
- OpenSim.Services.Interfaces.GridRegion destination = null;
+ bool isTeleport = tpdata != null;
- if (sog.RootPart.DIE_AT_EDGE)
+ if(!isTeleport)
{
- try
- {
- sogScene.DeleteSceneObject(sog, false);
- }
- catch (Exception)
+ if (root.DIE_AT_EDGE)
{
- m_log.Warn("[SCENE]: exception when trying to remove the prim that crossed the border.");
+ try
+ {
+ sogScene.DeleteSceneObject(sog, false);
+ }
+ catch (Exception)
+ {
+ m_log.Warn("[SCENE]: exception when trying to remove the prim that crossed the border.");
+ }
+ return sog;
}
- return sog;
- }
- if (sog.RootPart.RETURN_AT_EDGE)
- {
- // We remove the object here
- try
+ if (root.RETURN_AT_EDGE)
{
- List localIDs = new List();
- localIDs.Add(sog.RootPart.LocalId);
- sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition,
- "Returned at region cross");
- sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero, false);
- }
- catch (Exception)
- {
- m_log.Warn("[SCENE]: exception when trying to return the prim that crossed the border.");
+ // We remove the object here
+ try
+ {
+ List localIDs = new List();
+ localIDs.Add(root.LocalId);
+ sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition,
+ "Returned at region cross");
+ sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero, false);
+ }
+ catch (Exception)
+ {
+ m_log.Warn("[SCENE]: exception when trying to return the prim that crossed the border.");
+ }
+ return sog;
}
- return sog;
}
- if (sog.m_rootPart.KeyframeMotion != null)
- sog.m_rootPart.KeyframeMotion.StartCrossingCheck();
+ if (root.KeyframeMotion != null)
+ root.KeyframeMotion.StartCrossingCheck();
+
+ if(root.PhysActor != null)
+ root.PhysActor.CrossingStart();
+
+ IEntityTransferModule entityTransfer = sogScene.RequestModuleInterface();
if (entityTransfer == null)
return sog;
+ Vector3 newpos = Vector3.Zero;
+ OpenSim.Services.Interfaces.GridRegion destination = null;
+
destination = entityTransfer.GetObjectDestination(sog, val, out newpos);
if (destination == null)
return sog;
if (sog.m_sittingAvatars.Count == 0)
{
- entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, true, true);
+ entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, !isTeleport, true);
return sog;
}
string reason = String.Empty;
EntityTransferContext ctx = new EntityTransferContext();
+ Vector3 curPos = root.GroupPosition;
foreach (ScenePresence av in sog.m_sittingAvatars)
{
// We need to cross these agents. First, let's find
@@ -685,10 +695,15 @@ namespace OpenSim.Region.Framework.Scenes
// We set the avatar position as being the object
// position to get the region to send to
+ if(av.IsNPC)
+ continue;
+
+ if(av.IsInTransit)
+ return sog;
+
if(!entityTransfer.checkAgentAccessToRegion(av, destination, newpos, ctx, out reason))
- {
return sog;
- }
+
m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
}
@@ -696,8 +711,10 @@ namespace OpenSim.Region.Framework.Scenes
// be made to stand up
List avsToCross = new List();
-
- foreach (ScenePresence av in sog.m_sittingAvatars)
+ List avsToCrossFar = new List();
+ ulong destHandle = destination.RegionHandle;
+ List sittingAvatars = GetSittingAvatars();
+ foreach (ScenePresence av in sittingAvatars)
{
byte cflags = 1;
@@ -711,68 +728,175 @@ namespace OpenSim.Region.Framework.Scenes
else
cflags = 3;
}
+ if(!av.knowsNeighbourRegion(destHandle))
+ cflags |= 8;
// 1 is crossing
// 2 is sitting
// 4 is sitting at sittarget
- av.crossingFlags = cflags;
+ // 8 far crossing
avinfo.av = av;
avinfo.ParentID = av.ParentID;
avsToCross.Add(avinfo);
+ if(!av.knowsNeighbourRegion(destHandle))
+ {
+ cflags |= 8;
+ avsToCrossFar.Add(av);
+ }
+
+ if(av.IsNPC)
+ av.crossingFlags = 0;
+ else
+ av.crossingFlags = cflags;
+
av.PrevSitOffset = av.OffsetPosition;
av.ParentID = 0;
}
+ Vector3 vel = root.Velocity;
+ Vector3 avel = root.AngularVelocity;
+ Vector3 acc = root.Acceleration;
+ Quaternion ori = root.RotationOffset;
+
+ if(isTeleport)
+ {
+ root.Stop();
+ sogScene.ForEachScenePresence(delegate(ScenePresence av)
+ {
+ av.ControllingClient.SendEntityUpdate(root,PrimUpdateFlags.SendInTransit);
+ av.ControllingClient.SendEntityTerseUpdateImmediate(root);
+ });
+
+ root.Velocity = tpdata.vel;
+ root.AngularVelocity = tpdata.avel;
+ root.Acceleration = tpdata.acc;
+ root.RotationOffset = tpdata.ori;
+ }
+
if (entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, true, false))
{
+ if(isTeleport)
+ {
+ sogScene.ForEachScenePresence(delegate(ScenePresence oav)
+ {
+ if(sittingAvatars.Contains(oav))
+ return;
+ if(oav.knowsNeighbourRegion(destHandle))
+ return;
+ oav.ControllingClient.SendEntityUpdate(root, PrimUpdateFlags.Kill);
+ foreach (ScenePresence sav in sittingAvatars)
+ {
+ sav.SendKillTo(oav);
+ }
+ });
+ }
+ bool crossedfar = false;
+ foreach (ScenePresence av in avsToCrossFar)
+ {
+ if(entityTransfer.CrossAgentCreateFarChild(av,destination, newpos, ctx))
+ crossedfar = true;
+ else
+ av.crossingFlags = 0;
+ }
+
+ if(crossedfar)
+ Thread.Sleep(1000);
+
foreach (avtocrossInfo avinfo in avsToCross)
{
ScenePresence av = avinfo.av;
- if (!av.IsInTransit) // just in case...
- {
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
+ av.IsInTransit = true;
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
- av.IsInTransit = true;
+ if(av.crossingFlags > 0)
+ entityTransfer.CrossAgentToNewRegionAsync(av, newpos, destination, false, ctx);
-// CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
-// d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
- entityTransfer.CrossAgentToNewRegionAsync(av, newpos, destination, av.Flying, ctx);
- if (av.IsChildAgent)
- {
- // avatar crossed do some extra cleanup
- if (av.ParentUUID != UUID.Zero)
- {
- av.ClearControls();
- av.ParentPart = null;
- }
- }
- else
+ if (av.IsChildAgent)
+ {
+ // avatar crossed do some extra cleanup
+ if (av.ParentUUID != UUID.Zero)
{
- // avatar cross failed we need do dedicated standUp
- // part of it was done at CrossAgentToNewRegionAsync
- // so for now just remove the sog controls
- // this may need extra care
- av.UnRegisterSeatControls(sog.UUID);
+ av.ClearControls();
+ av.ParentPart = null;
}
-
av.ParentUUID = UUID.Zero;
+ av.ParentPart = null;
// In any case
av.IsInTransit = false;
av.crossingFlags = 0;
m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", av.Firstname, av.Lastname);
}
else
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar already in transit {0} to {1}", av.Name, val);
+ {
+ // avatar cross failed we need do dedicated standUp
+ // part of it was done at CrossAgentToNewRegionAsync
+ // so for now just remove the sog controls
+ // this may need extra care
+ av.UnRegisterSeatControls(sog.UUID);
+ av.ParentUUID = UUID.Zero;
+ av.ParentPart = null;
+ Vector3 oldp = curPos;
+ oldp.X = Util.Clamp(oldp.X, 0.5f, sog.m_scene.RegionInfo.RegionSizeX - 0.5f);
+ oldp.Y = Util.Clamp(oldp.Y, 0.5f, sog.m_scene.RegionInfo.RegionSizeY - 0.5f);
+ av.AbsolutePosition = oldp;
+ av.crossingFlags = 0;
+ av.sitAnimation = "SIT";
+ av.IsInTransit = false;
+ if(av.Animator!= null)
+ av.Animator.SetMovementAnimations("STAND");
+ av.AddToPhysicalScene(false);
+ sogScene.ForEachScenePresence(delegate(ScenePresence oav)
+ {
+ if(sittingAvatars.Contains(oav))
+ return;
+ if(oav.knowsNeighbourRegion(destHandle))
+ av.SendAvatarDataToAgent(oav);
+ else
+ {
+ av.SendAvatarDataToAgent(oav);
+ av.SendAppearanceToAgent(oav);
+ if (av.Animator != null)
+ av.Animator.SendAnimPackToClient(oav.ControllingClient);
+ av.SendAttachmentsToAgentNF(oav); // not ok
+ }
+ });
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} failed.", av.Firstname, av.Lastname);
+ }
}
+
+ if(crossedfar)
+ {
+ Thread.Sleep(10000);
+ foreach (ScenePresence av in avsToCrossFar)
+ {
+ if(av.IsChildAgent)
+ {
+ av.Scene.CloseAgent(av.UUID, false);
+ }
+ else
+ av.RemoveNeighbourRegion(destHandle);
+ }
+ }
+ avsToCrossFar.Clear();
avsToCross.Clear();
sog.RemoveScriptInstances(true);
sog.Clear();
return sog;
}
- else // cross failed, put avas back ??
+ else
{
+ if(isTeleport)
+ {
+ if((tpdata.flags & OSTPOBJ_STOPONFAIL) == 0)
+ {
+ root.Velocity = vel;
+ root.AngularVelocity = avel;
+ root.Acceleration = acc;
+ }
+ root.RotationOffset = ori;
+ }
foreach (avtocrossInfo avinfo in avsToCross)
{
ScenePresence av = avinfo.av;
@@ -782,7 +906,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
avsToCross.Clear();
-
return sog;
}
@@ -794,11 +917,14 @@ namespace OpenSim.Region.Framework.Scenes
if (!sog.IsDeleted)
{
SceneObjectPart rootp = sog.m_rootPart;
+
Vector3 oldp = rootp.GroupPosition;
oldp.X = Util.Clamp(oldp.X, 0.5f, sog.m_scene.RegionInfo.RegionSizeX - 0.5f);
oldp.Y = Util.Clamp(oldp.Y, 0.5f, sog.m_scene.RegionInfo.RegionSizeY - 0.5f);
rootp.GroupPosition = oldp;
+ rootp.Stop();
+
SceneObjectPart[] parts = sog.m_parts.GetArray();
foreach (SceneObjectPart part in parts)
@@ -812,57 +938,37 @@ namespace OpenSim.Region.Framework.Scenes
av.sitSOGmoved();
}
- sog.Velocity = Vector3.Zero;
-
if (sog.m_rootPart.KeyframeMotion != null)
sog.m_rootPart.KeyframeMotion.CrossingFailure();
if (sog.RootPart.PhysActor != null)
- {
sog.RootPart.PhysActor.CrossingFailure();
- }
sog.inTransit = false;
+ AttachToBackup();
sog.ScheduleGroupForFullUpdate();
}
}
-/* outdated
- private void CrossAgentToNewRegionCompleted(ScenePresence agent)
+ private class TeleportObjectData
{
- //// If the cross was successful, this agent is a child agent
- if (agent.IsChildAgent)
- {
- if (agent.ParentUUID != UUID.Zero)
- {
- agent.HandleForceReleaseControls(agent.ControllingClient,agent.UUID);
- agent.ParentPart = null;
-// agent.ParentPosition = Vector3.Zero;
-// agent.ParentUUID = UUID.Zero;
- }
- }
-
- agent.ParentUUID = UUID.Zero;
-// agent.Reset();
-// else // Not successful
-// agent.RestoreInCurrentScene();
-
- // In any case
- agent.IsInTransit = false;
-
- m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
+ public int flags;
+ public Vector3 vel;
+ public Vector3 avel;
+ public Vector3 acc;
+ public Quaternion ori;
+ public UUID sourceID;
}
-*/
// copy from LSL_constants.cs
- const int OSTPOBJ_STOPATTARRGET = 0x1; // stops at destination
+ const int OSTPOBJ_STOPATTARGET = 0x1; // stops at destination
const int OSTPOBJ_STOPONFAIL = 0x2; // stops at start if tp fails
const int OSTPOBJ_SETROT = 0x4; // the rotation is the final rotation, otherwise is a added rotation
- public void TeleportObject(UUID sourceID, Vector3 targetPosition, Quaternion rotation, int flags)
+ public int TeleportObject(UUID sourceID, Vector3 targetPosition, Quaternion rotation, int flags)
{
if(inTransit || IsDeleted || IsAttachmentCheckFull() || IsSelected || Scene == null)
- return;
+ return -1;
inTransit = true;
@@ -870,7 +976,41 @@ namespace OpenSim.Region.Framework.Scenes
if(pa == null || RootPart.KeyframeMotion != null /*|| m_sittingAvatars.Count == 0*/)
{
inTransit = false;
- return;
+ return -1;
+ }
+
+ bool stop = (flags & OSTPOBJ_STOPATTARGET) != 0;
+ bool setrot = (flags & OSTPOBJ_SETROT) != 0;
+
+ rotation.Normalize();
+
+ Quaternion currentRot = RootPart.RotationOffset;
+ if(setrot)
+ rotation = Quaternion.Conjugate(currentRot) * rotation;
+
+ bool dorot = setrot | (Math.Abs(rotation.W) < 0.99999);
+
+ Vector3 vel = Vector3.Zero;
+ Vector3 avel = Vector3.Zero;
+ Vector3 acc = Vector3.Zero;
+
+ if(!stop)
+ {
+ vel = RootPart.Velocity;
+ avel = RootPart.AngularVelocity;
+ acc = RootPart.Acceleration;
+ }
+ Quaternion ori = RootPart.RotationOffset;
+
+ if(dorot)
+ {
+ if(!stop)
+ {
+ vel *= rotation;
+ avel *= rotation;
+ acc *= rotation;
+ }
+ ori *= rotation;
}
if(Scene.PositionIsInCurrentRegion(targetPosition))
@@ -878,7 +1018,7 @@ namespace OpenSim.Region.Framework.Scenes
if(Scene.InTeleportTargetsCoolDown(UUID, sourceID, 1.0))
{
inTransit = false;
- return;
+ return -2;
}
Vector3 curPos = AbsolutePosition;
@@ -891,7 +1031,7 @@ namespace OpenSim.Region.Framework.Scenes
if(!Scene.Permissions.CanObjectEnterWithScripts(this, land))
{
inTransit = false;
- return;
+ return -3;
}
UUID agentID;
@@ -901,49 +1041,15 @@ namespace OpenSim.Region.Framework.Scenes
if(land.IsRestrictedFromLand(agentID) || land.IsBannedFromLand(agentID))
{
inTransit = false;
- return;
+ return -4;
}
}
}
- bool stop = (flags & OSTPOBJ_STOPATTARRGET) != 0;
- bool setrot = (flags & OSTPOBJ_SETROT) != 0;
-
- rotation.Normalize();
- Quaternion currentRot = RootPart.RotationOffset;
-
- if(setrot)
- rotation = Quaternion.Conjugate(currentRot) * rotation;
-
- bool dorot = setrot | (Math.Abs(rotation.W) < 0.999);
-
- if(stop)
- {
- RootPart.Stop();
- }
- else
- {
- if(dorot)
- {
- Vector3 vel = RootPart.Velocity;
- Vector3 avel = RootPart.AngularVelocity;
- Vector3 acc = RootPart.Acceleration;
-
- vel *= rotation;
- avel *= rotation;
- acc *= rotation;
-
- RootPart.Velocity = vel;
- RootPart.AngularVelocity = avel;
- RootPart.Acceleration = acc;
- }
- }
-
- if(dorot)
- {
- currentRot *= rotation;
- RootPart.RotationOffset = currentRot;
- }
+ RootPart.Velocity = vel;
+ RootPart.AngularVelocity = avel;
+ RootPart.Acceleration = acc;
+ RootPart.RotationOffset = ori;
Vector3 s = RootPart.Scale * RootPart.RotationOffset;
float h = Scene.GetGroundHeight(posX, posY) + 0.5f * (float)Math.Abs(s.Z) + 0.01f;
@@ -953,10 +1059,27 @@ namespace OpenSim.Region.Framework.Scenes
inTransit = false;
AbsolutePosition = targetPosition;
RootPart.ScheduleTerseUpdate();
- return;
+ return 1;
}
- inTransit = false;
+ if(Scene.InTeleportTargetsCoolDown(UUID, sourceID, 20.0))
+ {
+ inTransit = false;
+ return -1;
+ }
+
+ TeleportObjectData tdata = new TeleportObjectData();
+ tdata.flags = flags;
+ tdata.vel = vel;
+ tdata.avel = avel;
+ tdata.acc = acc;
+ tdata.ori = ori;
+ tdata.sourceID = sourceID;
+
+
+ SOGCrossDelegate d = CrossAsync;
+ d.BeginInvoke(this, targetPosition, tdata, CrossAsyncCompleted, d);
+ return 0;
}
public override Vector3 Velocity
@@ -5398,9 +5521,9 @@ namespace OpenSim.Region.Framework.Scenes
{
if (avs[i].Name == name)
{
- GetLinkNumber_lastname = name;
- GetLinkNumber_lastnumber = j;
- return j;
+ GetLinkNumber_lastname = name;
+ GetLinkNumber_lastnumber = j;
+ return j;
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 8d04c9f..affd4de 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1066,7 +1066,7 @@ namespace OpenSim.Region.Framework.Scenes
m_angularVelocity = value;
PhysicsActor actor = PhysActor;
- if ((actor != null) && actor.IsPhysical && ParentGroup.RootPart == this && VehicleType == (int)Vehicle.TYPE_NONE)
+ if ((actor != null) && actor.IsPhysical && ParentGroup.RootPart == this)
{
actor.RotationalVelocity = m_angularVelocity;
}
@@ -1092,6 +1092,12 @@ namespace OpenSim.Region.Framework.Scenes
m_acceleration = Vector3.Zero;
else
m_acceleration = value;
+
+ PhysicsActor actor = PhysActor;
+ if ((actor != null) && actor.IsPhysical && ParentGroup.RootPart == this)
+ {
+ actor.Acceleration = m_acceleration;
+ }
}
}
@@ -2016,7 +2022,7 @@ namespace OpenSim.Region.Framework.Scenes
// SetVelocity for LSL llSetVelocity.. may need revision if having other uses in future
public void SetVelocity(Vector3 pVel, bool localGlobalTF)
{
- if (ParentGroup == null || ParentGroup.IsDeleted)
+ if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
return;
if (ParentGroup.IsAttachment)
@@ -2043,7 +2049,7 @@ namespace OpenSim.Region.Framework.Scenes
// SetAngularVelocity for LSL llSetAngularVelocity.. may need revision if having other uses in future
public void SetAngularVelocity(Vector3 pAngVel, bool localGlobalTF)
{
- if (ParentGroup == null || ParentGroup.IsDeleted)
+ if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
return;
if (ParentGroup.IsAttachment)
@@ -2077,6 +2083,9 @@ namespace OpenSim.Region.Framework.Scenes
/// true for the local frame, false for the global frame
public void ApplyAngularImpulse(Vector3 impulsei, bool localGlobalTF)
{
+ if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.inTransit)
+ return;
+
Vector3 impulse = impulsei;
if (localGlobalTF)
@@ -3376,25 +3385,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
///
public void SendFullUpdateToClient(IClientAPI remoteClient)
{
- SendFullUpdateToClient(remoteClient, OffsetPosition);
- }
-
- ///
- /// Sends a full update to the client
- ///
- ///
- ///
- public void SendFullUpdateToClient(IClientAPI remoteClient, Vector3 lPos)
- {
- if (ParentGroup == null)
- return;
-
- // Suppress full updates during attachment editing
- // sl Does send them
- // if (ParentGroup.IsSelected && ParentGroup.IsAttachment)
- // return;
-
- if (ParentGroup.IsDeleted)
+ if (ParentGroup == null || ParentGroup.IsDeleted)
return;
if (ParentGroup.IsAttachment
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 0d8eeec..bf0400b 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private Vector3 m_lastposition;
private Vector3 m_rotationalVelocity;
private Vector3 _size;
- private Vector3 _acceleration;
+ private Vector3 m_acceleration;
private IntPtr Amotor;
internal Vector3 m_force;
@@ -746,8 +746,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
public override Vector3 Acceleration
{
- get { return _acceleration; }
- set { }
+ get { return m_acceleration; }
+ set
+ {
+ if(m_outbounds)
+ m_acceleration = value;
+ }
}
public override Vector3 RotationalVelocity
@@ -767,7 +771,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
if (value.IsFinite())
{
- AddChange(changes.AngVelocity, value);
+ if(m_outbounds)
+ m_rotationalVelocity = value;
+ else
+ AddChange(changes.AngVelocity, value);
}
else
{
@@ -941,7 +948,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
public void SetAcceleration(Vector3 accel)
{
- _acceleration = accel;
+ m_acceleration = accel;
}
public override void AddForce(Vector3 force, bool pushforce)
@@ -2748,7 +2755,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_angularForceacc = Vector3.Zero;
// m_torque = Vector3.Zero;
_velocity = Vector3.Zero;
- _acceleration = Vector3.Zero;
+ m_acceleration = Vector3.Zero;
m_rotationalVelocity = Vector3.Zero;
_target_velocity = Vector3.Zero;
if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
@@ -3784,9 +3791,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_outbounds = true;
lpos.Z = Util.Clip(lpos.Z, -100f, 100000f);
- _acceleration.X = 0;
- _acceleration.Y = 0;
- _acceleration.Z = 0;
+ m_acceleration.X = 0;
+ m_acceleration.Y = 0;
+ m_acceleration.Z = 0;
_velocity.X = 0;
_velocity.Y = 0;
@@ -3915,12 +3922,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
_orientation.W = ori.W;
}
- // update velocities and aceleration
+ // update velocities and acceleration
if (_zeroFlag || lastZeroFlag)
{
// disable interpolators
_velocity = Vector3.Zero;
- _acceleration = Vector3.Zero;
+ m_acceleration = Vector3.Zero;
m_rotationalVelocity = Vector3.Zero;
}
else
@@ -3929,7 +3936,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
d.Vector3 vel = d.BodyGetLinearVel(Body);
- _acceleration = _velocity;
+ m_acceleration = _velocity;
if ((Math.Abs(vel.X) < 0.005f) &&
(Math.Abs(vel.Y) < 0.005f) &&
@@ -3937,21 +3944,21 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
_velocity = Vector3.Zero;
float t = -m_invTimeStep;
- _acceleration = _acceleration * t;
+ m_acceleration = m_acceleration * t;
}
else
{
_velocity.X = vel.X;
_velocity.Y = vel.Y;
_velocity.Z = vel.Z;
- _acceleration = (_velocity - _acceleration) * m_invTimeStep;
+ m_acceleration = (_velocity - m_acceleration) * m_invTimeStep;
}
- if ((Math.Abs(_acceleration.X) < 0.01f) &&
- (Math.Abs(_acceleration.Y) < 0.01f) &&
- (Math.Abs(_acceleration.Z) < 0.01f))
+ if ((Math.Abs(m_acceleration.X) < 0.01f) &&
+ (Math.Abs(m_acceleration.Y) < 0.01f) &&
+ (Math.Abs(m_acceleration.Z) < 0.01f))
{
- _acceleration = Vector3.Zero;
+ m_acceleration = Vector3.Zero;
}
vel = d.BodyGetAngularVel(Body);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index b3bd8c4..e12cedf 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -4664,7 +4664,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// has a cool down time. retries before expire reset it
/// fail conditions are silent ignored
///
- public void osTeleportObject(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer flags)
+ public LSL_Integer osTeleportObject(LSL_Key objectUUID, LSL_Vector targetPos, LSL_Rotation rotation, LSL_Integer flags)
{
CheckThreatLevel(ThreatLevel.Severe, "osTeleportObject");
m_host.AddScriptLPS(1);
@@ -4673,16 +4673,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!UUID.TryParse(objectUUID, out objUUID))
{
OSSLShoutError("osTeleportObject() invalid object Key");
- return;
+ return -1;
}
SceneObjectGroup sog = World.GetSceneObjectGroup(objUUID);
if(sog== null || sog.IsDeleted)
- return;
+ return -1;
UUID myid = m_host.ParentGroup.UUID;
- sog.TeleportObject(myid, targetPos, rotation, flags);
+ return sog.TeleportObject(myid, targetPos, rotation, flags);
// a delay here may break vehicles
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 08b144a..bd5d008 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -51,7 +51,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
///
public enum ThreatLevel
{
- // Not documented, presumably means permanently disabled ?
NoAccess = -1,
///
@@ -496,7 +495,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetInertiaAsSphere(LSL_Float mass, LSL_Float radius, vector centerOfMass);
void osSetInertiaAsCylinder(LSL_Float mass, LSL_Float radius, LSL_Float lenght, vector centerOfMass,rotation lslrot);
- void osTeleportObject(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer flags);
+ LSL_Integer osTeleportObject(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer flags);
LSL_Integer osGetLinkNumber(LSL_String name);
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 59493a3..ce0fa48 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -856,7 +856,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
// for osTeleportObject
public const int OSTPOBJ_NONE = 0x0;
- public const int OSTPOBJ_STOPATTARRGET = 0x1; // stops at destination
+ public const int OSTPOBJ_STOPATTARGET = 0x1; // stops at destination
public const int OSTPOBJ_STOPONFAIL = 0x2; // stops at jump point if tp fails
public const int OSTPOBJ_SETROT = 0x4; // the rotation is the final rotation, otherwise is a added rotation
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 7c08628..9eac114 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -1140,9 +1140,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osClearInertia();
}
- public void osTeleportObject(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer flags)
+ public LSL_Integer osTeleportObject(LSL_Key objectUUID, vector targetPos, rotation targetrotation, LSL_Integer flags)
{
- m_OSSL_Functions.osTeleportObject(objectUUID, targetPos, targetrotation, flags);
+ return m_OSSL_Functions.osTeleportObject(objectUUID, targetPos, targetrotation, flags);
}
public LSL_Integer osGetLinkNumber(LSL_String name)
--
cgit v1.1
From b52f7b920342b7ea3e0294eae054e7520801e339 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 15 Apr 2017 10:56:46 +0100
Subject: missing file and remove warnings
---
OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs | 2 ++
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
index 9585082..1b690ba 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
@@ -102,6 +102,8 @@ namespace OpenSim.Region.Framework.Interfaces
ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx);
+ bool CrossAgentCreateFarChild(ScenePresence agent, GridRegion neighbourRegion, Vector3 pos, EntityTransferContext ctx);
+
bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition);
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0e7ac58..e73795e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Scenes
timeLastChanged = DateTime.UtcNow.Ticks;
if (!m_hasGroupChanged)
timeFirstChanged = DateTime.UtcNow.Ticks;
- if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
+ if (m_rootPart != null && m_scene != null)
{
/*
if (m_rand == null)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index d50de27..6d4cb52 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -6488,7 +6488,7 @@ namespace OpenSim.Region.Framework.Scenes
if (check)
{
// check is relative to current parcel only
- if (currentParcelUUID == null || oldhide == currentParcelHide)
+ if (oldhide == currentParcelHide)
return;
allpresences = m_scene.GetScenePresences();
--
cgit v1.1
From 9354e60df0c4046d9010ee0e520d1b90a2836757 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 16 Apr 2017 03:39:35 +0100
Subject: fix active objects count down, a path at least
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 6b29ec1..a005068 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -549,6 +549,8 @@ namespace OpenSim.Region.Framework.Scenes
// that are part of the Scene Object being removed
m_numTotalPrim -= grp.PrimCount;
+ bool isPh = (grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics;
+ int nphysparts = 0;
// Go through all parts (primitives and meshes) of this Scene Object
foreach (SceneObjectPart part in grp.Parts)
{
@@ -559,10 +561,13 @@ namespace OpenSim.Region.Framework.Scenes
m_numMesh--;
else
m_numPrim--;
+
+ if(isPh && part.PhysicsShapeType != (byte)PhysShapeType.none)
+ nphysparts++;
}
- if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
- RemovePhysicalPrim(grp.PrimCount);
+ if (nphysparts > 0 )
+ RemovePhysicalPrim(nphysparts);
}
bool ret = Entities.Remove(uuid);
--
cgit v1.1
From 49884b94a78bcf45c25b72e1f9fae593de16864f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 18 Apr 2017 00:50:55 +0100
Subject: update ODE binaries for windows. Other platforms need to compile
from opensim-libs repo, folder ODE-OpenSim-0.13.2, read file
OPENSIM-README.txt. Remove code to reduce bounce on non physical placement,
new unmanaged should handle that
---
OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 199 ++++++++++---------------
bin/lib32/ode.dll | Bin 553472 -> 541184 bytes
bin/lib64/ode.dll | Bin 651776 -> 634880 bytes
3 files changed, 77 insertions(+), 122 deletions(-)
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index bf0400b..7b77d2f 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -111,7 +111,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
private int m_body_autodisable_frames;
public int m_bodydisablecontrol = 0;
- public int m_bodyMoveCoolDown = 0;
private float m_gravmod = 1.0f;
// Default we're a Geometry
@@ -1030,18 +1029,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde
d.AllocateODEDataForThread(0);
if(Body != IntPtr.Zero)
{
- if(m_bodyMoveCoolDown >= 0)
- {
- d.Vector3 dtmp = d.BodyGetAngularVel(Body);
- m_rotationalVelocity.X = dtmp.X;
- m_rotationalVelocity.Y = dtmp.Y;
- m_rotationalVelocity.Z = dtmp.Z;
+ d.Vector3 dtmp = d.BodyGetAngularVel(Body);
+ m_rotationalVelocity.X = dtmp.X;
+ m_rotationalVelocity.Y = dtmp.Y;
+ m_rotationalVelocity.Z = dtmp.Z;
+
+ dtmp = d.BodyGetLinearVel(Body);
+ _velocity.X = dtmp.X;
+ _velocity.Y = dtmp.Y;
+ _velocity.Z = dtmp.Z;
- dtmp = d.BodyGetLinearVel(Body);
- _velocity.X = dtmp.X;
- _velocity.Y = dtmp.Y;
- _velocity.Z = dtmp.Z;
- }
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
d.BodySetAngularVel(Body, 0, 0, 0);
}
@@ -1345,7 +1342,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
bounce = parent_scene.m_materialContactsData[(int)Material.Wood].bounce;
m_building = true; // control must set this to false when done
- m_bodyMoveCoolDown = 0;
AddChange(changes.Add, null);
@@ -2144,14 +2140,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
else
{
- /*
d.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z);
d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
- */
+
_zeroFlag = false;
m_bodydisablecontrol = 0;
}
- m_bodyMoveCoolDown = -5;
_parent_scene.addActiveGroups(this);
}
@@ -2244,7 +2238,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
m_mass = primMass;
m_collisionscore = 0;
- m_bodyMoveCoolDown = 0;
}
private void FixInertia(Vector3 NewPos,Quaternion newrot)
@@ -2907,7 +2900,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
_zeroFlag = true;
d.BodyEnable(Body);
- m_bodyMoveCoolDown = -5;
}
}
// else if (_parent != null)
@@ -2950,8 +2942,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z);
_position = newPos;
- if (Body != IntPtr.Zero && !m_disabled)
- m_bodyMoveCoolDown = -5;
}
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
{
@@ -3016,7 +3006,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
if(m_angularlocks != 0)
createAMotor(m_angularlocks);
- m_bodyMoveCoolDown = -5;
}
}
if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
@@ -3391,8 +3380,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
enableBodySoft();
else if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
- if(m_bodyMoveCoolDown >= 0)
- d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
}
//resetCollisionAccounting();
}
@@ -3416,9 +3403,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
enableBodySoft();
else if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
-
- if(m_bodyMoveCoolDown >= 0);
- d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
}
//resetCollisionAccounting();
}
@@ -3569,26 +3553,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (!childPrim && m_isphysical && Body != IntPtr.Zero &&
!m_disabled && !m_isSelected && !m_building && !m_outbounds)
{
- if(m_bodyMoveCoolDown < 0)
- {
- m_bodyMoveCoolDown++;
-// if(!IsColliding)
-// m_bodyCoolDown +=2;
- if(m_bodyMoveCoolDown >= 0)
- {
- d.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z);
- d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
- }
- else
- {
- d.BodySetAngularVel(Body, 0, 0, 0);
- d.BodySetLinearVel(Body, 0, 0, 0);
- m_forceacc = Vector3.Zero;
- m_angularForceacc = Vector3.Zero;
- _zeroFlag = false;
- return;
- }
- }
if (!d.BodyIsEnabled(Body))
{
// let vehicles sleep
@@ -3844,18 +3808,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde
m_lastposition = _position;
m_lastorientation = _orientation;
- if(m_bodyMoveCoolDown >= 0)
- {
- d.Vector3 dtmp = d.BodyGetAngularVel(Body);
- m_rotationalVelocity.X = dtmp.X;
- m_rotationalVelocity.Y = dtmp.Y;
- m_rotationalVelocity.Z = dtmp.Z;
-
- dtmp = d.BodyGetLinearVel(Body);
- _velocity.X = dtmp.X;
- _velocity.Y = dtmp.Y;
- _velocity.Z = dtmp.Z;
- }
+ d.Vector3 dtmp = d.BodyGetAngularVel(Body);
+ m_rotationalVelocity.X = dtmp.X;
+ m_rotationalVelocity.Y = dtmp.Y;
+ m_rotationalVelocity.Z = dtmp.Z;
+
+ dtmp = d.BodyGetLinearVel(Body);
+ _velocity.X = dtmp.X;
+ _velocity.Y = dtmp.Y;
+ _velocity.Z = dtmp.Z;
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
d.BodySetAngularVel(Body, 0, 0, 0);
@@ -3880,33 +3841,30 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
else
{
- if(m_bodyMoveCoolDown >= 0)
+ float poserror;
+ float angerror;
+ if(_zeroFlag)
{
- float poserror;
- float angerror;
- if(_zeroFlag)
- {
- poserror = 0.01f;
- angerror = 0.001f;
- }
- else
- {
- poserror = 0.005f;
- angerror = 0.0005f;
- }
-
- if (
- (Math.Abs(_position.X - lpos.X) < poserror)
- && (Math.Abs(_position.Y - lpos.Y) < poserror)
- && (Math.Abs(_position.Z - lpos.Z) < poserror)
- && (Math.Abs(_orientation.X - ori.X) < angerror)
- && (Math.Abs(_orientation.Y - ori.Y) < angerror)
- && (Math.Abs(_orientation.Z - ori.Z) < angerror) // ignore W
- )
- _zeroFlag = true;
- else
- _zeroFlag = false;
+ poserror = 0.01f;
+ angerror = 0.001f;
}
+ else
+ {
+ poserror = 0.005f;
+ angerror = 0.0005f;
+ }
+
+ if (
+ (Math.Abs(_position.X - lpos.X) < poserror)
+ && (Math.Abs(_position.Y - lpos.Y) < poserror)
+ && (Math.Abs(_position.Z - lpos.Z) < poserror)
+ && (Math.Abs(_orientation.X - ori.X) < angerror)
+ && (Math.Abs(_orientation.Y - ori.Y) < angerror)
+ && (Math.Abs(_orientation.Z - ori.Z) < angerror) // ignore W
+ )
+ _zeroFlag = true;
+ else
+ _zeroFlag = false;
}
// update position
@@ -3932,49 +3890,46 @@ namespace OpenSim.Region.PhysicsModule.ubOde
}
else
{
- if(m_bodyMoveCoolDown >= 0)
- {
- d.Vector3 vel = d.BodyGetLinearVel(Body);
+ d.Vector3 vel = d.BodyGetLinearVel(Body);
- m_acceleration = _velocity;
+ m_acceleration = _velocity;
- if ((Math.Abs(vel.X) < 0.005f) &&
- (Math.Abs(vel.Y) < 0.005f) &&
- (Math.Abs(vel.Z) < 0.005f))
- {
- _velocity = Vector3.Zero;
- float t = -m_invTimeStep;
- m_acceleration = m_acceleration * t;
- }
- else
- {
- _velocity.X = vel.X;
- _velocity.Y = vel.Y;
- _velocity.Z = vel.Z;
- m_acceleration = (_velocity - m_acceleration) * m_invTimeStep;
- }
+ if ((Math.Abs(vel.X) < 0.005f) &&
+ (Math.Abs(vel.Y) < 0.005f) &&
+ (Math.Abs(vel.Z) < 0.005f))
+ {
+ _velocity = Vector3.Zero;
+ float t = -m_invTimeStep;
+ m_acceleration = m_acceleration * t;
+ }
+ else
+ {
+ _velocity.X = vel.X;
+ _velocity.Y = vel.Y;
+ _velocity.Z = vel.Z;
+ m_acceleration = (_velocity - m_acceleration) * m_invTimeStep;
+ }
- if ((Math.Abs(m_acceleration.X) < 0.01f) &&
- (Math.Abs(m_acceleration.Y) < 0.01f) &&
- (Math.Abs(m_acceleration.Z) < 0.01f))
- {
- m_acceleration = Vector3.Zero;
- }
+ if ((Math.Abs(m_acceleration.X) < 0.01f) &&
+ (Math.Abs(m_acceleration.Y) < 0.01f) &&
+ (Math.Abs(m_acceleration.Z) < 0.01f))
+ {
+ m_acceleration = Vector3.Zero;
+ }
- vel = d.BodyGetAngularVel(Body);
- if ((Math.Abs(vel.X) < 0.0001) &&
- (Math.Abs(vel.Y) < 0.0001) &&
- (Math.Abs(vel.Z) < 0.0001)
- )
- {
- m_rotationalVelocity = Vector3.Zero;
- }
- else
- {
- m_rotationalVelocity.X = vel.X;
- m_rotationalVelocity.Y = vel.Y;
- m_rotationalVelocity.Z = vel.Z;
- }
+ vel = d.BodyGetAngularVel(Body);
+ if ((Math.Abs(vel.X) < 0.0001) &&
+ (Math.Abs(vel.Y) < 0.0001) &&
+ (Math.Abs(vel.Z) < 0.0001)
+ )
+ {
+ m_rotationalVelocity = Vector3.Zero;
+ }
+ else
+ {
+ m_rotationalVelocity.X = vel.X;
+ m_rotationalVelocity.Y = vel.Y;
+ m_rotationalVelocity.Z = vel.Z;
}
}
diff --git a/bin/lib32/ode.dll b/bin/lib32/ode.dll
index 5bb9319..5a25d20 100755
Binary files a/bin/lib32/ode.dll and b/bin/lib32/ode.dll differ
diff --git a/bin/lib64/ode.dll b/bin/lib64/ode.dll
index 637b105..2ea84fc 100755
Binary files a/bin/lib64/ode.dll and b/bin/lib64/ode.dll differ
--
cgit v1.1
From 006c08886a2af6d2287e6ef8bc67428b61ff9998 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 18 Apr 2017 05:31:15 +0100
Subject: deleted a bit 2 much on last commit
---
OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 2 ++
OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 5 +++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 7b77d2f..9bf71f7 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -3380,6 +3380,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
enableBodySoft();
else if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
+ d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
}
//resetCollisionAccounting();
}
@@ -3403,6 +3404,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
enableBodySoft();
else if (!d.BodyIsEnabled(Body))
d.BodyEnable(Body);
+ d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
}
//resetCollisionAccounting();
}
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index a4c3f92..be652c0 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -727,8 +727,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (g1 == g2)
return; // Can't collide with yourself
- if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact))
- return;
+// if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact))
+// return;
/*
// debug
PhysicsActor dp2;
@@ -1176,6 +1176,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
aprim.clearSleeperCollisions();
}
}
+
lock (_activegroups)
{
try
--
cgit v1.1
From 52e03ee5bd678b96af0ab4c8d3e2e1a0f39fb71b Mon Sep 17 00:00:00 2001
From: Michael Cerquoni
Date: Wed, 19 Apr 2017 13:24:38 -0400
Subject: update ubODE for Linux x86 and x86_64 to include lasted ODE 0.13.2
---
bin/lib32/libode.so | Bin 1019273 -> 4230804 bytes
bin/lib64/libode-x86_64.so | Bin 6397607 -> 6426368 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/lib32/libode.so b/bin/lib32/libode.so
index daf6a4d..de54cd8 100755
Binary files a/bin/lib32/libode.so and b/bin/lib32/libode.so differ
diff --git a/bin/lib64/libode-x86_64.so b/bin/lib64/libode-x86_64.so
index d8f3c20..2505ded 100755
Binary files a/bin/lib64/libode-x86_64.so and b/bin/lib64/libode-x86_64.so differ
--
cgit v1.1
From fe83763c365dfa2ba77ebd902810683cedd58ffa Mon Sep 17 00:00:00 2001
From: Geir Nøklebye
Date: Thu, 13 Apr 2017 12:07:06 +0200
Subject: PGSQL: Fixed a failing query in GroupsData for deleting groups
messages older than 14 days. The little known abstime function could be used
for a double cast. The field TMStamp should be changed to store the data as a
proper timestamp. Related to Mantis #7848. Usually this would easily be
solved using the to_timestamp function, but there is no support for it in
NPGSQL as there are no very close functionality in .NET
Signed-off-by: Michael Cerquoni
---
OpenSim/Data/PGSQL/PGSQLGroupsData.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
index 6ef576b..f398256 100755
--- a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
@@ -435,7 +435,7 @@ namespace OpenSim.Data.PGSQL
using (NpgsqlCommand cmd = new NpgsqlCommand())
{
- cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
+ cmd.CommandText = String.Format("delete from {0} where \"TMStamp\"::abstime::timestamp < now() - INTERVAL '2 week'", m_Realm);
ExecuteNonQuery(cmd);
}
@@ -461,7 +461,7 @@ namespace OpenSim.Data.PGSQL
using (NpgsqlCommand cmd = new NpgsqlCommand())
{
- cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
+ cmd.CommandText = String.Format("delete from {0} where \"TMStamp\"::abstime::timestamp < now() - INTERVAL '2 week'", m_Realm);
ExecuteNonQuery(cmd);
}
--
cgit v1.1
From 28125202cc320dee3f4908f07eb4fbc04a134d6e Mon Sep 17 00:00:00 2001
From: Geir Nøklebye
Date: Thu, 13 Apr 2017 11:54:25 +0200
Subject: update for The new Constant: integer OBJECT_REZZER_KEY = 32 + adding
missing support for fields in the prims table.
Signed-off-by: Michael Cerquoni
---
OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 33 ++++++++++++++++++----
.../Data/PGSQL/Resources/RegionStore.migrations | 9 ++++++
2 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
index 33d12bd..3e08dd6 100755
--- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
@@ -350,7 +350,8 @@ namespace OpenSim.Data.PGSQL
""CameraEyeOffsetY"" = :CameraEyeOffsetY, ""CameraEyeOffsetZ"" = :CameraEyeOffsetZ, ""CameraAtOffsetX"" = :CameraAtOffsetX,
""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook,
""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice,
- ""SaleType"" = :SaleType, ""ColorR"" = :ColorR, ""ColorG"" = :ColorG, ""ColorB"" = :ColorB, ""ColorA"" = :ColorA, ""ParticleSystem"" = :ParticleSystem,
+ ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution,
++ ""PassCollisions"" = :PassCollisions, ""RotationAxisLocks"" = :RotationAxisLocks, ""RezzerID"" = :RezzerID
""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs,
""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution
@@ -367,7 +368,7 @@ namespace OpenSim.Data.PGSQL
""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"",
""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
- ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution""
+ ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID""
) Select
:UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
:EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
@@ -378,7 +379,7 @@ namespace OpenSim.Data.PGSQL
:OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ,
:ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
:ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
- :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution
+ :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID
where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID);
";
@@ -1678,6 +1679,12 @@ namespace OpenSim.Data.PGSQL
prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
prim.GroupID = new UUID((Guid)primRow["GroupID"]);
prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]);
+
+ if (primRow["RezzerID"] != DBNull.Value)
+ prim.RezzerID = new UUID((Guid)primRow["RezzerID"]);
+ else
+ prim.RezzerID = UUID.Zero;
+
prim.OwnerMask = Convert.ToUInt32(primRow["OwnerMask"]);
prim.NextOwnerMask = Convert.ToUInt32(primRow["NextOwnerMask"]);
prim.GroupMask = Convert.ToUInt32(primRow["GroupMask"]);
@@ -1796,6 +1803,8 @@ namespace OpenSim.Data.PGSQL
prim.GravityModifier = Convert.ToSingle(primRow["GravityModifier"]);
prim.Friction = Convert.ToSingle(primRow["Friction"]);
prim.Restitution = Convert.ToSingle(primRow["Restitution"]);
+ prim.RotationAxisLocks = Convert.ToByte(primRow["RotationAxisLocks"]);
+
return prim;
}
@@ -2097,6 +2106,7 @@ namespace OpenSim.Data.PGSQL
parameters.Add(_Database.CreateParameter("OwnerID", prim.OwnerID));
parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID));
parameters.Add(_Database.CreateParameter("LastOwnerID", prim.LastOwnerID));
+ parameters.Add(_Database.CreateParameter("RezzerID", prim.RezzerID));
parameters.Add(_Database.CreateParameter("OwnerMask", prim.OwnerMask));
parameters.Add(_Database.CreateParameter("NextOwnerMask", prim.NextOwnerMask));
parameters.Add(_Database.CreateParameter("GroupMask", prim.GroupMask));
@@ -2196,7 +2206,19 @@ namespace OpenSim.Data.PGSQL
parameters.Add(_Database.CreateParameter("CollisionSound", prim.CollisionSound));
parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume));
- parameters.Add(_Database.CreateParameter("PassTouches", prim.PassTouches));
+ parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches));
+ parameters.Add(_Database.CreateParameter("PassCollisions", prim.PassCollisions));
+
+
+ if (prim.PassTouches)
+ parameters.Add(_Database.CreateParameter("PassTouches", true));
+ else
+ parameters.Add(_Database.CreateParameter("PassTouches", false));
+
+ if (prim.PassCollisions)
+ parameters.Add(_Database.CreateParameter("PassCollisions", 1));
+ else
+ parameters.Add(_Database.CreateParameter("PassCollisions", 0));
parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
@@ -2211,12 +2233,13 @@ namespace OpenSim.Data.PGSQL
parameters.Add(_Database.CreateParameter("GravityModifier", (double)prim.GravityModifier));
parameters.Add(_Database.CreateParameter("Friction", (double)prim.Friction));
parameters.Add(_Database.CreateParameter("Restitution", (double)prim.Restitution));
+ parameters.Add(_Database.CreateParameter("RotationAxisLocks", prim.RotationAxisLocks));
return parameters.ToArray();
}
///
- /// Creates the primshape parameters for stroing in DB.
+ /// Creates the primshape parameters for storing in DB.
///
/// Basic data of SceneObjectpart prim.
/// The scene group ID.
diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
index c085939..2f197bf 100644
--- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
@@ -1195,3 +1195,12 @@ CREATE TABLE bakedterrain
);
COMMIT;
+
+:VERSION 45 #---- Add RezzerID filed in table prims
+
+BEGIN TRANSACTION;
+
+ALTER TABLE prims ADD "RezzerID" uuid NULL;
+
+COMMIT;
+
--
cgit v1.1
From 84c9125016f964df9c77df7553aee6693fccb2e6 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 20 Apr 2017 02:25:22 +0100
Subject: update ode binaries for windows; add a minimal velocity for bounce
---
OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 1 +
bin/lib32/ode.dll | Bin 541184 -> 541184 bytes
bin/lib64/ode.dll | Bin 634880 -> 635392 bytes
3 files changed, 1 insertion(+)
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index be652c0..86d41ea 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -529,6 +529,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
SharedTmpcontact.surface.mode = comumContactFlags;
SharedTmpcontact.surface.mu = 0;
SharedTmpcontact.surface.bounce = 0;
+ SharedTmpcontact.surface.bounce_vel = 1.5f;
SharedTmpcontact.surface.soft_cfm = comumContactCFM;
SharedTmpcontact.surface.soft_erp = comumContactERP;
SharedTmpcontact.surface.slip1 = comumContactSLIP;
diff --git a/bin/lib32/ode.dll b/bin/lib32/ode.dll
index 5a25d20..5c658e9 100755
Binary files a/bin/lib32/ode.dll and b/bin/lib32/ode.dll differ
diff --git a/bin/lib64/ode.dll b/bin/lib64/ode.dll
index 2ea84fc..8b290b1 100755
Binary files a/bin/lib64/ode.dll and b/bin/lib64/ode.dll differ
--
cgit v1.1
From b498d554e1b087a726d10192173c92e8cc114dbc Mon Sep 17 00:00:00 2001
From: Michael Cerquoni
Date: Wed, 19 Apr 2017 21:50:32 -0400
Subject: update ode binaries for linux; add a minimal velocity for bounce
---
bin/lib32/libode.so | Bin 4230804 -> 4232000 bytes
bin/lib64/libode-x86_64.so | Bin 6426368 -> 6427600 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/lib32/libode.so b/bin/lib32/libode.so
index de54cd8..3e08c42 100755
Binary files a/bin/lib32/libode.so and b/bin/lib32/libode.so differ
diff --git a/bin/lib64/libode-x86_64.so b/bin/lib64/libode-x86_64.so
index 2505ded..2f616dd 100755
Binary files a/bin/lib64/libode-x86_64.so and b/bin/lib64/libode-x86_64.so differ
--
cgit v1.1
From ebcfad1a839557b3f0d28bf34e627f63dc59d9eb Mon Sep 17 00:00:00 2001
From: Geir Nøklebye
Date: Thu, 20 Apr 2017 15:41:28 +0200
Subject: store the physics inertia override in the database
Signed-off-by: UbitUmarov
---
OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 19 +++++++++++++++----
OpenSim/Data/PGSQL/Resources/RegionStore.migrations | 7 +++++++
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
index 3e08dd6..625120b 100755
--- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
@@ -351,10 +351,10 @@ namespace OpenSim.Data.PGSQL
""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook,
""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice,
""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution,
-+ ""PassCollisions"" = :PassCollisions, ""RotationAxisLocks"" = :RotationAxisLocks, ""RezzerID"" = :RezzerID
+ ""PassCollisions"" = :PassCollisions, ""RotationAxisLocks"" = :RotationAxisLocks, ""RezzerID"" = :RezzerID,
""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs,
- ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution
+ ""PhysInertia"" = :PhysInertia
WHERE ""UUID"" = :UUID ;
INSERT INTO
@@ -368,7 +368,7 @@ namespace OpenSim.Data.PGSQL
""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"",
""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
- ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID""
+ ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID"" , ""PhysInertia""
) Select
:UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
:EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
@@ -379,7 +379,7 @@ namespace OpenSim.Data.PGSQL
:OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ,
:ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
:ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
- :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID
+ :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID, :PhysInertia
where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID);
";
@@ -1805,6 +1805,11 @@ namespace OpenSim.Data.PGSQL
prim.Restitution = Convert.ToSingle(primRow["Restitution"]);
prim.RotationAxisLocks = Convert.ToByte(primRow["RotationAxisLocks"]);
+
+ PhysicsInertiaData pdata = null;
+ if (!(primRow["PhysInertia"] is System.DBNull))
+ pdata = PhysicsInertiaData.FromXml2(primRow["PhysInertia"].ToString());
+ prim.PhysicsInertia = pdata;
return prim;
}
@@ -2222,6 +2227,12 @@ namespace OpenSim.Data.PGSQL
parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
+
+ if (prim.PhysicsInertia != null)
+ parameters.Add(_Database.CreateParameter("PhysInertia", prim.PhysicsInertia.ToXml2()));
+ else
+ parameters.Add(_Database.CreateParameter("PhysInertia", String.Empty));
+
if (prim.DynAttrs.CountNamespaces > 0)
parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
index 2f197bf..948d177 100644
--- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
@@ -1204,3 +1204,10 @@ ALTER TABLE prims ADD "RezzerID" uuid NULL;
COMMIT;
+:VERSION 46 #---- Add physics inertia data to table prims
+
+BEGIN TRANSACTION;
+
+ALTER TABLE prims ADD "PhysInertia" TEXT;
+
+COMMIT;
--
cgit v1.1
From 54819fa4ae0f09712475cd98b45eeca352c8743c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 21 Apr 2017 11:03:31 +0100
Subject: mantis 8154 dont let self lResetOtherScript mean harakiri
---
.../Shared/Api/Implementation/LSL_Api.cs | 166 ++++++++++-----------
1 file changed, 77 insertions(+), 89 deletions(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 62654ee..443ea72 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -494,12 +494,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
UUID item;
- m_host.AddScriptLPS(1);
-
- if ((item = GetScriptByName(name)) != UUID.Zero)
- m_ScriptEngine.ResetScript(item);
- else
+ if ((item = GetScriptByName(name)) == UUID.Zero)
+ {
+ m_host.AddScriptLPS(1);
Error("llResetOtherScript", "Can't find script '" + name + "'");
+ return;
+ }
+ if(item == m_item.ItemID)
+ llResetScript();
+ else
+ {
+ m_host.AddScriptLPS(1);
+ m_ScriptEngine.ResetScript(item);
+ }
}
public LSL_Integer llGetScriptState(string name)
@@ -2725,9 +2732,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// if TRUE, will cap the distance to 10m.
protected void SetPos(SceneObjectPart part, LSL_Vector targetPos, bool adjust)
{
- if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
+ if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted || part.ParentGroup.inTransit)
return;
+
LSL_Vector currentPos = GetPartLocalPos(part);
LSL_Vector toPos = GetSetPosTarget(part, targetPos, currentPos, adjust);
@@ -5751,29 +5759,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
if (index < 0)
- {
index = src.Length + index;
- }
+
if (index >= src.Length || index < 0)
- {
return 0;
- }
+
+ object item = src.Data[index];
// Vectors & Rotations always return zero in SL, but
// keys don't always return zero, it seems to be a bit complex.
- else if (src.Data[index] is LSL_Vector ||
- src.Data[index] is LSL_Rotation)
- {
+ if (item is LSL_Vector || item is LSL_Rotation)
return 0;
- }
+
try
{
-
- if (src.Data[index] is LSL_Integer)
- return (LSL_Integer)src.Data[index];
- else if (src.Data[index] is LSL_Float)
- return Convert.ToInt32(((LSL_Float)src.Data[index]).value);
- return new LSL_Integer(src.Data[index].ToString());
+ if (item is LSL_Integer)
+ return (LSL_Integer)item;
+ else if (item is LSL_Float)
+ return Convert.ToInt32(((LSL_Float)item).value);;
+ return new LSL_Integer(item.ToString());
}
catch (FormatException)
{
@@ -5785,38 +5789,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
if (index < 0)
- {
index = src.Length + index;
- }
+
if (index >= src.Length || index < 0)
- {
- return 0.0;
- }
+ return 0;
+
+ object item = src.Data[index];
// Vectors & Rotations always return zero in SL
- else if (src.Data[index] is LSL_Vector ||
- src.Data[index] is LSL_Rotation)
- {
+ if(item is LSL_Vector || item is LSL_Rotation)
return 0;
- }
+
// valid keys seem to get parsed as integers then converted to floats
- else
+ if (item is LSL_Key)
{
UUID uuidt;
- if (src.Data[index] is LSL_Key && UUID.TryParse(src.Data[index].ToString(), out uuidt))
- {
- return Convert.ToDouble(new LSL_Integer(src.Data[index].ToString()).value);
- }
+ string s = item.ToString();
+ if(UUID.TryParse(s, out uuidt))
+ return Convert.ToDouble(new LSL_Integer(s).value);
+ else
+ return 0;
}
+
try
{
- if (src.Data[index] is LSL_Integer)
- return Convert.ToDouble(((LSL_Integer)src.Data[index]).value);
- else if (src.Data[index] is LSL_Float)
- return Convert.ToDouble(((LSL_Float)src.Data[index]).value);
- else if (src.Data[index] is LSL_String)
+ if (item is LSL_Integer)
+ return Convert.ToDouble(((LSL_Integer)item).value);
+ else if (item is LSL_Float)
+ return Convert.ToDouble(((LSL_Float)item).value);
+ else if (item is LSL_String)
{
- string str = ((LSL_String) src.Data[index]).m_string;
+ string str = ((LSL_String)item).m_string;
Match m = Regex.Match(str, "^\\s*(-?\\+?[,0-9]+\\.?[0-9]*)");
if (m != Match.Empty)
{
@@ -5824,12 +5827,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
double d = 0.0;
if (!Double.TryParse(str, out d))
return 0.0;
-
return d;
}
return 0.0;
}
- return Convert.ToDouble(src.Data[index]);
+ return Convert.ToDouble(item);
}
catch (FormatException)
{
@@ -5841,13 +5843,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
if (index < 0)
- {
index = src.Length + index;
- }
+
if (index >= src.Length || index < 0)
- {
return String.Empty;
- }
+
return src.Data[index].ToString();
}
@@ -5855,14 +5855,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
if (index < 0)
- {
index = src.Length + index;
- }
if (index >= src.Length || index < 0)
- {
- return "";
- }
+ return String.Empty;
+
+ object item = src.Data[index];
// SL spits out an empty string for types other than key & string
// At the time of patching, LSL_Key is currently LSL_String,
@@ -5871,31 +5869,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// as it's own struct
// NOTE: 3rd case is needed because a NULL_KEY comes through as
// type 'obj' and wrongly returns ""
- else if (!(src.Data[index] is LSL_String ||
- src.Data[index] is LSL_Key ||
- src.Data[index].ToString() == "00000000-0000-0000-0000-000000000000"))
+ if (!(item is LSL_String ||
+ item is LSL_Key ||
+ item.ToString() == "00000000-0000-0000-0000-000000000000"))
{
- return "";
+ return String.Empty;
}
- return src.Data[index].ToString();
+ return item.ToString();
}
public LSL_Vector llList2Vector(LSL_List src, int index)
{
m_host.AddScriptLPS(1);
if (index < 0)
- {
index = src.Length + index;
- }
+
if (index >= src.Length || index < 0)
- {
return new LSL_Vector(0, 0, 0);
- }
- if (src.Data[index].GetType() == typeof(LSL_Vector))
- {
- return (LSL_Vector)src.Data[index];
- }
+
+ object item = src.Data[index];
+
+ if (item.GetType() == typeof(LSL_Vector))
+ return (LSL_Vector)item;
// SL spits always out ZERO_VECTOR for anything other than
// strings or vectors. Although keys always return ZERO_VECTOR,
@@ -5903,28 +5899,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// a string, a key as string and a string that by coincidence
// is a string, so we're going to leave that up to the
// LSL_Vector constructor.
- else if (!(src.Data[index] is LSL_String ||
- src.Data[index] is LSL_Vector))
- {
- return new LSL_Vector(0, 0, 0);
- }
- else
- {
- return new LSL_Vector(src.Data[index].ToString());
- }
+ if(item is LSL_Vector)
+ return (LSL_Vector) item;
+
+ if (item is LSL_String)
+ return new LSL_Vector(item.ToString());
+
+ return new LSL_Vector(0, 0, 0);
}
public LSL_Rotation llList2Rot(LSL_List src, int index)
{
m_host.AddScriptLPS(1);
if (index < 0)
- {
index = src.Length + index;
- }
+
if (index >= src.Length || index < 0)
- {
return new LSL_Rotation(0, 0, 0, 1);
- }
+
+ object item = src.Data[index];
// SL spits always out ZERO_ROTATION for anything other than
// strings or vectors. Although keys always return ZERO_ROTATION,
@@ -5932,19 +5925,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// a string, a key as string and a string that by coincidence
// is a string, so we're going to leave that up to the
// LSL_Rotation constructor.
- else if (!(src.Data[index] is LSL_String ||
- src.Data[index] is LSL_Rotation))
- {
- return new LSL_Rotation(0, 0, 0, 1);
- }
- else if (src.Data[index].GetType() == typeof(LSL_Rotation))
- {
- return (LSL_Rotation)src.Data[index];
- }
- else
- {
+
+ if (item.GetType() == typeof(LSL_Rotation))
+ return (LSL_Rotation)item;
+
+ if (item is LSL_String)
return new LSL_Rotation(src.Data[index].ToString());
- }
+
+ return new LSL_Rotation(0, 0, 0, 1);
}
public LSL_List llList2List(LSL_List src, int start, int end)
--
cgit v1.1
From 3b33a90e379b40ef3cb2c54dd077ab2263dbf4e8 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 21 Apr 2017 13:49:25 +0100
Subject: update ode binaries for windows
---
bin/lib32/ode.dll | Bin 541184 -> 541696 bytes
bin/lib64/ode.dll | Bin 635392 -> 635392 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/lib32/ode.dll b/bin/lib32/ode.dll
index 5c658e9..ddffcb3 100755
Binary files a/bin/lib32/ode.dll and b/bin/lib32/ode.dll differ
diff --git a/bin/lib64/ode.dll b/bin/lib64/ode.dll
index 8b290b1..0d6edbe 100755
Binary files a/bin/lib64/ode.dll and b/bin/lib64/ode.dll differ
--
cgit v1.1
From 65a154720955536fa2327ace99e3ae0d72a585ad Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 24 Apr 2017 02:05:39 +0100
Subject: fix (or actually break) llList2float() since LSL_Key is same as
LSL_String, the case of invalid LSL_Key cannot be handle, since most likely
it is a string
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 443ea72..31be2fb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -5807,8 +5807,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
string s = item.ToString();
if(UUID.TryParse(s, out uuidt))
return Convert.ToDouble(new LSL_Integer(s).value);
- else
- return 0;
+// we can't do this because a string is also a LSL_Key for now :(
+// else
+// return 0;
}
try
--
cgit v1.1
From c91e1012242dcc7808688099f2145a61c5ac7820 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 24 Apr 2017 07:06:48 +0100
Subject: add suport for materials parameters PRIM_NORMAL, PRIM_SPECULAR and
PRIM_ALPHA_MODE of llGetPrimitiveParams(). Im sleeping at this time, this can
be very wrong
---
OpenSim/Region/Framework/Scenes/SOPMaterial.cs | 82 ++++++++++++++++++++
.../Shared/Api/Implementation/LSL_Api.cs | 88 ++++++++++++++++++++++
2 files changed, 170 insertions(+)
diff --git a/OpenSim/Region/Framework/Scenes/SOPMaterial.cs b/OpenSim/Region/Framework/Scenes/SOPMaterial.cs
index 651c52e..0e9f228 100644
--- a/OpenSim/Region/Framework/Scenes/SOPMaterial.cs
+++ b/OpenSim/Region/Framework/Scenes/SOPMaterial.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using OpenMetaverse;
+using OpenMetaverse.StructuredData;
using OpenSim.Framework;
namespace OpenSim.Region.Framework.Scenes
@@ -90,6 +91,87 @@ namespace OpenSim.Region.Framework.Scenes
else
return 0;
}
+ }
+
+ public class FaceMaterial
+ {
+ public UUID ID;
+ public UUID NormalMapID = UUID.Zero;
+ public float NormalOffsetX = 1.0f;
+ public float NormalOffsetY = 1.0f;
+ public float NormalRepeatX = 0.0f;
+ public float NormalRepeatY = 0.0f;
+ public float NormalRotation = 0.0f;
+
+ public UUID SpecularMapID = UUID.Zero;
+ public float SpecularOffsetX = 1.0f;
+ public float SpecularOffsetY = 1.0f;
+ public float SpecularRepeatX = 0.0f;
+ public float SpecularRepeatY = 0.0f;
+ public float SpecularRotation = 0.0f;
+
+ public Color4 SpecularLightColor = new Color4(255,255,255,255);
+ public Byte SpecularLightExponent = 51;
+ public Byte EnvironmentIntensity = 0;
+ public Byte DiffuseAlphaMode = 1;
+ public Byte AlphaMaskCutoff = 0;
+
+ public FaceMaterial()
+ { }
+
+ public FaceMaterial(UUID pID, OSDMap mat)
+ {
+ ID = pID;
+ if(mat == null)
+ return;
+ float scale = 0.0001f;
+ NormalMapID = mat["NormMap"].AsUUID();
+ NormalOffsetX = scale * (float)mat["NormOffsetX"].AsReal();
+ NormalOffsetY = scale * (float)mat["NormOffsetY"].AsReal();
+ NormalRepeatX = scale * (float)mat["NormRepeatX"].AsReal();
+ NormalRepeatY = scale * (float)mat["NormRepeatY"].AsReal();
+ NormalRotation = scale * (float)mat["NormRotation"].AsReal();
+
+ SpecularMapID = mat["SpecMap"].AsUUID();
+ SpecularOffsetX = scale * (float)mat["SpecOffsetX"].AsReal();
+ SpecularOffsetY = scale * (float)mat["SpecOffsetY"].AsReal();
+ SpecularRepeatX = scale * (float)mat["SpecRepeatX"].AsReal();
+ SpecularRepeatY = scale * (float)mat["SpecRepeatY"].AsReal();
+ SpecularRotation = scale * (float)mat["SpecRotation"].AsReal();
+ SpecularLightColor = mat["SpecColor"].AsColor4();
+ SpecularLightExponent = (Byte)mat["SpecExp"].AsUInteger();
+ EnvironmentIntensity = (Byte)mat["EnvIntensity"].AsUInteger();
+ DiffuseAlphaMode = (Byte)mat["DiffuseAlphaMode"].AsUInteger();
+ AlphaMaskCutoff = (Byte)mat["AlphaMaskCutoff"].AsUInteger();
+ }
+
+ public OSDMap toOSD()
+ {
+ OSDMap mat = new OSDMap();
+ float scale = 10000f;
+
+ mat["NormMap"] = NormalMapID;
+ mat["NormOffsetX"] = (int) (scale * NormalOffsetX);
+ mat["NormOffsetY"] = (int) (scale * NormalOffsetY);
+ mat["NormRepeatX"] = (int) (scale * NormalRepeatX);
+ mat["NormRepeatY"] = (int) (scale * NormalRepeatY);
+ mat["NormRotation"] = (int) (scale * NormalRotation);
+
+ mat["SpecMap"] = SpecularMapID;
+ mat["SpecOffsetX"] = (int) (scale * SpecularOffsetX);
+ mat["SpecOffsetY"] = (int) (scale * SpecularOffsetY);
+ mat["SpecRepeatX"] = (int) (scale * SpecularRepeatX);
+ mat["SpecRepeatY"] = (int) (scale * SpecularRepeatY);
+ mat["SpecRotation"] = (int) (scale * SpecularRotation);
+
+ mat["SpecColor"] = SpecularLightColor;
+ mat["SpecExp"] = SpecularLightExponent;
+ mat["EnvIntensity"] = EnvironmentIntensity;
+ mat["DiffuseAlphaMode"] = DiffuseAlphaMode;
+ mat["AlphaMaskCutoff"] = AlphaMaskCutoff;
+
+ return mat;
+ }
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 31be2fb..6cbdf0a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -11298,6 +11298,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
break;
+ case (int)ScriptBaseClass.PRIM_NORMAL:
+ case (int)ScriptBaseClass.PRIM_SPECULAR:
+ case (int)ScriptBaseClass.PRIM_ALPHA_MODE:
+ if (remain < 1)
+ return new LSL_List();
+
+ face = (int)rules.GetLSLIntegerItem(idx++);
+ tex = part.Shape.Textures;
+ if (face == ScriptBaseClass.ALL_SIDES)
+ {
+ for (face = 0; face < GetNumberOfSides(part); face++)
+ {
+ Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
+ getLSLFaceMaterial(ref res, code, texface);
+ }
+ }
+ else
+ {
+ if (face >= 0 && face < GetNumberOfSides(part))
+ {
+ Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
+ getLSLFaceMaterial(ref res, code, texface);
+ }
+ }
+ break;
+
case (int)ScriptBaseClass.PRIM_LINK_TARGET:
// TODO: Should be issuing a runtime script warning in this case.
@@ -11311,6 +11337,68 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return new LSL_List();
}
+ private void getLSLFaceMaterial(ref LSL_List res, int code, Primitive.TextureEntryFace texface)
+ {
+ UUID matID = texface.MaterialID;
+ if(matID != UUID.Zero)
+ {
+ AssetBase MatAsset = World.AssetService.Get(matID.ToString());
+ if(MatAsset != null)
+ {
+ Byte[] data = MatAsset.Data;
+ OSDMap osdmat = (OSDMap)OSDParser.DeserializeLLSDXml(data);
+ if(osdmat != null && osdmat.ContainsKey("NormMap"))
+ {
+ FaceMaterial mat = new FaceMaterial(matID, osdmat);
+ if(code == ScriptBaseClass.PRIM_NORMAL)
+ {
+ res.Add(new LSL_String(mat.NormalMapID.ToString()));
+ res.Add(new LSL_Vector(mat.NormalOffsetX, mat.NormalOffsetY, 0));
+ res.Add(new LSL_Vector(mat.NormalRepeatX, mat.NormalRepeatY, 0));
+ res.Add(new LSL_Float(mat.NormalRotation));
+ }
+ else if(code == ScriptBaseClass.PRIM_SPECULAR )
+ {
+ res.Add(new LSL_String(mat.SpecularMapID.ToString()));
+ res.Add(new LSL_Vector(mat.SpecularOffsetX, mat.SpecularOffsetY, 0));
+ res.Add(new LSL_Vector(mat.SpecularRepeatX, mat.SpecularRepeatY, 0));
+ res.Add(new LSL_Vector(mat.SpecularLightColor.R, mat.SpecularLightColor.G, mat.SpecularLightColor.B));
+ res.Add(new LSL_Integer(mat.SpecularLightExponent));
+ res.Add(new LSL_Integer(mat.EnvironmentIntensity));
+ }
+ else if(code == ScriptBaseClass.PRIM_ALPHA_MODE)
+ {
+ res.Add(new LSL_Integer(mat.DiffuseAlphaMode));
+ res.Add(new LSL_Integer(mat.AlphaMaskCutoff));
+ }
+ return;
+ }
+ }
+ matID = UUID.Zero;
+ }
+ if(matID == UUID.Zero)
+ {
+ if(code == (int)ScriptBaseClass.PRIM_NORMAL || code == (int)ScriptBaseClass.PRIM_SPECULAR )
+ {
+ res.Add(new LSL_String(UUID.Zero.ToString()));
+ res.Add(new LSL_Vector(1.0, 1.0, 0));
+ res.Add(new LSL_Vector(0, 0, 0));
+ res.Add(new LSL_Float(0));
+
+ if(code == (int)ScriptBaseClass.PRIM_SPECULAR)
+ {
+ res.Add(new LSL_Vector(1.0, 1.0, 1.0));
+ res.Add(new LSL_Integer(51));
+ res.Add(new LSL_Integer(0));
+ }
+ }
+ else if(code == (int)ScriptBaseClass.PRIM_ALPHA_MODE)
+ {
+ res.Add(new LSL_Integer(1));
+ res.Add(new LSL_Integer(0));
+ }
+ }
+ }
public LSL_List llGetPrimMediaParams(int face, LSL_List rules)
{
--
cgit v1.1
From 7a54c3e9c300edf35303e243e0e6a61054d952d5 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 24 Apr 2017 11:46:13 +0100
Subject: some fixes on the materials paramenters of llGetPrimitiveParams()
---
OpenSim/Region/Framework/Scenes/SOPMaterial.cs | 16 +++----
.../Shared/Api/Implementation/LSL_Api.cs | 56 ++++++++++++++++++----
2 files changed, 56 insertions(+), 16 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SOPMaterial.cs b/OpenSim/Region/Framework/Scenes/SOPMaterial.cs
index 0e9f228..d38ef61 100644
--- a/OpenSim/Region/Framework/Scenes/SOPMaterial.cs
+++ b/OpenSim/Region/Framework/Scenes/SOPMaterial.cs
@@ -97,17 +97,17 @@ namespace OpenSim.Region.Framework.Scenes
{
public UUID ID;
public UUID NormalMapID = UUID.Zero;
- public float NormalOffsetX = 1.0f;
- public float NormalOffsetY = 1.0f;
- public float NormalRepeatX = 0.0f;
- public float NormalRepeatY = 0.0f;
+ public float NormalOffsetX = 0.0f;
+ public float NormalOffsetY = 0.0f;
+ public float NormalRepeatX = 1.0f;
+ public float NormalRepeatY = 1.0f;
public float NormalRotation = 0.0f;
public UUID SpecularMapID = UUID.Zero;
- public float SpecularOffsetX = 1.0f;
- public float SpecularOffsetY = 1.0f;
- public float SpecularRepeatX = 0.0f;
- public float SpecularRepeatY = 0.0f;
+ public float SpecularOffsetX = 0.0f;
+ public float SpecularOffsetY = 0.0f;
+ public float SpecularRepeatX = 1.0f;
+ public float SpecularRepeatY = 1.0f;
public float SpecularRotation = 0.0f;
public Color4 SpecularLightColor = new Color4(255,255,255,255);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 6cbdf0a..47c3cb8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -11311,7 +11311,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
for (face = 0; face < GetNumberOfSides(part); face++)
{
Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
- getLSLFaceMaterial(ref res, code, texface);
+ getLSLFaceMaterial(ref res, code, part, texface);
}
}
else
@@ -11319,7 +11319,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (face >= 0 && face < GetNumberOfSides(part))
{
Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
- getLSLFaceMaterial(ref res, code, texface);
+ getLSLFaceMaterial(ref res, code, part, texface);
}
}
break;
@@ -11337,7 +11337,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return new LSL_List();
}
- private void getLSLFaceMaterial(ref LSL_List res, int code, Primitive.TextureEntryFace texface)
+/*
+ private string filterTextureUUIDbyRights(UUID origID, SceneObjectPart part, bool checkTaskInventory, bool returnInvName)
+ {
+ if(checkTaskInventory)
+ {
+ lock (part.TaskInventory)
+ {
+ foreach (KeyValuePair inv in part.TaskInventory)
+ {
+ if (inv.Value.AssetID == origID)
+ {
+ if(inv.Value.InvType == (int)InventoryType.Texture)
+ {
+ if(returnInvName)
+ return inv.Value.Name;
+ else
+ return origID.ToString();
+ }
+ else
+ return UUID.Zero.ToString();
+ }
+ }
+ }
+ }
+
+ if(World.Permissions.CanEditObject(m_host.ParentGroup.UUID, m_host.ParentGroup.RootPart.OwnerID))
+ return origID.ToString();
+
+ return UUID.Zero.ToString();
+ }
+*/
+ private void getLSLFaceMaterial(ref LSL_List res, int code, SceneObjectPart part, Primitive.TextureEntryFace texface)
{
UUID matID = texface.MaterialID;
if(matID != UUID.Zero)
@@ -11349,20 +11380,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
OSDMap osdmat = (OSDMap)OSDParser.DeserializeLLSDXml(data);
if(osdmat != null && osdmat.ContainsKey("NormMap"))
{
+ string mapIDstr;
FaceMaterial mat = new FaceMaterial(matID, osdmat);
if(code == ScriptBaseClass.PRIM_NORMAL)
{
- res.Add(new LSL_String(mat.NormalMapID.ToString()));
- res.Add(new LSL_Vector(mat.NormalOffsetX, mat.NormalOffsetY, 0));
+// mapIDstr = filterTextureUUIDbyRights(mat.NormalMapID, part, true, false);
+ mapIDstr = mat.NormalMapID.ToString();
+ res.Add(new LSL_String(mapIDstr));
res.Add(new LSL_Vector(mat.NormalRepeatX, mat.NormalRepeatY, 0));
+ res.Add(new LSL_Vector(mat.NormalOffsetX, mat.NormalOffsetY, 0));
res.Add(new LSL_Float(mat.NormalRotation));
}
else if(code == ScriptBaseClass.PRIM_SPECULAR )
{
- res.Add(new LSL_String(mat.SpecularMapID.ToString()));
- res.Add(new LSL_Vector(mat.SpecularOffsetX, mat.SpecularOffsetY, 0));
+// mapIDstr = filterTextureUUIDbyRights(mat.SpecularMapID, part, true, false);
+ const float colorScale = 1.0f/255f;
+ mapIDstr = mat.SpecularMapID.ToString();
+ res.Add(new LSL_String(mapIDstr));
res.Add(new LSL_Vector(mat.SpecularRepeatX, mat.SpecularRepeatY, 0));
- res.Add(new LSL_Vector(mat.SpecularLightColor.R, mat.SpecularLightColor.G, mat.SpecularLightColor.B));
+ res.Add(new LSL_Vector(mat.SpecularOffsetX, mat.SpecularOffsetY, 0));
+ res.Add(new LSL_Float(mat.SpecularRotation));
+ res.Add(new LSL_Vector(mat.SpecularLightColor.R * colorScale,
+ mat.SpecularLightColor.G * colorScale,
+ mat.SpecularLightColor.B * colorScale));
res.Add(new LSL_Integer(mat.SpecularLightExponent));
res.Add(new LSL_Integer(mat.EnvironmentIntensity));
}
--
cgit v1.1
From 2f6c78b88895c0934179fb8eb70ae1dc08883d5f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 25 Apr 2017 04:58:24 +0100
Subject: finish encoding number of mesh faces in pbs shape on new meshs
upload, and *HACK* flag it setting hollow shape to triangle. (some limited
encoding as added some months ago, but only for viewers LOD). Use this hack
flag to fix sop number of faces. old meshs will still report 8 faces,
information to fix this seems lost unless the mesh asset is decoded
---
.../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 25 ++++++++++++++++------
.../Region/ClientStack/Linden/UDP/LLClientView.cs | 25 +++++++---------------
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 24 ++++++++++++---------
3 files changed, 41 insertions(+), 33 deletions(-)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 58b7b00..46932b1 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -1006,28 +1006,41 @@ namespace OpenSim.Region.ClientStack.Linden
}
}
- // faces number to pbs shape
- switch(face_list.Count)
+ // faces number to pbs shape for viewers LOD
+ // now extended to full faces equivalent
+ int nfaces = face_list.Count;
+ switch(nfaces)
{
case 1:
case 2:
- pbs.ProfileCurve = (byte)ProfileCurve.Circle;
+ pbs.ProfileCurve = (byte)ProfileCurve.Circle | (byte)HollowShape.Triangle;
pbs.PathCurve = (byte)PathCurve.Circle;
+ if(nfaces == 2)
+ pbs.ProfileHollow = 1;
break;
case 3:
case 4:
- pbs.ProfileCurve = (byte)ProfileCurve.Circle;
+ pbs.ProfileCurve = (byte)ProfileCurve.Circle | (byte)HollowShape.Triangle;
pbs.PathCurve = (byte)PathCurve.Line;
+ if(nfaces == 4)
+ pbs.ProfileHollow = 1;
break;
+
case 5:
- pbs.ProfileCurve = (byte)ProfileCurve.EqualTriangle;
+ pbs.ProfileCurve = (byte)ProfileCurve.EqualTriangle | (byte)HollowShape.Triangle;
pbs.PathCurve = (byte)PathCurve.Line;
break;
default:
- pbs.ProfileCurve = (byte)ProfileCurve.Square;
+ // hack to flag that pbs does represent number of faces
+ //meshs where never uploaded with this
+ pbs.ProfileCurve = (byte)ProfileCurve.Square | (byte)HollowShape.Triangle;
pbs.PathCurve = (byte)PathCurve.Line;
+ if(nfaces == 7)
+ pbs.ProfileHollow = 1;
+ else if(nfaces == 8)
+ pbs.ProfileBegin = 1;
break;
}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index dc8d267..cf96a8b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -4212,12 +4212,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
SceneObjectGroup grp = part.ParentGroup;
if (grp.inTransit && !update.Flags.HasFlag(PrimUpdateFlags.SendInTransit))
continue;
+/* debug
if (update.Flags.HasFlag(PrimUpdateFlags.SendInTransit))
{
}
-
+*/
if (grp.IsDeleted)
{
// Don't send updates for objects that have been marked deleted.
@@ -4274,14 +4275,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
part.Shape.LightEntry = false;
}
-
- if (part.Shape != null && (part.Shape.SculptType == (byte)SculptType.Mesh))
- {
- // Ensure that mesh has at least 8 valid faces
- part.Shape.ProfileBegin = 12500;
- part.Shape.ProfileEnd = 0;
- part.Shape.ProfileHollow = 27500;
- }
}
if(doCulling && !grp.IsAttachment)
@@ -4309,14 +4302,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
continue;
}
}
-
- if (part.Shape != null && (part.Shape.SculptType == (byte)SculptType.Mesh))
- {
- // Ensure that mesh has at least 8 valid faces
- part.Shape.ProfileBegin = 12500;
- part.Shape.ProfileEnd = 0;
- part.Shape.ProfileHollow = 27500;
- }
}
else if (update.Entity is ScenePresence)
{
@@ -5877,6 +5862,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
update.PCode = part.Shape.PCode;
update.ProfileBegin = part.Shape.ProfileBegin;
update.ProfileCurve = part.Shape.ProfileCurve;
+
+ if(part.Shape.SculptType == (byte)SculptType.Mesh) // filter out hack
+ update.ProfileCurve = (byte)(part.Shape.ProfileCurve & 0x0f);
+ else
+ update.ProfileCurve = part.Shape.ProfileCurve;
+
update.ProfileEnd = part.Shape.ProfileEnd;
update.ProfileHollow = part.Shape.ProfileHollow;
update.PSBlock = part.ParticleSystem ?? Utils.EmptyBytes;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index affd4de..19bf53f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3728,7 +3728,18 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
bool hasDimple;
bool hasProfileCut;
- PrimType primType = GetPrimType();
+ if(Shape.SculptEntry)
+ {
+ if (Shape.SculptType != (byte)SculptType.Mesh)
+ return 1; // sculp
+
+ //hack to detect new upload with faces data enconded on pbs
+ if ((Shape.ProfileCurve & 0xf0) != (byte)HollowShape.Triangle)
+ // old broken upload TODO
+ return 8;
+ }
+
+ PrimType primType = GetPrimType(true);
HasCutHollowDimpleProfileCut(primType, Shape, out hasCut, out hasHollow, out hasDimple, out hasProfileCut);
switch (primType)
@@ -3772,13 +3783,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
if (hasProfileCut) ret += 2;
if (hasHollow) ret += 1;
break;
- case PrimType.SCULPT:
- // Special mesh handling
- if (Shape.SculptType == (byte)SculptType.Mesh)
- ret = 8; // if it's a mesh then max 8 faces
- else
- ret = 1; // if it's a sculpt then max 1 face
- break;
}
return ret;
@@ -3789,9 +3793,9 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
///
///
///
- public PrimType GetPrimType()
+ public PrimType GetPrimType(bool ignoreSculpt = false)
{
- if (Shape.SculptEntry)
+ if (Shape.SculptEntry && !ignoreSculpt)
return PrimType.SCULPT;
if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square)
--
cgit v1.1
From 29ab39f14f69822bd0df0b263b03bec69c376e39 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 25 Apr 2017 13:05:20 +0100
Subject: cosmetics on mesh upload encoding of number of faces on pbs shape.
Use opensim shape enums in place of libovm for coerence, add a few coments.
---
.../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 59 +++++++++++++---------
1 file changed, 36 insertions(+), 23 deletions(-)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 46932b1..4a5a8e7 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -1011,36 +1011,49 @@ namespace OpenSim.Region.ClientStack.Linden
int nfaces = face_list.Count;
switch(nfaces)
{
- case 1:
- case 2:
- pbs.ProfileCurve = (byte)ProfileCurve.Circle | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)PathCurve.Circle;
- if(nfaces == 2)
- pbs.ProfileHollow = 1;
+ case 0: // low oops case
+ case 1: // torus
+ pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
+ pbs.PathCurve = (byte)Extrusion.Curve1;
break;
- case 3:
- case 4:
- pbs.ProfileCurve = (byte)ProfileCurve.Circle | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)PathCurve.Line;
- if(nfaces == 4)
- pbs.ProfileHollow = 1;
+ case 2: // torus with hollow (a sl viewer whould see 4 faces on a hollow sphere)
+ pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
+ pbs.PathCurve = (byte)Extrusion.Curve1;
+ pbs.ProfileHollow = 1;
break;
- case 5:
- pbs.ProfileCurve = (byte)ProfileCurve.EqualTriangle | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)PathCurve.Line;
+ case 3: // cylinder
+ pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
+ pbs.PathCurve = (byte)Extrusion.Straight;
break;
- default:
- // hack to flag that pbs does represent number of faces
- //meshs where never uploaded with this
+ case 4: // cylinder with hollow
+ pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
+ pbs.PathCurve = (byte)Extrusion.Straight;
+ pbs.ProfileHollow = 1;
+ break;
+
+ case 5: // prism
+ pbs.ProfileCurve = (byte)ProfileShape.EquilateralTriangle | (byte)HollowShape.Triangle;
+ pbs.PathCurve = (byte)Extrusion.Straight;
+ break;
+
+ case 6: // box
+ pbs.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
+ pbs.PathCurve = (byte)Extrusion.Straight;
+ break;
+
+ case 7: // box with hollow
+ pbs.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
+ pbs.PathCurve = (byte)Extrusion.Straight;
+ pbs.ProfileHollow = 1;
+ break;
+
+ default: // 8 faces box with cut
pbs.ProfileCurve = (byte)ProfileCurve.Square | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)PathCurve.Line;
- if(nfaces == 7)
- pbs.ProfileHollow = 1;
- else if(nfaces == 8)
- pbs.ProfileBegin = 1;
+ pbs.PathCurve = (byte)Extrusion.Straight;
+ pbs.ProfileBegin = 1;
break;
}
--
cgit v1.1
From 7c5376f224743358a7640477fedfd9de5b27b48d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 25 Apr 2017 14:21:01 +0100
Subject: move mesh pbs creation code out of mesh upload code into to
PrimitiveBaseShape.cs
---
OpenSim/Framework/PrimitiveBaseShape.cs | 64 ++++++++++++++++
.../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 85 ++++------------------
2 files changed, 78 insertions(+), 71 deletions(-)
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index 29985d2..a830551 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -328,6 +328,70 @@ namespace OpenSim.Framework
return shape;
}
+ public static PrimitiveBaseShape CreateMesh(int numberOfFaces, UUID meshAssetID)
+ {
+ PrimitiveBaseShape shape = new PrimitiveBaseShape();
+
+ shape._pathScaleX = 100;
+ shape._pathScaleY = 100;
+
+ if(numberOfFaces <= 0) // oops ?
+ numberOfFaces = 1;
+
+ switch(numberOfFaces)
+ {
+ case 1: // torus
+ shape.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
+ shape.PathCurve = (byte)Extrusion.Curve1;
+ break;
+
+ case 2: // torus with hollow (a sl viewer whould see 4 faces on a hollow sphere)
+ shape.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
+ shape.PathCurve = (byte)Extrusion.Curve1;
+ shape.ProfileHollow = 1;
+ break;
+
+ case 3: // cylinder
+ shape.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
+ shape.PathCurve = (byte)Extrusion.Straight;
+ break;
+
+ case 4: // cylinder with hollow
+ shape.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
+ shape.PathCurve = (byte)Extrusion.Straight;
+ shape.ProfileHollow = 1;
+ break;
+
+ case 5: // prism
+ shape.ProfileCurve = (byte)ProfileShape.EquilateralTriangle | (byte)HollowShape.Triangle;
+ shape.PathCurve = (byte)Extrusion.Straight;
+ break;
+
+ case 6: // box
+ shape.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
+ shape.PathCurve = (byte)Extrusion.Straight;
+ break;
+
+ case 7: // box with hollow
+ shape.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
+ shape.PathCurve = (byte)Extrusion.Straight;
+ shape.ProfileHollow = 1;
+ break;
+
+ default: // 8 faces box with cut
+ shape.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
+ shape.PathCurve = (byte)Extrusion.Straight;
+ shape.ProfileBegin = 1;
+ break;
+ }
+
+ shape.SculptEntry = true;
+ shape.SculptType = (byte)OpenMetaverse.SculptType.Mesh;
+ shape.SculptTexture = meshAssetID;
+
+ return shape;
+ }
+
public void SetScale(float side)
{
_scale = new Vector3(side, side, side);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 4a5a8e7..e1b9e08 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -946,17 +946,26 @@ namespace OpenSim.Region.ClientStack.Linden
continue;
}
- PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox();
+ OSDArray face_list = (OSDArray)inner_instance_list["face_list"];
+
+ PrimitiveBaseShape pbs = null;
+ if (inner_instance_list.ContainsKey("mesh")) // seems to happen always but ...
+ {
+ int meshindx = inner_instance_list["mesh"].AsInteger();
+ if (meshAssets.Count > meshindx)
+ pbs = PrimitiveBaseShape.CreateMesh(face_list.Count, meshAssets[meshindx]);
+ }
+ if(pbs == null) // fallback
+ pbs = PrimitiveBaseShape.CreateBox();
Primitive.TextureEntry textureEntry
= new Primitive.TextureEntry(Primitive.TextureEntry.WHITE_TEXTURE);
-
- OSDArray face_list = (OSDArray)inner_instance_list["face_list"];
for (uint face = 0; face < face_list.Count; face++)
{
OSDMap faceMap = (OSDMap)face_list[(int)face];
- Primitive.TextureEntryFace f = pbs.Textures.CreateFace(face);
+
+ Primitive.TextureEntryFace f = textureEntry.CreateFace(face); //clone the default
if (faceMap.ContainsKey("fullbright"))
f.Fullbright = faceMap["fullbright"].AsBoolean();
if (faceMap.ContainsKey("diffuse_color"))
@@ -986,77 +995,11 @@ namespace OpenSim.Region.ClientStack.Linden
if (textures.Count > textureNum)
f.TextureID = textures[textureNum];
- else
- f.TextureID = Primitive.TextureEntry.WHITE_TEXTURE;
-
+
textureEntry.FaceTextures[face] = f;
}
-
pbs.TextureEntry = textureEntry.GetBytes();
- if (inner_instance_list.ContainsKey("mesh")) // seems to happen always but ...
- {
- int meshindx = inner_instance_list["mesh"].AsInteger();
- if (meshAssets.Count > meshindx)
- {
- pbs.SculptEntry = true;
- pbs.SculptType = (byte)SculptType.Mesh;
- pbs.SculptTexture = meshAssets[meshindx]; // actual asset UUID after meshs suport introduction
- // data will be requested from asset on rez (i hope)
- }
- }
-
- // faces number to pbs shape for viewers LOD
- // now extended to full faces equivalent
- int nfaces = face_list.Count;
- switch(nfaces)
- {
- case 0: // low oops case
- case 1: // torus
- pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)Extrusion.Curve1;
- break;
-
- case 2: // torus with hollow (a sl viewer whould see 4 faces on a hollow sphere)
- pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)Extrusion.Curve1;
- pbs.ProfileHollow = 1;
- break;
-
- case 3: // cylinder
- pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)Extrusion.Straight;
- break;
-
- case 4: // cylinder with hollow
- pbs.ProfileCurve = (byte)ProfileShape.Circle | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)Extrusion.Straight;
- pbs.ProfileHollow = 1;
- break;
-
- case 5: // prism
- pbs.ProfileCurve = (byte)ProfileShape.EquilateralTriangle | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)Extrusion.Straight;
- break;
-
- case 6: // box
- pbs.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)Extrusion.Straight;
- break;
-
- case 7: // box with hollow
- pbs.ProfileCurve = (byte)ProfileShape.Square | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)Extrusion.Straight;
- pbs.ProfileHollow = 1;
- break;
-
- default: // 8 faces box with cut
- pbs.ProfileCurve = (byte)ProfileCurve.Square | (byte)HollowShape.Triangle;
- pbs.PathCurve = (byte)Extrusion.Straight;
- pbs.ProfileBegin = 1;
- break;
- }
-
Vector3 position = inner_instance_list["position"].AsVector3();
Quaternion rotation = inner_instance_list["rotation"].AsQuaternion();
--
cgit v1.1
From 3b01c209b2931fdb2e39890f9ad14e0c6c870288 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 25 Apr 2017 16:24:07 -0700
Subject: Update libOMV
---
bin/CSJ2K.dll | Bin 502784 -> 483328 bytes
bin/OpenMetaverse.Rendering.Meshmerizer.dll | Bin 20480 -> 20480 bytes
bin/OpenMetaverse.StructuredData.dll | Bin 102400 -> 102400 bytes
bin/OpenMetaverse.dll | Bin 2199552 -> 2199552 bytes
bin/OpenMetaverseTypes.dll | Bin 110592 -> 110592 bytes
5 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/CSJ2K.dll b/bin/CSJ2K.dll
index 238291f..e882e4c 100755
Binary files a/bin/CSJ2K.dll and b/bin/CSJ2K.dll differ
diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll
index 1a12a1e..7087584 100755
Binary files a/bin/OpenMetaverse.Rendering.Meshmerizer.dll and b/bin/OpenMetaverse.Rendering.Meshmerizer.dll differ
diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll
index 7aeb089..dd3113d 100755
Binary files a/bin/OpenMetaverse.StructuredData.dll and b/bin/OpenMetaverse.StructuredData.dll differ
diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll
index 5c576a7..1a63a9f 100755
Binary files a/bin/OpenMetaverse.dll and b/bin/OpenMetaverse.dll differ
diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll
index a07cc1d..cf5080d 100755
Binary files a/bin/OpenMetaverseTypes.dll and b/bin/OpenMetaverseTypes.dll differ
--
cgit v1.1
From 2b8cdb2a754b269aa8d0a2be230466806d52611a Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 25 Apr 2017 20:08:06 -0700
Subject: If we're going to show regions twice (in standalone) at least make
the formatting consistent...
---
OpenSim/Services/GridService/GridService.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 6153f5e..a5c7d34 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -909,9 +909,9 @@ namespace OpenSim.Services.GridService
private void OutputRegionsToConsoleSummary(List regions)
{
ConsoleDisplayTable dispTable = new ConsoleDisplayTable();
- dispTable.AddColumn("Name", 44);
- dispTable.AddColumn("ID", 36);
- dispTable.AddColumn("Position", 11);
+ dispTable.AddColumn("Name", ConsoleDisplayUtil.RegionNameSize);
+ dispTable.AddColumn("ID", ConsoleDisplayUtil.UuidSize);
+ dispTable.AddColumn("Position", ConsoleDisplayUtil.CoordTupleSize);
dispTable.AddColumn("Size", 11);
dispTable.AddColumn("Flags", 60);
--
cgit v1.1
From ce3af94a693aa05e90416649f832f36b62630c69 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 26 Apr 2017 07:19:44 +0100
Subject: mantis 6738: change parsing of the HTTP_CUSTOM_HEADER parameter and
ignore entries in excess of 8 on the request
---
.../Scripting/HttpRequest/ScriptsHttpRequests.cs | 12 ++++--------
.../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 13 ++++++++++---
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 09891f7..035097f 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -223,20 +223,16 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
if (parms.Length - i < 2)
break;
- //Have we reached the end of the list of headers?
- //End is marked by a string with a single digit.
- //We already know we have at least one parameter
- //so it is safe to do this check at top of loop.
- if (Char.IsDigit(parms[i][0]))
- break;
-
if (htc.HttpCustomHeaders == null)
htc.HttpCustomHeaders = new List();
htc.HttpCustomHeaders.Add(parms[i]);
htc.HttpCustomHeaders.Add(parms[i+1]);
+ int nexti = i + 2;
+ if (nexti >= parms.Length || Char.IsDigit(parms[nexti][0]))
+ break;
- i += 2;
+ i = nexti;
}
break;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 47c3cb8..2000c44 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -13405,6 +13405,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
List param = new List();
bool ok;
Int32 flag;
+ int nCustomHeaders = 0;
for (int i = 0; i < parameters.Data.Length; i += 2)
{
@@ -13431,6 +13432,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
//Second Life documentation for llHTTPRequest.
for (int count = 1; count <= 8; ++count)
{
+ if(nCustomHeaders >= 8)
+ {
+ Error("llHTTPRequest", "Max number of custom headers is 8, excess ignored");
+ break;
+ }
+
//Enough parameters remaining for (another) header?
if (parameters.Data.Length - i < 2)
{
@@ -13445,15 +13452,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
param.Add(parameters.Data[i].ToString());
param.Add(parameters.Data[i+1].ToString());
+ nCustomHeaders++;
//Have we reached the end of the list of headers?
//End is marked by a string with a single digit.
- if (i+2 >= parameters.Data.Length ||
- Char.IsDigit(parameters.Data[i].ToString()[0]))
+ if (i + 2 >= parameters.Data.Length ||
+ Char.IsDigit(parameters.Data[i + 2].ToString()[0]))
{
break;
}
-
i += 2;
}
}
--
cgit v1.1
From 1b8c71c965c82a79011290c2cfbcbc8eb1e409c4 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 26 Apr 2017 16:15:33 +0100
Subject: give more information on Fatal Error during region startup
---
OpenSim/Framework/Servers/BaseOpenSimServer.cs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index f761813..62cd543 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -163,8 +163,7 @@ namespace OpenSim.Framework.Servers
}
catch(Exception e)
{
- m_log.FatalFormat("Fatal error: {0}",
- (e.Message == null || e.Message == String.Empty) ? "Unknown reason":e.Message );
+ m_log.Fatal("Fatal error: " + e.ToString());
Environment.Exit(1);
}
--
cgit v1.1
From 8dfab8757ca4d8b8af6213f2d3b3bf1fd1d2f18e Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 26 Apr 2017 09:58:15 -0700
Subject: Fill out Current Outfit folder with links when creating the initial
avatar appearance. Some viewers (e.g. Singularity 1.8.7) get seriously
confused when the avatar has no current outfit links.
---
.../UserAccountService/UserAccountService.cs | 43 +++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs
index f6b003a..a22754f 100644
--- a/OpenSim/Services/UserAccountService/UserAccountService.cs
+++ b/OpenSim/Services/UserAccountService/UserAccountService.cs
@@ -640,9 +640,11 @@ namespace OpenSim.Services.UserAccountService
m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID);
InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, FolderType.BodyPart);
+ // Get Current Outfit folder
+ InventoryFolderBase currentOutfitFolder = m_InventoryService.GetFolderForType(principalID, FolderType.CurrentOutfit);
InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID);
- eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7");
+ eyes.AssetID = AvatarWearable.DEFAULT_EYES_ASSET;
eyes.Name = "Default Eyes";
eyes.CreatorId = principalID.ToString();
eyes.AssetType = (int)AssetType.Bodypart;
@@ -655,6 +657,7 @@ namespace OpenSim.Services.UserAccountService
eyes.NextPermissions = (uint)PermissionMask.All;
eyes.Flags = (uint)WearableType.Eyes;
m_InventoryService.AddItem(eyes);
+ CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Eyes, eyes.Name, eyes.ID, principalID, currentOutfitFolder.ID);
InventoryItemBase shape = new InventoryItemBase(UUID.Random(), principalID);
shape.AssetID = AvatarWearable.DEFAULT_BODY_ASSET;
@@ -670,6 +673,7 @@ namespace OpenSim.Services.UserAccountService
shape.NextPermissions = (uint)PermissionMask.All;
shape.Flags = (uint)WearableType.Shape;
m_InventoryService.AddItem(shape);
+ CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Shape, shape.Name, shape.ID, principalID, currentOutfitFolder.ID);
InventoryItemBase skin = new InventoryItemBase(UUID.Random(), principalID);
skin.AssetID = AvatarWearable.DEFAULT_SKIN_ASSET;
@@ -685,6 +689,7 @@ namespace OpenSim.Services.UserAccountService
skin.NextPermissions = (uint)PermissionMask.All;
skin.Flags = (uint)WearableType.Skin;
m_InventoryService.AddItem(skin);
+ CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Skin, skin.Name, skin.ID, principalID, currentOutfitFolder.ID);
InventoryItemBase hair = new InventoryItemBase(UUID.Random(), principalID);
hair.AssetID = AvatarWearable.DEFAULT_HAIR_ASSET;
@@ -700,6 +705,7 @@ namespace OpenSim.Services.UserAccountService
hair.NextPermissions = (uint)PermissionMask.All;
hair.Flags = (uint)WearableType.Hair;
m_InventoryService.AddItem(hair);
+ CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Hair, hair.Name, hair.ID, principalID, currentOutfitFolder.ID);
InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, FolderType.Clothing);
@@ -717,6 +723,7 @@ namespace OpenSim.Services.UserAccountService
shirt.NextPermissions = (uint)PermissionMask.All;
shirt.Flags = (uint)WearableType.Shirt;
m_InventoryService.AddItem(shirt);
+ CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Shirt, shirt.Name, shirt.ID, principalID, currentOutfitFolder.ID);
InventoryItemBase pants = new InventoryItemBase(UUID.Random(), principalID);
pants.AssetID = AvatarWearable.DEFAULT_PANTS_ASSET;
@@ -732,6 +739,7 @@ namespace OpenSim.Services.UserAccountService
pants.NextPermissions = (uint)PermissionMask.All;
pants.Flags = (uint)WearableType.Pants;
m_InventoryService.AddItem(pants);
+ CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Pants, pants.Name, pants.ID, principalID, currentOutfitFolder.ID);
if (m_AvatarService != null)
{
@@ -815,6 +823,8 @@ namespace OpenSim.Services.UserAccountService
{
// Get Clothing folder of receiver
InventoryFolderBase destinationFolder = m_InventoryService.GetFolderForType(destination, FolderType.Clothing);
+ // Get Current Outfit folder
+ InventoryFolderBase currentOutfitFolder = m_InventoryService.GetFolderForType(destination, FolderType.CurrentOutfit);
if (destinationFolder == null)
throw new Exception("Cannot locate folder(s)");
@@ -841,6 +851,7 @@ namespace OpenSim.Services.UserAccountService
for (int i = 0; i < wearables.Length; i++)
{
wearable = wearables[i];
+ m_log.DebugFormat("[XXX]: Getting item {0} from avie {1}", wearable[0].ItemID, source);
if (wearable[0].ItemID != UUID.Zero)
{
// Get inventory item and copy it
@@ -878,6 +889,9 @@ namespace OpenSim.Services.UserAccountService
AvatarWearable newWearable = new AvatarWearable();
newWearable.Wear(destinationItem.ID, wearable[0].AssetID);
avatarAppearance.SetWearable(i, newWearable);
+
+ // Add to Current Outfit
+ CreateCurrentOutfitLink((int)InventoryType.Wearable, item.Flags, item.Name, destinationItem.ID, destination, currentOutfitFolder.ID);
}
else
{
@@ -930,6 +944,9 @@ namespace OpenSim.Services.UserAccountService
// Attach item
avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID);
m_log.DebugFormat("[USER ACCOUNT SERVICE]: Attached {0}", destinationItem.ID);
+
+ // Add to Current Outfit
+ CreateCurrentOutfitLink(destinationItem.InvType, item.Flags, item.Name, destinationItem.ID, destination, currentOutfitFolder.ID);
}
else
{
@@ -939,6 +956,30 @@ namespace OpenSim.Services.UserAccountService
}
}
+ protected void CreateCurrentOutfitLink(int invType, uint itemType, string name, UUID itemID, UUID userID, UUID currentOutfitFolderUUID)
+ {
+ UUID LinkInvItem = UUID.Random();
+ InventoryItemBase itembase = new InventoryItemBase(LinkInvItem, userID)
+ {
+ AssetID = itemID,
+ AssetType = (int)AssetType.Link,
+ CreatorId = userID.ToString(),
+ InvType = invType,
+ Description = "",
+ //Folder = m_InventoryService.GetFolderForType(userID, FolderType.CurrentOutfit).ID,
+ Folder = currentOutfitFolderUUID,
+ Flags = itemType,
+ Name = name,
+ BasePermissions = (uint)PermissionMask.Copy,
+ CurrentPermissions = (uint)PermissionMask.Copy,
+ EveryOnePermissions = (uint)PermissionMask.Copy,
+ GroupPermissions = (uint)PermissionMask.Copy,
+ NextPermissions = (uint)PermissionMask.Copy
+ };
+
+ m_InventoryService.AddItem(itembase);
+ }
+
///
/// Apply next owner permissions.
///
--
cgit v1.1
From ce655056cab400c0d0705861cef03eef541875c5 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 26 Apr 2017 18:21:35 +0100
Subject: ubMeshmerizer: fix the orientation of last triangle on top/bottom
faces of hollow cylinders plz delete contents of bin/MeshCache to remove
defective entries"
---
OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs
index 10facf2..e93175f 100644
--- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs
+++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/PrimMesher.cs
@@ -755,8 +755,8 @@ namespace PrimMesher
if (hollowAngles.angles[0].angle - angles.angles[i].angle < angles.angles[i].angle - hollowAngles.angles[maxJ].angle + 0.000001f)
{
newFace.v1 = 0;
- newFace.v2 = numTotalVerts - maxJ - 1;
- newFace.v3 = numTotalVerts - 1;
+ newFace.v2 = numTotalVerts - 1;
+ newFace.v3 = numTotalVerts - maxJ - 1;
faces.Add(newFace);
}
--
cgit v1.1
From 8d3d87e0b2be0fdaf06e1a6309cd1f1249dcf024 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 27 Apr 2017 00:02:01 +0100
Subject: add a usefull taint and update
---
.../Framework/Scenes/SceneObjectGroup.Inventory.cs | 94 +++++++++++++++-------
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +
2 files changed, 69 insertions(+), 27 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 12e53a8..081281e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -252,18 +252,26 @@ namespace OpenSim.Region.Framework.Scenes
}
// new test code, to place in better place later
- private object PermissionsLock = new object();
+ private object m_PermissionsLock = new object();
+ private bool m_EffectivePermsInvalid = true;
+
+ public void InvalidateEffectivePerms()
+ {
+ lock(m_PermissionsLock)
+ m_EffectivePermsInvalid = true;
+ }
private uint m_EffectiveEveryOnePerms;
public uint EffectiveEveryOnePerms
{
get
{
- // this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
- // bc this is on heavy duty code paths
- // but for now we need to test the concept
-// AggregateDeepPerms();
- return m_EffectiveEveryOnePerms;
+ lock(m_PermissionsLock)
+ {
+ if(m_EffectivePermsInvalid)
+ AggregatePerms();
+ return m_EffectiveEveryOnePerms;
+ }
}
}
@@ -272,11 +280,12 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
- // this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
- // bc this is on heavy duty code paths
- // but for now we need to test the concept
-// AggregateDeepPerms();
- return m_EffectiveGroupPerms;
+ lock(m_PermissionsLock)
+ {
+ if(m_EffectivePermsInvalid)
+ AggregatePerms();
+ return m_EffectiveGroupPerms;
+ }
}
}
@@ -285,11 +294,12 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
- // this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
- // bc this is on heavy duty code paths
- // but for now we need to test the concept
-// AggregateDeepPerms();
- return m_EffectiveGroupOrEveryOnePerms;
+ lock(m_PermissionsLock)
+ {
+ if(m_EffectivePermsInvalid)
+ AggregatePerms();
+ return m_EffectiveGroupOrEveryOnePerms;
+ }
}
}
@@ -298,11 +308,12 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
- // this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc)
- // bc this is on heavy duty code paths
- // but for now we need to test the concept
- // AggregateDeepPerms();
- return m_EffectiveOwnerPerms;
+ lock(m_PermissionsLock)
+ {
+ if(m_EffectivePermsInvalid)
+ AggregatePerms();
+ return m_EffectiveOwnerPerms;
+ }
}
}
@@ -310,7 +321,7 @@ namespace OpenSim.Region.Framework.Scenes
// AggregatePerms does same using cached parts content perms
public void AggregateDeepPerms()
{
- lock(PermissionsLock)
+ lock(m_PermissionsLock)
{
// aux
const uint allmask = (uint)PermissionMask.AllEffective;
@@ -370,6 +381,7 @@ namespace OpenSim.Region.Framework.Scenes
m_EffectiveEveryOnePerms = everyone & owner;
m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner;
+ m_EffectivePermsInvalid = false;
}
}
@@ -377,7 +389,7 @@ namespace OpenSim.Region.Framework.Scenes
// ie is AggregateDeepPerms without the part.AggregateInnerPerms() call on parts loop
public void AggregatePerms()
{
- lock(PermissionsLock)
+ lock(m_PermissionsLock)
{
// aux
const uint allmask = (uint)PermissionMask.AllEffective;
@@ -394,6 +406,8 @@ namespace OpenSim.Region.Framework.Scenes
uint rootEveryonePerms = RootPart.EveryoneMask;
uint everyone = rootEveryonePerms;
+ bool needUpdate = false;
+
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
@@ -409,7 +423,12 @@ namespace OpenSim.Region.Framework.Scenes
owner |= (uint)PermissionMask.Transfer;
owner &= basePerms;
- m_EffectiveOwnerPerms = owner;
+ if(owner != m_EffectiveOwnerPerms)
+ {
+ needUpdate = true;
+ m_EffectiveOwnerPerms = owner;
+ }
+
uint ownertransfermask = owner & (uint)PermissionMask.Transfer;
// recover modify and move
@@ -421,7 +440,12 @@ namespace OpenSim.Region.Framework.Scenes
group |= ownertransfermask;
uint groupOrEveryone = group;
- m_EffectiveGroupPerms = group & owner;
+ uint tmpPerms = group & owner;
+ if(tmpPerms != m_EffectiveGroupPerms)
+ {
+ needUpdate = true;
+ m_EffectiveGroupPerms = tmpPerms;
+ }
// recover move
rootEveryonePerms &= (uint)PermissionMask.Move;
@@ -434,8 +458,24 @@ namespace OpenSim.Region.Framework.Scenes
groupOrEveryone |= everyone;
- m_EffectiveEveryOnePerms = everyone & owner;
- m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner;
+ tmpPerms = everyone & owner;
+ if(tmpPerms != m_EffectiveEveryOnePerms)
+ {
+ needUpdate = true;
+ m_EffectiveEveryOnePerms = tmpPerms;
+ }
+
+ tmpPerms = groupOrEveryone & owner;
+ if(tmpPerms != m_EffectiveGroupOrEveryOnePerms)
+ {
+ needUpdate = true;
+ m_EffectiveGroupOrEveryOnePerms = tmpPerms;
+ }
+
+ m_EffectivePermsInvalid = false;
+
+ if(needUpdate)
+ RootPart.ScheduleFullUpdate();
}
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 19bf53f..e4f18d9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2579,6 +2579,8 @@ namespace OpenSim.Region.Framework.Scenes
AggregatedInnerOwnerPerms = owner & mask;
AggregatedInnerGroupPerms = group & mask;
AggregatedInnerEveryonePerms = everyone & mask;
+ if(ParentGroup != null)
+ ParentGroup.InvalidateEffectivePerms();
}
}
--
cgit v1.1
From ba4e13ef55c378db13b6aa97316e99d651762a02 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 28 Apr 2017 20:03:44 +0100
Subject: a few changes to permissions folding... we are testing. at this point
only use master for TESTING also
---
OpenSim/Framework/Util.cs | 5 ++-
.../InventoryAccess/InventoryAccessModule.cs | 35 +++++++++-------
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 13 ++++--
.../Framework/Scenes/SceneObjectGroup.Inventory.cs | 25 +++---------
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 +-
.../Framework/Scenes/SceneObjectPartInventory.cs | 46 +++++++++++++---------
6 files changed, 69 insertions(+), 59 deletions(-)
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 0ec24e6..4d025a9 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -79,7 +79,9 @@ namespace OpenSim.Framework
FoldedMask = 0x0f,
- //
+ FoldingShift = 13 , // number of bit shifts from normal perm to folded or back (same as Transfer shift below)
+ // when doing as a block
+
Transfer = 1 << 13, // 0x02000
Modify = 1 << 14, // 0x04000
Copy = 1 << 15, // 0x08000
@@ -91,6 +93,7 @@ namespace OpenSim.Framework
All = 0x8e000,
AllAndExport = 0x9e000,
AllEffective = 0x9e000
+
}
///
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 67c847b..eb7211c 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -574,8 +574,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
IClientAPI remoteClient)
{
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7;
- uint allObjectsNextOwnerPerms = 0x7fffffff;
-
+
// For the porposes of inventory, an object is modify if the prims
// are modify. This allows renaming an object that contains no
// mod items.
@@ -591,21 +590,27 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
{
- uint perms = effectivePerms;
- uint nextPerms = (perms & 7) << 13;
- if ((nextPerms & (uint)PermissionMask.Copy) == 0)
- perms &= ~(uint)PermissionMask.Copy;
- if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
- perms &= ~(uint)PermissionMask.Transfer;
- if ((nextPerms & (uint)PermissionMask.Modify) == 0)
- perms &= ~(uint)PermissionMask.Modify;
+ if ((effectivePerms & (uint)PermissionMask.FoldedCopy) == 0)
+ effectivePerms &= ~(uint)PermissionMask.Copy;
+ if ((effectivePerms & (uint)PermissionMask.FoldedTransfer) == 0)
+ effectivePerms &= ~(uint)PermissionMask.Transfer;
+ if ((effectivePerms & (uint)PermissionMask.FoldedExport) == 0)
+ effectivePerms &= ~(uint)PermissionMask.Export;
-// item.BasePermissions = perms & so.RootPart.NextOwnerMask;
+ uint basePerms = effectivePerms & so.RootPart.NextOwnerMask;
- uint nextp = so.RootPart.NextOwnerMask | (uint)PermissionMask.FoldedMask;
- item.BasePermissions = perms & nextp;
+ if((basePerms & (uint)PermissionMask.Copy) == 0)
+ basePerms |= (uint)PermissionMask.Transfer;
+
+ // unlock
+ basePerms |= (uint)PermissionMask.Move;
+
+ basePerms &= ~(uint)PermissionMask.FoldedMask;
+ basePerms |= ((basePerms >> (int)PermissionMask.FoldingShift) & (uint)PermissionMask.FoldedMask);
+
+ item.BasePermissions = basePerms;
item.CurrentPermissions = item.BasePermissions;
- item.NextPermissions = perms & so.RootPart.NextOwnerMask;
+ item.NextPermissions = effectivePerms & so.RootPart.NextOwnerMask;
item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask;
item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask;
@@ -626,7 +631,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
(uint)PermissionMask.Modify |
(uint)PermissionMask.Move |
(uint)PermissionMask.Export |
- 7); // Preserve folded permissions
+ (uint)PermissionMask.FoldedMask); // Preserve folded permissions ??
}
return item;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 2f016fa..edf8cb6 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -682,19 +682,19 @@ namespace OpenSim.Region.Framework.Scenes
// These will be applied to the root prim at next rez.
// The legacy slam bit (bit 3) and folded permission (bits 0-2)
// are preserved due to the above mangling
- ownerPerms &= nextPerms;
+// ownerPerms &= nextPerms;
// Mask the base permissions. This is a conservative
// approach altering only the three main perms
- basePerms &= nextPerms;
+// basePerms &= nextPerms;
// Mask out the folded portion of the base mask.
// While the owner mask carries the actual folded
// permissions, the base mask carries the original
// base mask, before masking with the folded perms.
// We need this later for rezzing.
- basePerms &= ~(uint)PermissionMask.FoldedMask;
- basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0);
+// basePerms &= ~(uint)PermissionMask.FoldedMask;
+// basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0);
// If this is an object, root prim perms may be more
// permissive than folded perms. Use folded perms as
@@ -729,6 +729,11 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ // move here so nextperms are mandatory
+ ownerPerms &= nextPerms;
+ basePerms &= nextPerms;
+ basePerms &= ~(uint)PermissionMask.FoldedMask;
+ basePerms |= ((basePerms >> 13) & 7) | (((basePerms & (uint)PermissionMask.Export) != 0) ? (uint)PermissionMask.FoldedExport : 0);
// Assign to the actual item. Make sure the slam bit is
// set, if it wasn't set before.
itemCopy.BasePermissions = basePerms;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 081281e..42f47b5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -326,7 +326,7 @@ namespace OpenSim.Region.Framework.Scenes
// aux
const uint allmask = (uint)PermissionMask.AllEffective;
const uint movemodmask = (uint)(PermissionMask.Move | PermissionMask.Modify);
- const uint copytransfermast = (uint)(PermissionMask.Copy | PermissionMask.Transfer);
+ const uint copytransfermask = (uint)(PermissionMask.Copy | PermissionMask.Transfer);
uint basePerms = (RootPart.BaseMask & allmask) | (uint)PermissionMask.Move;
bool noBaseTransfer = (basePerms & (uint)PermissionMask.Transfer) == 0;
@@ -350,7 +350,7 @@ namespace OpenSim.Region.Framework.Scenes
// recover modify and move
rootOwnerPerms &= movemodmask;
owner |= rootOwnerPerms;
- if((owner & copytransfermast) == 0)
+ if((owner & copytransfermask) == 0)
owner |= (uint)PermissionMask.Transfer;
owner &= basePerms;
@@ -479,17 +479,13 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public uint GetEffectivePermissions()
- {
- return GetEffectivePermissions(false);
- }
-
public uint GetEffectivePermissions(bool useBase)
{
uint perms=(uint)(PermissionMask.Modify |
PermissionMask.Copy |
PermissionMask.Move |
- PermissionMask.Transfer) | 7;
+ PermissionMask.Transfer |
+ PermissionMask.FoldedMask);
uint ownerMask = 0x7fffffff;
@@ -512,17 +508,8 @@ namespace OpenSim.Region.Framework.Scenes
perms &= ~(uint)PermissionMask.Copy;
if ((ownerMask & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer;
-
- // If root prim permissions are applied here, this would screw
- // with in-inventory manipulation of the next owner perms
- // in a major way. So, let's move this to the give itself.
- // Yes. I know. Evil.
-// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0)
-// perms &= ~((uint)PermissionMask.Modify >> 13);
-// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0)
-// perms &= ~((uint)PermissionMask.Copy >> 13);
-// if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0)
-// perms &= ~((uint)PermissionMask.Transfer >> 13);
+ if ((ownerMask & (uint)PermissionMask.Export) == 0)
+ perms &= ~(uint)PermissionMask.Export;
return perms;
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index e4f18d9..f948336 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -5288,9 +5288,9 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
// Export needs to be preserved in the base and everyone
// mask, but removed in the owner mask as a next owner
// can never change the export status
- BaseMask &= NextOwnerMask | (uint)PermissionMask.Export;
+ BaseMask &= (NextOwnerMask | (uint)PermissionMask.Export);
OwnerMask &= NextOwnerMask;
- EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export;
+ EveryoneMask &= (NextOwnerMask | (uint)PermissionMask.Export);
GroupMask = 0; // Giving an object zaps group permissions
Inventory.ApplyNextOwnerPermissions();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index b53c355..894078d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1340,33 +1340,38 @@ namespace OpenSim.Region.Framework.Scenes
public uint MaskEffectivePermissions()
{
+ // used to propagate permissions restrictions outwards
+ // Modify does not propagate outwards.
uint mask=0x7fffffff;
-
+
foreach (TaskInventoryItem item in m_items.Values)
{
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
- mask &= ~((uint)PermissionMask.Copy >> 13);
+ mask &= ~((uint)PermissionMask.FoldedCopy);
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
- mask &= ~((uint)PermissionMask.Transfer >> 13);
- if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
- mask &= ~((uint)PermissionMask.Modify >> 13);
+ mask &= ~((uint)PermissionMask.FoldedTransfer);
+ if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Export) == 0)
+ mask &= ~((uint)PermissionMask.FoldedExport);
+ // this breaks some SL legal use cases
+ // there should be no folding from task inventory
+/*
if (item.InvType == (int)InventoryType.Object)
{
- if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
- mask &= ~((uint)PermissionMask.Copy >> 13);
- if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
- mask &= ~((uint)PermissionMask.Transfer >> 13);
- if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
- mask &= ~((uint)PermissionMask.Modify >> 13);
+ if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedCopy)) == 0)
+ mask &= ~((uint)PermissionMask.FoldedCopy);
+ if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedTransfer)) == 0)
+ mask &= ~((uint)PermissionMask.FoldedTransfer);
+ if ((item.CurrentPermissions & (uint)PermissionMask.FoldedExport) == 0)
+ mask &= ~((uint)PermissionMask.FoldedExport);
}
-
+*/
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer;
- if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
- mask &= ~(uint)PermissionMask.Modify;
+ if ((item.CurrentPermissions & (uint)PermissionMask.Export) == 0)
+ mask &= ~((uint)PermissionMask.Export);
}
return mask;
}
@@ -1375,19 +1380,24 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (TaskInventoryItem item in m_items.Values)
{
- if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
+
+ // this breaks legal SL use cases
+ // there should be no unfold into task inventory
+/*
+ if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & (uint)PermissionMask.FoldedMask) != 0)
{
// m_log.DebugFormat (
// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}",
// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions);
- if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
+ if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedCopy)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
- if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
+ if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedTransfer)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
- if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
+ if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedModify)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
}
+*/
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryonePermissions &= item.NextPermissions;
--
cgit v1.1
From 00091f1fb9dbe8926e467a844d2035fc83a00c80 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 28 Apr 2017 20:13:53 +0100
Subject: forgot a change...
---
.../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index eb7211c..d916cc2 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -581,8 +581,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
foreach (SceneObjectGroup grp in objsForEffectivePermissions)
{
uint groupPerms = grp.GetEffectivePermissions(true);
- if ((grp.RootPart.BaseMask & (uint)PermissionMask.Modify) != 0)
- groupPerms |= (uint)PermissionMask.Modify;
+// if ((grp.RootPart.BaseMask & (uint)PermissionMask.Modify) != 0)
+// groupPerms |= (uint)PermissionMask.Modify;
effectivePerms &= groupPerms;
}
--
cgit v1.1
From 019b34ea390998f4d51c0cc6d05f79b37aa558eb Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 28 Apr 2017 23:05:14 +0100
Subject: BuySell: bug fix, use all object permitions for sold item, and not
the operation rights one
---
.../World/Objects/BuySell/BuySellModule.cs | 23 +++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index 90d65c7..f90285d 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -205,15 +205,20 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
item.AssetType = asset.Type;
item.InvType = (int)InventoryType.Object;
item.Folder = categoryID;
-
- uint nextPerms=(perms & 7) << 13;
- if ((nextPerms & (uint)PermissionMask.Copy) == 0)
- perms &= ~(uint)PermissionMask.Copy;
- if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
- perms &= ~(uint)PermissionMask.Transfer;
- if ((nextPerms & (uint)PermissionMask.Modify) == 0)
- perms &= ~(uint)PermissionMask.Modify;
-
+
+ perms = group.GetEffectivePermissions(false);
+
+// if((perms & (uint)PermissionMask.FoldedMask) != 0)
+ {
+ if ((perms & (uint)PermissionMask.FoldedCopy) == 0)
+ perms &= ~(uint)PermissionMask.Copy;
+ if ((perms & (uint)PermissionMask.FoldedTransfer) == 0)
+ perms &= ~(uint)PermissionMask.Transfer;
+ if ((perms & (uint)PermissionMask.FoldedModify) == 0)
+ perms &= ~(uint)PermissionMask.Modify;
+ if ((perms & (uint)PermissionMask.FoldedExport) == 0)
+ perms &= ~(uint)PermissionMask.Export;
+ }
item.BasePermissions = perms & part.NextOwnerMask;
item.CurrentPermissions = perms & part.NextOwnerMask;
item.NextPermissions = part.NextOwnerMask;
--
cgit v1.1
From 74f0ffbda6bf59d246d4fcc98fa2fa5fc3a06f5c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 29 Apr 2017 02:45:26 +0100
Subject: fix chain of contents sells
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index edf8cb6..668766b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1273,11 +1273,16 @@ namespace OpenSim.Region.Framework.Scenes
{
agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
if (taskItem.InvType == (int)InventoryType.Object)
- agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
+ {
+ if((taskItem.CurrentPermissions & (uint)PermissionMask.FoldedMask) != 0)
+ agentItem.BasePermissions &=
+ (((taskItem.CurrentPermissions & (uint)PermissionMask.FoldedMask ) << (int)PermissionMask.FoldingShift) |
+ (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
+ }
else
- agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
+ agentItem.BasePermissions &= taskItem.CurrentPermissions;
- agentItem.BasePermissions = agentItem.CurrentPermissions;
+ agentItem.CurrentPermissions = agentItem.BasePermissions;
agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
--
cgit v1.1
From 725ccbb4774043be83fbaa26f3657acfa5313ebe Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 29 Apr 2017 16:58:43 +0100
Subject: add check for valid folded perms
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 668766b..a6f6aa3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -699,13 +699,9 @@ namespace OpenSim.Region.Framework.Scenes
// If this is an object, root prim perms may be more
// permissive than folded perms. Use folded perms as
// a mask
- if (item.InvType == (int)InventoryType.Object)
+ uint foldedPerms = (item.CurrentPermissions & (uint)PermissionMask.FoldedMask) << (int)PermissionMask.FoldingShift;
+ if (foldedPerms != 0 && item.InvType == (int)InventoryType.Object)
{
- // Create a safe mask for the current perms
- uint foldedPerms = (item.CurrentPermissions & 7) << 13;
- if ((item.CurrentPermissions & (uint)PermissionMask.FoldedExport) != 0)
- foldedPerms |= (uint)PermissionMask.Export;
-
foldedPerms |= permsMask;
bool isRootMod = (item.CurrentPermissions &
--
cgit v1.1
From 04117d9f75ca278a921be9ce09c8c859f81cd428 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 29 Apr 2017 19:07:04 +0100
Subject: recover PermissionsUtil.ApplyFoldedPermissions (well my version).
its use easys code readability
---
.../RemoteController/RemoteAdminPlugin.cs | 12 ++++----
OpenSim/Framework/PermissionsUtil.cs | 32 ++++++++++++++++++++++
OpenSim/Framework/Util.cs | 4 +--
.../InventoryAccess/InventoryAccessModule.cs | 17 +++++-------
.../World/Objects/BuySell/BuySellModule.cs | 18 ++++--------
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 12 ++++----
6 files changed, 59 insertions(+), 36 deletions(-)
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 1ee2468..510905f 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -3087,15 +3087,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController
///
private void ApplyNextOwnerPermissions(InventoryItemBase item)
{
- if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
+ if (item.InvType == (int)InventoryType.Object)
{
- if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
- if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
- if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
+ uint perms = item.CurrentPermissions;
+ PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref perms);
+ item.CurrentPermissions = perms;
}
+
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryOnePermissions &= item.NextPermissions;
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs
index 3dce04d..a7f933c 100644
--- a/OpenSim/Framework/PermissionsUtil.cs
+++ b/OpenSim/Framework/PermissionsUtil.cs
@@ -64,5 +64,37 @@ namespace OpenSim.Framework
str = ".";
return str;
}
+
+ public static void ApplyFoldedPermissions(uint source, ref uint target)
+ {
+ uint folded = source & (uint)PermissionMask.FoldedMask;
+ if(folded == 0) // invalid we need to ignore
+ return;
+
+ folded <<= (int)PermissionMask.FoldingShift;
+ folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well
+ folded |= ~(uint)PermissionMask.UnfoldedMask;
+
+ uint tmp = target;
+ tmp &= folded;
+ target = tmp;
+ }
+
+ // do not touch MOD
+ public static void ApplyNoModFoldedPermissions(uint source, ref uint target)
+ {
+ uint folded = source & (uint)PermissionMask.FoldedMask;
+ if(folded == 0) // invalid we need to ignore
+ return;
+
+ folded <<= (int)PermissionMask.FoldingShift;
+ folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well
+ folded |= (~(uint)PermissionMask.UnfoldedMask | (uint)PermissionMask.Modify);
+
+ uint tmp = target;
+ tmp &= folded;
+ target = tmp;
+ }
+
}
}
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 4d025a9..f6ded04 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -92,8 +92,8 @@ namespace OpenSim.Framework
// explicitly given
All = 0x8e000,
AllAndExport = 0x9e000,
- AllEffective = 0x9e000
-
+ AllEffective = 0x9e000,
+ UnfoldedMask = 0x1e000
}
///
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index d916cc2..bce0610 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -573,7 +573,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
InventoryItemBase item, SceneObjectGroup so, List objsForEffectivePermissions,
IClientAPI remoteClient)
{
- uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7;
+ uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export | PermissionMask.FoldedMask);
// For the porposes of inventory, an object is modify if the prims
// are modify. This allows renaming an object that contains no
@@ -586,19 +586,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
effectivePerms &= groupPerms;
}
- effectivePerms |= (uint)PermissionMask.Move;
-
+
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
{
- if ((effectivePerms & (uint)PermissionMask.FoldedCopy) == 0)
- effectivePerms &= ~(uint)PermissionMask.Copy;
- if ((effectivePerms & (uint)PermissionMask.FoldedTransfer) == 0)
- effectivePerms &= ~(uint)PermissionMask.Transfer;
- if ((effectivePerms & (uint)PermissionMask.FoldedExport) == 0)
- effectivePerms &= ~(uint)PermissionMask.Export;
-
+ PermissionsUtil.ApplyNoModFoldedPermissions(effectivePerms, ref effectivePerms);
+
uint basePerms = effectivePerms & so.RootPart.NextOwnerMask;
+ // rebuild folded perms since we don't have then on inworld objects
+ // possible existent ones where already unfolded
+
if((basePerms & (uint)PermissionMask.Copy) == 0)
basePerms |= (uint)PermissionMask.Transfer;
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index f90285d..84f33d1 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -208,19 +208,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
perms = group.GetEffectivePermissions(false);
-// if((perms & (uint)PermissionMask.FoldedMask) != 0)
- {
- if ((perms & (uint)PermissionMask.FoldedCopy) == 0)
- perms &= ~(uint)PermissionMask.Copy;
- if ((perms & (uint)PermissionMask.FoldedTransfer) == 0)
- perms &= ~(uint)PermissionMask.Transfer;
- if ((perms & (uint)PermissionMask.FoldedModify) == 0)
- perms &= ~(uint)PermissionMask.Modify;
- if ((perms & (uint)PermissionMask.FoldedExport) == 0)
- perms &= ~(uint)PermissionMask.Export;
- }
+ PermissionsUtil.ApplyFoldedPermissions(perms, ref perms);
+
item.BasePermissions = perms & part.NextOwnerMask;
- item.CurrentPermissions = perms & part.NextOwnerMask;
+
+// we need to rebuild folded here
+
+ item.CurrentPermissions = item.BasePermissions;
item.NextPermissions = part.NextOwnerMask;
item.EveryOnePermissions = part.EveryoneMask &
part.NextOwnerMask;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a6f6aa3..5e19a8a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1267,17 +1267,19 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: Fix this after the inventory fixer exists and has beenr run
if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
{
- agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
+ agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions;
if (taskItem.InvType == (int)InventoryType.Object)
{
- if((taskItem.CurrentPermissions & (uint)PermissionMask.FoldedMask) != 0)
- agentItem.BasePermissions &=
- (((taskItem.CurrentPermissions & (uint)PermissionMask.FoldedMask ) << (int)PermissionMask.FoldingShift) |
- (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
+ uint perms = agentItem.BasePermissions;
+ PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms );
+ agentItem.BasePermissions = perms;
}
else
agentItem.BasePermissions &= taskItem.CurrentPermissions;
+ // always unlock
+ agentItem.BasePermissions |= (uint)PermissionMask.Move;
+
agentItem.CurrentPermissions = agentItem.BasePermissions;
agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
--
cgit v1.1
From 522695c821c9f68d6c13533220de428f0d036dd7 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 29 Apr 2017 22:09:45 +0100
Subject: update folded permitions if taking from world, or after unfold
---
OpenSim/Framework/PermissionsUtil.cs | 28 +++++++++++++++++-----
.../InventoryAccess/InventoryAccessModule.cs | 15 ++----------
.../World/Objects/BuySell/BuySellModule.cs | 4 ++--
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 6 +++--
4 files changed, 30 insertions(+), 23 deletions(-)
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs
index a7f933c..39ccaba 100644
--- a/OpenSim/Framework/PermissionsUtil.cs
+++ b/OpenSim/Framework/PermissionsUtil.cs
@@ -65,9 +65,9 @@ namespace OpenSim.Framework
return str;
}
- public static void ApplyFoldedPermissions(uint source, ref uint target)
+ public static void ApplyFoldedPermissions(uint foldedSourcePerms, ref uint targetPerms)
{
- uint folded = source & (uint)PermissionMask.FoldedMask;
+ uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask;
if(folded == 0) // invalid we need to ignore
return;
@@ -75,15 +75,15 @@ namespace OpenSim.Framework
folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well
folded |= ~(uint)PermissionMask.UnfoldedMask;
- uint tmp = target;
+ uint tmp = targetPerms;
tmp &= folded;
- target = tmp;
+ targetPerms = tmp;
}
// do not touch MOD
- public static void ApplyNoModFoldedPermissions(uint source, ref uint target)
+ public static void ApplyNoModFoldedPermissions(uint foldedSourcePerms, ref uint target)
{
- uint folded = source & (uint)PermissionMask.FoldedMask;
+ uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask;
if(folded == 0) // invalid we need to ignore
return;
@@ -96,5 +96,21 @@ namespace OpenSim.Framework
target = tmp;
}
+ public static uint FixAndFoldPermissions(uint perms)
+ {
+ uint tmp = perms;
+
+ // C & T rule
+ if((tmp & (uint)(PermissionMask.Copy | PermissionMask.Transfer)) == 0)
+ tmp |= (uint)PermissionMask.Transfer;
+
+ // unlock
+ tmp |= (uint)PermissionMask.Move;
+
+ tmp &= ~(uint)PermissionMask.FoldedMask;
+ tmp |= ((tmp >> (int)PermissionMask.FoldingShift) & (uint)PermissionMask.FoldedMask);
+
+ return tmp;
+ }
}
}
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index bce0610..d4f9c16 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -594,16 +594,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
uint basePerms = effectivePerms & so.RootPart.NextOwnerMask;
// rebuild folded perms since we don't have then on inworld objects
- // possible existent ones where already unfolded
-
- if((basePerms & (uint)PermissionMask.Copy) == 0)
- basePerms |= (uint)PermissionMask.Transfer;
-
- // unlock
- basePerms |= (uint)PermissionMask.Move;
-
- basePerms &= ~(uint)PermissionMask.FoldedMask;
- basePerms |= ((basePerms >> (int)PermissionMask.FoldingShift) & (uint)PermissionMask.FoldedMask);
+ basePerms = PermissionsUtil.FixAndFoldPermissions(basePerms);
item.BasePermissions = basePerms;
item.CurrentPermissions = item.BasePermissions;
@@ -1146,9 +1137,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if ((item.BasePermissions & (uint)PermissionMask.FoldedMask) != 0)
{
// We have permissions stored there so use them
- part.NextOwnerMask = ((item.BasePermissions & 7) << 13);
- if ((item.BasePermissions & (uint)PermissionMask.FoldedExport) != 0)
- part.NextOwnerMask |= (uint)PermissionMask.Export;
+ part.NextOwnerMask = ((item.BasePermissions & (uint)PermissionMask.FoldedMask) << (int)PermissionMask.FoldingShift);
part.NextOwnerMask |= (uint)PermissionMask.Move;
}
else
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index 84f33d1..af53aa3 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -210,9 +210,9 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
PermissionsUtil.ApplyFoldedPermissions(perms, ref perms);
- item.BasePermissions = perms & part.NextOwnerMask;
+ perms &= part.NextOwnerMask;
-// we need to rebuild folded here
+ item.BasePermissions = PermissionsUtil.FixAndFoldPermissions(perms);
item.CurrentPermissions = item.BasePermissions;
item.NextPermissions = part.NextOwnerMask;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 5e19a8a..0549571 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1272,14 +1272,16 @@ namespace OpenSim.Region.Framework.Scenes
{
uint perms = agentItem.BasePermissions;
PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms );
- agentItem.BasePermissions = perms;
+// perms |= (uint)PermissionMask.Move;
+// agentItem.BasePermissions = perms;
+ agentItem.BasePermissions = PermissionsUtil.FixAndFoldPermissions(perms);
}
else
agentItem.BasePermissions &= taskItem.CurrentPermissions;
// always unlock
agentItem.BasePermissions |= (uint)PermissionMask.Move;
-
+
agentItem.CurrentPermissions = agentItem.BasePermissions;
agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
--
cgit v1.1
From fedd1a93d28c86459e66a05f8ce189498b7ab354 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 29 Apr 2017 23:09:32 +0100
Subject: buysell: fix permissions masks hierachy
---
.../CoreModules/World/Objects/BuySell/BuySellModule.cs | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index af53aa3..ca392b8 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -208,18 +208,20 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
perms = group.GetEffectivePermissions(false);
- PermissionsUtil.ApplyFoldedPermissions(perms, ref perms);
+ PermissionsUtil.ApplyNoModFoldedPermissions(perms, ref perms);
perms &= part.NextOwnerMask;
- item.BasePermissions = PermissionsUtil.FixAndFoldPermissions(perms);
+ perms = PermissionsUtil.FixAndFoldPermissions(perms);
- item.CurrentPermissions = item.BasePermissions;
- item.NextPermissions = part.NextOwnerMask;
- item.EveryOnePermissions = part.EveryoneMask &
- part.NextOwnerMask;
- item.GroupPermissions = part.GroupMask &
- part.NextOwnerMask;
+ item.BasePermissions = perms;
+ item.CurrentPermissions = perms;
+
+ perms &= part.NextOwnerMask;
+ item.NextPermissions = perms;
+
+ item.EveryOnePermissions = part.EveryoneMask & perms;
+ item.GroupPermissions = part.GroupMask & perms;
item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
item.CreationDate = Util.UnixTimeSinceEpoch();
--
cgit v1.1
From d8341588b3b7d855c381831ddf6ca5656a6be9c3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 29 Apr 2017 23:59:56 +0100
Subject: nore permissions masks hierachy
---
.../InventoryAccess/InventoryAccessModule.cs | 8 +++----
.../World/Objects/BuySell/BuySellModule.cs | 6 ++---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 26 ++++++++++------------
3 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index d4f9c16..a32d7dc 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -597,10 +597,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
basePerms = PermissionsUtil.FixAndFoldPermissions(basePerms);
item.BasePermissions = basePerms;
- item.CurrentPermissions = item.BasePermissions;
- item.NextPermissions = effectivePerms & so.RootPart.NextOwnerMask;
- item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask;
- item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask;
+ item.CurrentPermissions = basePerms;
+ item.NextPermissions = basePerms & so.RootPart.NextOwnerMask;
+ item.EveryOnePermissions = basePerms & so.RootPart.EveryoneMask;
+ item.GroupPermissions = basePerms & so.RootPart.GroupMask;
// apply next owner perms on rez
item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index ca392b8..6854b53 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -216,12 +216,10 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
item.BasePermissions = perms;
item.CurrentPermissions = perms;
-
- perms &= part.NextOwnerMask;
- item.NextPermissions = perms;
-
+ item.NextPermissions = part.NextOwnerMask & perms;
item.EveryOnePermissions = part.EveryoneMask & perms;
item.GroupPermissions = part.GroupMask & perms;
+
item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
item.CreationDate = Util.UnixTimeSinceEpoch();
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 0549571..a2cee81 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1267,29 +1267,27 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: Fix this after the inventory fixer exists and has beenr run
if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
{
- agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions;
+ uint perms = taskItem.BasePermissions & taskItem.NextPermissions;
if (taskItem.InvType == (int)InventoryType.Object)
{
- uint perms = agentItem.BasePermissions;
- PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms );
-// perms |= (uint)PermissionMask.Move;
-// agentItem.BasePermissions = perms;
- agentItem.BasePermissions = PermissionsUtil.FixAndFoldPermissions(perms);
+ PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms );
+ perms = PermissionsUtil.FixAndFoldPermissions(perms);
}
else
- agentItem.BasePermissions &= taskItem.CurrentPermissions;
+ perms &= taskItem.CurrentPermissions;
// always unlock
- agentItem.BasePermissions |= (uint)PermissionMask.Move;
+ perms |= (uint)PermissionMask.Move;
- agentItem.CurrentPermissions = agentItem.BasePermissions;
-
- agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
- agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
- agentItem.NextPermissions = taskItem.NextPermissions;
- agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
+ agentItem.BasePermissions = perms;
+ agentItem.CurrentPermissions = perms;
+ agentItem.NextPermissions = perms & taskItem.NextPermissions;
+ agentItem.EveryOnePermissions = perms & taskItem.EveryonePermissions;
// Group permissions make no sense here
agentItem.GroupPermissions = 0;
+
+ agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
+ agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
}
else
{
--
cgit v1.1
From 116d32d947e3c1446ce98dca0be62ea74055216d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 30 Apr 2017 00:14:45 +0100
Subject: don't break groups permission mask
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a2cee81..afdd99e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1283,8 +1283,7 @@ namespace OpenSim.Region.Framework.Scenes
agentItem.CurrentPermissions = perms;
agentItem.NextPermissions = perms & taskItem.NextPermissions;
agentItem.EveryOnePermissions = perms & taskItem.EveryonePermissions;
- // Group permissions make no sense here
- agentItem.GroupPermissions = 0;
+ agentItem.GroupPermissions = perms & taskItem.GroupPermissions;
agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
@@ -1295,7 +1294,7 @@ namespace OpenSim.Region.Framework.Scenes
agentItem.CurrentPermissions = taskItem.CurrentPermissions;
agentItem.NextPermissions = taskItem.NextPermissions;
agentItem.EveryOnePermissions = taskItem.EveryonePermissions;
- agentItem.GroupPermissions = 0;
+ agentItem.GroupPermissions = taskItem.GroupPermissions;
}
message = null;
--
cgit v1.1
From 514249e80ec527c79157bce80f39b8adb1b344c1 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 30 Apr 2017 12:43:09 +0100
Subject: fix new landmarks default permissions
---
.../Framework/InventoryAccess/InventoryAccessModule.cs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index a32d7dc..916ddb0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -212,6 +212,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (m_Scene.TryGetScenePresence(remoteClient.AgentId, out presence))
{
byte[] data = null;
+ uint everyonemask = 0;
+ uint groupmask = 0;
if (invType == (sbyte)InventoryType.Landmark && presence != null)
{
@@ -220,6 +222,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
data = Encoding.ASCII.GetBytes(strdata);
name = prefix + name;
description += suffix;
+ groupmask = (uint)PermissionMask.AllAndExport;
+ everyonemask = (uint)(PermissionMask.AllAndExport & ~PermissionMask.Modify);
}
AssetBase asset = m_Scene.CreateAsset(name, description, assetType, data, remoteClient.AgentId);
@@ -227,9 +231,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_Scene.CreateNewInventoryItem(
remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
name, description, 0, callbackID, asset.FullID, asset.Type, invType,
- (uint)PermissionMask.All | (uint)PermissionMask.Export, // Base
- (uint)PermissionMask.All | (uint)PermissionMask.Export, // Current
- 0, nextOwnerMask, 0, creationDate, false); // Data from viewer
+ (uint)PermissionMask.AllAndExport, // Base
+ (uint)PermissionMask.AllAndExport, // Current
+ everyonemask,
+ nextOwnerMask, groupmask, creationDate, false); // Data from viewer
}
else
{
--
cgit v1.1
From 10922c2a1a129050e9b29fe1193d48edc1822fe9 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 30 Apr 2017 12:51:12 +0100
Subject: exclude lms from permissions checks. They are full rights, and broken
on all dbs
---
.../Framework/Scenes/SceneObjectPartInventory.cs | 36 +++-------------------
1 file changed, 5 insertions(+), 31 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 894078d..946ed09 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1332,6 +1332,8 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (TaskInventoryItem item in m_items.Values)
{
+ if(item.InvType == (sbyte)InventoryType.Landmark)
+ continue;
owner &= item.CurrentPermissions;
group &= item.GroupPermissions;
everyone &= item.EveryonePermissions;
@@ -1346,6 +1348,9 @@ namespace OpenSim.Region.Framework.Scenes
foreach (TaskInventoryItem item in m_items.Values)
{
+ if(item.InvType == (sbyte)InventoryType.Landmark)
+ continue;
+
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~((uint)PermissionMask.FoldedCopy);
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
@@ -1353,19 +1358,6 @@ namespace OpenSim.Region.Framework.Scenes
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Export) == 0)
mask &= ~((uint)PermissionMask.FoldedExport);
- // this breaks some SL legal use cases
- // there should be no folding from task inventory
-/*
- if (item.InvType == (int)InventoryType.Object)
- {
- if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedCopy)) == 0)
- mask &= ~((uint)PermissionMask.FoldedCopy);
- if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedTransfer)) == 0)
- mask &= ~((uint)PermissionMask.FoldedTransfer);
- if ((item.CurrentPermissions & (uint)PermissionMask.FoldedExport) == 0)
- mask &= ~((uint)PermissionMask.FoldedExport);
- }
-*/
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
@@ -1380,24 +1372,6 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (TaskInventoryItem item in m_items.Values)
{
-
- // this breaks legal SL use cases
- // there should be no unfold into task inventory
-/*
- if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & (uint)PermissionMask.FoldedMask) != 0)
- {
-// m_log.DebugFormat (
-// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}",
-// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions);
-
- if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedCopy)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
- if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedTransfer)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
- if ((item.CurrentPermissions & ((uint)PermissionMask.FoldedModify)) == 0)
- item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
- }
-*/
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryonePermissions &= item.NextPermissions;
--
cgit v1.1
From cf1064a2451271011d8575fba56f8aec361a9dc9 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Sun, 30 Apr 2017 13:24:48 +0100
Subject: Add a missing viewer-relevant message to the perms module
---
OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 8eee864..18d164f 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -2022,7 +2022,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
uint perms = GetObjectPermissions(sp, sog, true);
if((perms & (uint)PermissionMask.Copy) == 0)
+ {
+ sp.ControllingClient.SendAgentAlertMessage("Copying this item has been denied by the permissions system", false);
return false;
+ }
if(sog.OwnerID != sp.UUID && (perms & (uint)PermissionMask.Transfer) == 0)
return false;
--
cgit v1.1
From b67904a6510d4827e8219a3534b8bc07a5115ec3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 30 Apr 2017 14:31:46 +0100
Subject: remove a redundant operation
---
OpenSim/Framework/PermissionsUtil.cs | 2 --
1 file changed, 2 deletions(-)
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs
index 39ccaba..aba8320 100644
--- a/OpenSim/Framework/PermissionsUtil.cs
+++ b/OpenSim/Framework/PermissionsUtil.cs
@@ -72,7 +72,6 @@ namespace OpenSim.Framework
return;
folded <<= (int)PermissionMask.FoldingShift;
- folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well
folded |= ~(uint)PermissionMask.UnfoldedMask;
uint tmp = targetPerms;
@@ -88,7 +87,6 @@ namespace OpenSim.Framework
return;
folded <<= (int)PermissionMask.FoldingShift;
- folded &= (uint)PermissionMask.UnfoldedMask; // not really necessary but well
folded |= (~(uint)PermissionMask.UnfoldedMask | (uint)PermissionMask.Modify);
uint tmp = target;
--
cgit v1.1
From 0d59a29dc7c6f732da266a4ed4fddb5b39521ddf Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 30 Apr 2017 14:39:20 +0100
Subject: save some nanoseconds if unfolding will not change anything ( export
default mks it rare, but looks nice)
---
OpenSim/Framework/PermissionsUtil.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs
index aba8320..cf93323 100644
--- a/OpenSim/Framework/PermissionsUtil.cs
+++ b/OpenSim/Framework/PermissionsUtil.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Framework
public static void ApplyFoldedPermissions(uint foldedSourcePerms, ref uint targetPerms)
{
uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask;
- if(folded == 0) // invalid we need to ignore
+ if(folded == 0 || folded == (uint)PermissionMask.FoldedMask) // invalid we need to ignore, or nothing to do
return;
folded <<= (int)PermissionMask.FoldingShift;
@@ -83,7 +83,7 @@ namespace OpenSim.Framework
public static void ApplyNoModFoldedPermissions(uint foldedSourcePerms, ref uint target)
{
uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask;
- if(folded == 0) // invalid we need to ignore
+ if(folded == 0 || folded == (uint)PermissionMask.FoldedMask) // invalid we need to ignore, or nothing to do
return;
folded <<= (int)PermissionMask.FoldingShift;
--
cgit v1.1
From a96c0f760a3df08217794e71ec450abddf3c3ef0 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 30 Apr 2017 14:42:20 +0100
Subject: having the file open then let PermissionsToString know about Export
---
OpenSim/Framework/PermissionsUtil.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs
index cf93323..e50d4df 100644
--- a/OpenSim/Framework/PermissionsUtil.cs
+++ b/OpenSim/Framework/PermissionsUtil.cs
@@ -60,6 +60,8 @@ namespace OpenSim.Framework
str += "C";
if ((perms & (int)PermissionMask.Transfer) != 0)
str += "T";
+ if ((perms & (int)PermissionMask.Export) != 0)
+ str += "X";
if (str == "")
str = ".";
return str;
--
cgit v1.1
From 2dbf96593cf216595a1528afa2a668c0f38e1791 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 30 Apr 2017 19:44:49 +0100
Subject: Permissions compatibility hack 1: anyone copy - new permissions
require that all items in all object parts contents have anyone copy set. Old
code only required it on object. This hack tries to allow objects older than
today to still work as before on this. (this is a test, we may need to change
it)
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 42f47b5..66c9013 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -338,6 +338,8 @@ namespace OpenSim.Region.Framework.Scenes
uint rootEveryonePerms = RootPart.EveryoneMask;
uint everyone = rootEveryonePerms;
+ // date is time of writing april 30th 2017
+ bool newObject = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
@@ -345,7 +347,8 @@ namespace OpenSim.Region.Framework.Scenes
part.AggregateInnerPerms();
owner &= part.AggregatedInnerOwnerPerms;
group &= part.AggregatedInnerGroupPerms;
- everyone &= part.AggregatedInnerEveryonePerms;
+ if(newObject)
+ everyone &= part.AggregatedInnerEveryonePerms;
}
// recover modify and move
rootOwnerPerms &= movemodmask;
@@ -407,14 +410,16 @@ namespace OpenSim.Region.Framework.Scenes
uint everyone = rootEveryonePerms;
bool needUpdate = false;
-
+ // date is time of writing april 30th 2017
+ bool newObject = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
owner &= part.AggregatedInnerOwnerPerms;
group &= part.AggregatedInnerGroupPerms;
- everyone &= part.AggregatedInnerEveryonePerms;
+ if(newObject)
+ everyone &= part.AggregatedInnerEveryonePerms;
}
// recover modify and move
rootOwnerPerms &= movemodmask;
--
cgit v1.1
From 442a736a4c3394ca0bc6cea9d9b6c2602d2b0b13 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 30 Apr 2017 21:11:30 -0700
Subject: Add Permission tests project
---
prebuild.xml | 41 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
diff --git a/prebuild.xml b/prebuild.xml
index c087def..52fb74a 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -3300,7 +3300,46 @@
-
+
+
+
+ ../../../bin/
+
+
+
+
+ ../../../bin/
+
+
+
+ ../../../bin/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit v1.1
From 60dc124872c52fb50cbf2f4413bd8813e50c527b Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 1 May 2017 14:18:59 +0100
Subject: rename sog.GetEffectivePermissions() since its use is now limited to
more specific task, and no longer on current effective(full) path. Note that
change ownermask start to be current ownermask, and filter it to all parts
basemask
---
.../Framework/InventoryAccess/InventoryAccessModule.cs | 17 +++++------------
.../CoreModules/World/Objects/BuySell/BuySellModule.cs | 10 +++++-----
.../Framework/Scenes/SceneObjectGroup.Inventory.cs | 11 +++--------
3 files changed, 13 insertions(+), 25 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 916ddb0..f1885da 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -579,26 +579,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
IClientAPI remoteClient)
{
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export | PermissionMask.FoldedMask);
-
- // For the porposes of inventory, an object is modify if the prims
- // are modify. This allows renaming an object that contains no
- // mod items.
+
foreach (SceneObjectGroup grp in objsForEffectivePermissions)
{
- uint groupPerms = grp.GetEffectivePermissions(true);
-// if ((grp.RootPart.BaseMask & (uint)PermissionMask.Modify) != 0)
-// groupPerms |= (uint)PermissionMask.Modify;
-
- effectivePerms &= groupPerms;
+ effectivePerms &= grp.CurrentAndFoldedNextPermissions();
}
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
{
+ // apply parts inventory items next owner
PermissionsUtil.ApplyNoModFoldedPermissions(effectivePerms, ref effectivePerms);
-
+ // change to next owner
uint basePerms = effectivePerms & so.RootPart.NextOwnerMask;
-
- // rebuild folded perms since we don't have then on inworld objects
+ // fix and update folded
basePerms = PermissionsUtil.FixAndFoldPermissions(basePerms);
item.BasePermissions = basePerms;
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index 6854b53..d1a109e 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -206,12 +206,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
item.InvType = (int)InventoryType.Object;
item.Folder = categoryID;
- perms = group.GetEffectivePermissions(false);
-
+ perms = group.CurrentAndFoldedNextPermissions();
+ // apply parts inventory next perms
PermissionsUtil.ApplyNoModFoldedPermissions(perms, ref perms);
-
- perms &= part.NextOwnerMask;
-
+ // change to next owner perms
+ perms &= part.NextOwnerMask;
+ // update folded
perms = PermissionsUtil.FixAndFoldPermissions(perms);
item.BasePermissions = perms;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 66c9013..36844a9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -484,7 +484,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public uint GetEffectivePermissions(bool useBase)
+ public uint CurrentAndFoldedNextPermissions()
{
uint perms=(uint)(PermissionMask.Modify |
PermissionMask.Copy |
@@ -492,18 +492,13 @@ namespace OpenSim.Region.Framework.Scenes
PermissionMask.Transfer |
PermissionMask.FoldedMask);
- uint ownerMask = 0x7fffffff;
+ uint ownerMask = RootPart.OwnerMask;
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
-
- if (useBase)
- ownerMask &= part.BaseMask;
- else
- ownerMask &= part.OwnerMask;
-
+ ownerMask &= part.BaseMask;
perms &= part.Inventory.MaskEffectivePermissions();
}
--
cgit v1.1
From 28d8eda768a64e1eff9edf3006f494d4f0d62bc3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 1 May 2017 14:42:38 +0100
Subject: buysell: make sure we dont buy child parts, dont mess with absolute
position its useless with variable size regions, and its a rezing job
---
.../World/Objects/BuySell/BuySellModule.cs | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index d1a109e..a7a9d1d 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -118,6 +118,11 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
return false;
SceneObjectGroup group = part.ParentGroup;
+ if(group == null || group.IsDeleted || group.inTransit)
+ return false;
+
+ // make sure we are not buying a child part
+ part = group.RootPart;
switch (saleType)
{
@@ -157,18 +162,6 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
break;
case 2: // Sell a copy
- Vector3 inventoryStoredPosition = new Vector3(
- Math.Min(group.AbsolutePosition.X, m_scene.RegionInfo.RegionSizeX - 6),
- Math.Min(group.AbsolutePosition.Y, m_scene.RegionInfo.RegionSizeY - 6),
- group.AbsolutePosition.Z);
-
- Vector3 originalPosition = group.AbsolutePosition;
-
- group.AbsolutePosition = inventoryStoredPosition;
-
- string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
- group.AbsolutePosition = originalPosition;
-
uint perms = group.EffectiveOwnerPerms;
if ((perms & (uint)PermissionMask.Transfer) == 0)
@@ -185,6 +178,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
return false;
}
+ string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group);
+
AssetBase asset = m_scene.CreateAsset(
group.GetPartName(localID),
group.GetPartDescription(localID),
--
cgit v1.1
From 45096b6238a3b6335429a680fa0bae0a6c0ce190 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 1 May 2017 07:06:50 -0700
Subject: Initial commit of the emerging test suite for permissions and more.
---
OpenSim/Tests/Permissions/DirectTransferTests.cs | 252 +++++++++++++++++++++++
1 file changed, 252 insertions(+)
create mode 100644 OpenSim/Tests/Permissions/DirectTransferTests.cs
diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs
new file mode 100644
index 0000000..7716776
--- /dev/null
+++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Threading;
+using Nini.Config;
+using NUnit.Framework;
+using OpenMetaverse;
+using OpenSim.Framework;
+using OpenSim.Region.Framework.Scenes;
+using OpenSim.Region.CoreModules.World.Permissions;
+using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer;
+using OpenSim.Region.CoreModules.Framework.InventoryAccess;
+using OpenSim.Region.Framework.Scenes.Serialization;
+using OpenSim.Services.Interfaces;
+using OpenSim.Tests.Common;
+using PermissionMask = OpenSim.Framework.PermissionMask;
+
+namespace OpenSim.Tests.Permissions
+{
+ ///
+ /// Basic scene object tests (create, read and delete but not update).
+ ///
+ [TestFixture]
+ public class DirectTransferTests : OpenSimTestCase
+ {
+ private static string Perms = "Owner: {0}; Group: {1}; Everyone: {2}; Next: {3}";
+ protected TestScene m_Scene;
+ private ScenePresence[] m_Avatars = new ScenePresence[3];
+
+ [SetUp]
+ public override void SetUp()
+ {
+ base.SetUp();
+ TestHelpers.EnableLogging();
+
+ IConfigSource config = new IniConfigSource();
+ config.AddConfig("Messaging");
+ config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule");
+ config.AddConfig("Modules");
+ config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
+ config.AddConfig("InventoryService");
+ config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService");
+ config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin");
+
+ m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config);
+ // Add modules
+ SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule());
+
+ // Add 3 avatars
+ for (int i = 0; i < 3; i++)
+ {
+ UUID id = TestHelpers.ParseTail(i+1);
+
+ m_Avatars[i] = AddScenePresence("Bot", "Bot_" + i, id);
+ Assert.That(m_Avatars[i], Is.Not.Null);
+ Assert.That(m_Avatars[i].IsChildAgent, Is.False);
+ Assert.That(m_Avatars[i].UUID, Is.EqualTo(id));
+
+ Assert.That(m_Scene.GetScenePresences().Count, Is.EqualTo(i+1));
+ }
+ }
+
+ ///
+ /// Test adding an object to a scene.
+ ///
+ [Test]
+ public void TestGiveCBox()
+ {
+ TestHelpers.InMethod();
+
+ // Create a C Box
+ SceneObjectGroup boxC = AddSceneObject("Box C", 10, 1, m_Avatars[0].UUID);
+
+ // field = 16 is NextOwner
+ // set = 1 means add the permission; set = 0 means remove permission
+ m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID,
+ ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, boxC.LocalId, (uint)PermissionMask.Copy, 1);
+
+ m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID,
+ ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, boxC.LocalId, (uint)PermissionMask.Transfer, 0);
+ PrintPerms(boxC);
+
+ Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Copy) != 0);
+ Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Modify) == 0);
+ Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Transfer) == 0);
+
+ InventoryItemBase item = TakeCopyToInventory(boxC);
+
+ GiveInventoryItem(item.ID, m_Avatars[0], m_Avatars[1]);
+
+ item = GetItemFromInventory(m_Avatars[1].UUID, "Objects", "Box C");
+
+ // Check the receiver
+ PrintPerms(item);
+ Assert.True((item.BasePermissions & (int)PermissionMask.Copy) != 0);
+ Assert.True((item.BasePermissions & (int)PermissionMask.Modify) == 0);
+ Assert.True((item.BasePermissions & (int)PermissionMask.Transfer) == 0);
+
+ // Rez it and check perms in scene too
+ m_Scene.RezObject(m_Avatars[1].ControllingClient, item.ID, UUID.Zero, Vector3.One, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero);
+ Assert.That(m_Scene.GetSceneObjectGroups().Count, Is.EqualTo(2));
+ SceneObjectGroup copyBoxC = m_Scene.GetSceneObjectGroups().Find(sog => sog.OwnerID == m_Avatars[1].UUID);
+ PrintPerms(copyBoxC);
+ Assert.That(copyBoxC, Is.Not.Null);
+
+ }
+
+ #region Helper Functions
+
+ private void PrintPerms(SceneObjectGroup sog)
+ {
+ Console.WriteLine("SOG " + sog.Name + ": " + String.Format(Perms, (PermissionMask)sog.EffectiveOwnerPerms,
+ (PermissionMask)sog.EffectiveGroupPerms, (PermissionMask)sog.EffectiveEveryOnePerms, (PermissionMask)sog.RootPart.NextOwnerMask));
+
+ }
+
+ private void PrintPerms(InventoryItemBase item)
+ {
+ Console.WriteLine("Inv " + item.Name + ": " + String.Format(Perms, (PermissionMask)item.BasePermissions,
+ (PermissionMask)item.GroupPermissions, (PermissionMask)item.EveryOnePermissions, (PermissionMask)item.NextPermissions));
+
+ }
+
+ private ScenePresence AddScenePresence(string first, string last, UUID id)
+ {
+ UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_Scene, first, last, id, "pw");
+ ScenePresence sp = SceneHelpers.AddScenePresence(m_Scene, id);
+ Assert.That(m_Scene.AuthenticateHandler.GetAgentCircuitData(id), Is.Not.Null);
+
+ return sp;
+ }
+
+ private SceneObjectGroup AddSceneObject(string name, int suffix, int partsToTestCount, UUID ownerID)
+ {
+ TestHelpers.InMethod();
+
+ SceneObjectGroup so = SceneHelpers.CreateSceneObject(partsToTestCount, ownerID, name, suffix);
+ so.Name = name;
+ so.Description = name;
+
+ Assert.That(m_Scene.AddNewSceneObject(so, false), Is.True);
+ SceneObjectGroup retrievedSo = m_Scene.GetSceneObjectGroup(so.UUID);
+
+ // If the parts have the same UUID then we will consider them as one and the same
+ Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount));
+
+ return so;
+ }
+
+ private InventoryItemBase TakeCopyToInventory(SceneObjectGroup sog)
+ {
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects");
+ Assert.That(objsFolder, Is.Not.Null);
+
+ List localIds = new List(); localIds.Add(sog.LocalId);
+ m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID);
+ Thread.Sleep(5000);
+
+ List items = m_Scene.InventoryService.GetFolderItems(sog.OwnerID, objsFolder.ID);
+ InventoryItemBase item = items.Find(i => i.Name == sog.Name);
+ Assert.That(item, Is.Not.Null);
+
+ return item;
+
+ }
+
+ private InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName)
+ {
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, userID, folderName);
+ Assert.That(objsFolder, Is.Not.Null);
+ List items = m_Scene.InventoryService.GetFolderItems(userID, objsFolder.ID);
+ InventoryItemBase item = items.Find(i => i.Name == itemName);
+ Assert.That(item, Is.Not.Null);
+
+ return item;
+ }
+
+ private void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp)
+ {
+ TestClient giverClient = (TestClient)giverSp.ControllingClient;
+ TestClient receiverClient = (TestClient)receiverSp.ControllingClient;
+
+ UUID initialSessionId = TestHelpers.ParseTail(0x10);
+ byte[] giveImBinaryBucket = new byte[17];
+ byte[] itemIdBytes = itemId.GetBytes();
+ Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length);
+
+ GridInstantMessage giveIm
+ = new GridInstantMessage(
+ m_Scene,
+ giverSp.UUID,
+ giverSp.Name,
+ receiverSp.UUID,
+ (byte)InstantMessageDialog.InventoryOffered,
+ false,
+ "inventory offered msg",
+ initialSessionId,
+ false,
+ Vector3.Zero,
+ giveImBinaryBucket,
+ true);
+
+ giverClient.HandleImprovedInstantMessage(giveIm);
+
+ // These details might not all be correct.
+ GridInstantMessage acceptIm
+ = new GridInstantMessage(
+ m_Scene,
+ receiverSp.UUID,
+ receiverSp.Name,
+ giverSp.UUID,
+ (byte)InstantMessageDialog.InventoryAccepted,
+ false,
+ "inventory accepted msg",
+ initialSessionId,
+ false,
+ Vector3.Zero,
+ null,
+ true);
+
+ receiverClient.HandleImprovedInstantMessage(acceptIm);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
--
cgit v1.1
From 9c6dd5d967d44d2eb222a2382d9f19572b871d87 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 1 May 2017 10:09:31 -0700
Subject: Perms test framework: make a lot of things more generic.
---
OpenSim/Tests/Permissions/Common.cs | 259 +++++++++++++++++++++++
OpenSim/Tests/Permissions/DirectTransferTests.cs | 208 +++---------------
2 files changed, 293 insertions(+), 174 deletions(-)
create mode 100644 OpenSim/Tests/Permissions/Common.cs
diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs
new file mode 100644
index 0000000..63b91b6
--- /dev/null
+++ b/OpenSim/Tests/Permissions/Common.cs
@@ -0,0 +1,259 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Threading;
+using Nini.Config;
+using NUnit.Framework;
+using OpenMetaverse;
+using OpenSim.Framework;
+using OpenSim.Region.Framework.Scenes;
+using OpenSim.Region.CoreModules.World.Permissions;
+using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer;
+using OpenSim.Region.CoreModules.Framework.InventoryAccess;
+using OpenSim.Region.Framework.Scenes.Serialization;
+using OpenSim.Services.Interfaces;
+using OpenSim.Tests.Common;
+using PermissionMask = OpenSim.Framework.PermissionMask;
+
+namespace OpenSim.Tests.Permissions
+{
+ [SetUpFixture]
+ public class Common : OpenSimTestCase
+ {
+ public static Common TheInstance;
+
+ public static TestScene TheScene
+ {
+ get { return TheInstance.m_Scene; }
+ }
+
+ public static ScenePresence[] TheAvatars
+ {
+ get { return TheInstance.m_Avatars; }
+ }
+
+ private static string Perms = "Owner: {0}; Group: {1}; Everyone: {2}; Next: {3}";
+ private TestScene m_Scene;
+ private ScenePresence[] m_Avatars = new ScenePresence[3];
+
+ [SetUp]
+ public override void SetUp()
+ {
+ if (TheInstance == null)
+ TheInstance = this;
+
+ base.SetUp();
+ TestHelpers.EnableLogging();
+
+ IConfigSource config = new IniConfigSource();
+ config.AddConfig("Messaging");
+ config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule");
+ config.AddConfig("Modules");
+ config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
+ config.AddConfig("InventoryService");
+ config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService");
+ config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin");
+
+ m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config);
+ // Add modules
+ SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule());
+
+ SetUpBasicEnvironment();
+ }
+
+ ///
+ /// The basic environment consists of:
+ /// - 3 avatars: A1, A2, A3
+ /// - 6 simple boxes inworld belonging to A0 and with Next Owner perms:
+ /// C, CT, MC, MCT, MT, T
+ /// - Copies of all of these boxes in A0's inventory in the Objects folder
+ /// - One additional box in A0's inventory which is a copy of MCT, but
+ /// with C removed in inventory. This one is called MCT-C
+ ///
+ private void SetUpBasicEnvironment()
+ {
+ Console.WriteLine("===> SetUpBasicEnvironment <===");
+
+ // Add 3 avatars
+ for (int i = 0; i < 3; i++)
+ {
+ UUID id = TestHelpers.ParseTail(i + 1);
+
+ m_Avatars[i] = AddScenePresence("Bot", "Bot_" + (i+1), id);
+ Assert.That(m_Avatars[i], Is.Not.Null);
+ Assert.That(m_Avatars[i].IsChildAgent, Is.False);
+ Assert.That(m_Avatars[i].UUID, Is.EqualTo(id));
+ Assert.That(m_Scene.GetScenePresences().Count, Is.EqualTo(i + 1));
+ }
+
+ AddA1Object("Box C", 10, PermissionMask.Copy);
+ AddA1Object("Box CT", 11, PermissionMask.Copy | PermissionMask.Transfer);
+ AddA1Object("Box MC", 12, PermissionMask.Modify | PermissionMask.Copy);
+ AddA1Object("Box MCT", 13, PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer);
+ AddA1Object("Box MT", 14, PermissionMask.Modify | PermissionMask.Transfer);
+ AddA1Object("Box T", 15, PermissionMask.Transfer);
+
+ Thread.Sleep(5000);
+
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[0].UUID, "Objects");
+ List items = m_Scene.InventoryService.GetFolderItems(m_Avatars[0].UUID, objsFolder.ID);
+ Assert.That(items.Count, Is.EqualTo(6));
+ }
+
+ private ScenePresence AddScenePresence(string first, string last, UUID id)
+ {
+ UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_Scene, first, last, id, "pw");
+ ScenePresence sp = SceneHelpers.AddScenePresence(m_Scene, id);
+ Assert.That(m_Scene.AuthenticateHandler.GetAgentCircuitData(id), Is.Not.Null);
+
+ return sp;
+ }
+
+ private void AddA1Object(string name, int suffix, PermissionMask nextOwnerPerms)
+ {
+ // Create a Box. Default permissions are just T
+ SceneObjectGroup box = AddSceneObject(name, suffix, 1, m_Avatars[0].UUID);
+ Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Copy) == 0);
+ Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Modify) == 0);
+ Assert.True((box.RootPart.NextOwnerMask & (int)PermissionMask.Transfer) != 0);
+
+ // field = 16 is NextOwner
+ // set = 1 means add the permission; set = 0 means remove permission
+
+ if ((nextOwnerPerms & PermissionMask.Copy) != 0)
+ m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID,
+ ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Copy, 1);
+
+ if ((nextOwnerPerms & PermissionMask.Modify) != 0)
+ m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID,
+ ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Modify, 1);
+
+ if ((nextOwnerPerms & PermissionMask.Transfer) == 0)
+ m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID,
+ ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, box.LocalId, (uint)PermissionMask.Transfer, 0);
+
+ PrintPerms(box);
+ AssertPermissions(nextOwnerPerms, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name);
+
+ TakeCopyToInventory(box);
+
+ }
+
+ public void PrintPerms(SceneObjectGroup sog)
+ {
+ Console.WriteLine("SOG " + sog.Name + " (" + sog.OwnerID.ToString().Substring(34) + "): " +
+ String.Format(Perms, (PermissionMask)sog.EffectiveOwnerPerms,
+ (PermissionMask)sog.EffectiveGroupPerms, (PermissionMask)sog.EffectiveEveryOnePerms, (PermissionMask)sog.RootPart.NextOwnerMask));
+
+ }
+
+ public void PrintPerms(InventoryItemBase item)
+ {
+ Console.WriteLine("Inv " + item.Name + " (" + item.Owner.ToString().Substring(34) + "): " +
+ String.Format(Perms, (PermissionMask)item.BasePermissions,
+ (PermissionMask)item.GroupPermissions, (PermissionMask)item.EveryOnePermissions, (PermissionMask)item.NextPermissions));
+
+ }
+
+ public void AssertPermissions(PermissionMask desired, PermissionMask actual, string message)
+ {
+ if ((desired & PermissionMask.Copy) != 0)
+ Assert.True((actual & PermissionMask.Copy) != 0, message);
+ else
+ Assert.True((actual & PermissionMask.Copy) == 0, message);
+
+ if ((desired & PermissionMask.Modify) != 0)
+ Assert.True((actual & PermissionMask.Modify) != 0, message);
+ else
+ Assert.True((actual & PermissionMask.Modify) == 0, message);
+
+ if ((desired & PermissionMask.Transfer) != 0)
+ Assert.True((actual & PermissionMask.Transfer) != 0, message);
+ else
+ Assert.True((actual & PermissionMask.Transfer) == 0, message);
+
+ }
+
+ public SceneObjectGroup AddSceneObject(string name, int suffix, int partsToTestCount, UUID ownerID)
+ {
+ SceneObjectGroup so = SceneHelpers.CreateSceneObject(partsToTestCount, ownerID, name, suffix);
+ so.Name = name;
+ so.Description = name;
+
+ Assert.That(m_Scene.AddNewSceneObject(so, false), Is.True);
+ SceneObjectGroup retrievedSo = m_Scene.GetSceneObjectGroup(so.UUID);
+
+ // If the parts have the same UUID then we will consider them as one and the same
+ Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount));
+
+ return so;
+ }
+
+ public void TakeCopyToInventory(SceneObjectGroup sog)
+ {
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects");
+ Assert.That(objsFolder, Is.Not.Null);
+
+ List localIds = new List(); localIds.Add(sog.LocalId);
+ // This is an async operation
+ m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID);
+ }
+
+ public InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName)
+ {
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, userID, folderName);
+ Assert.That(objsFolder, Is.Not.Null);
+ List items = m_Scene.InventoryService.GetFolderItems(userID, objsFolder.ID);
+ InventoryItemBase item = items.Find(i => i.Name == itemName);
+ Assert.That(item, Is.Not.Null);
+
+ return item;
+ }
+
+ public void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp)
+ {
+ TestClient giverClient = (TestClient)giverSp.ControllingClient;
+ TestClient receiverClient = (TestClient)receiverSp.ControllingClient;
+
+ UUID initialSessionId = TestHelpers.ParseTail(0x10);
+ byte[] giveImBinaryBucket = new byte[17];
+ byte[] itemIdBytes = itemId.GetBytes();
+ Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length);
+
+ GridInstantMessage giveIm
+ = new GridInstantMessage(
+ m_Scene,
+ giverSp.UUID,
+ giverSp.Name,
+ receiverSp.UUID,
+ (byte)InstantMessageDialog.InventoryOffered,
+ false,
+ "inventory offered msg",
+ initialSessionId,
+ false,
+ Vector3.Zero,
+ giveImBinaryBucket,
+ true);
+
+ giverClient.HandleImprovedInstantMessage(giveIm);
+
+ // These details might not all be correct.
+ GridInstantMessage acceptIm
+ = new GridInstantMessage(
+ m_Scene,
+ receiverSp.UUID,
+ receiverSp.Name,
+ giverSp.UUID,
+ (byte)InstantMessageDialog.InventoryAccepted,
+ false,
+ "inventory accepted msg",
+ initialSessionId,
+ false,
+ Vector3.Zero,
+ null,
+ true);
+
+ receiverClient.HandleImprovedInstantMessage(acceptIm);
+ }
+ }
+}
diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs
index 7716776..e103d01 100644
--- a/OpenSim/Tests/Permissions/DirectTransferTests.cs
+++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs
@@ -48,205 +48,65 @@ namespace OpenSim.Tests.Permissions
/// Basic scene object tests (create, read and delete but not update).
///
[TestFixture]
- public class DirectTransferTests : OpenSimTestCase
+ public class DirectTransferTests
{
- private static string Perms = "Owner: {0}; Group: {1}; Everyone: {2}; Next: {3}";
- protected TestScene m_Scene;
- private ScenePresence[] m_Avatars = new ScenePresence[3];
[SetUp]
- public override void SetUp()
+ public void SetUp()
{
- base.SetUp();
- TestHelpers.EnableLogging();
-
- IConfigSource config = new IniConfigSource();
- config.AddConfig("Messaging");
- config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule");
- config.AddConfig("Modules");
- config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
- config.AddConfig("InventoryService");
- config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService");
- config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin");
-
- m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config);
- // Add modules
- SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule());
-
- // Add 3 avatars
- for (int i = 0; i < 3; i++)
- {
- UUID id = TestHelpers.ParseTail(i+1);
-
- m_Avatars[i] = AddScenePresence("Bot", "Bot_" + i, id);
- Assert.That(m_Avatars[i], Is.Not.Null);
- Assert.That(m_Avatars[i].IsChildAgent, Is.False);
- Assert.That(m_Avatars[i].UUID, Is.EqualTo(id));
-
- Assert.That(m_Scene.GetScenePresences().Count, Is.EqualTo(i+1));
- }
}
///
- /// Test adding an object to a scene.
+ /// Test giving a C object.
///
[Test]
public void TestGiveCBox()
{
TestHelpers.InMethod();
- // Create a C Box
- SceneObjectGroup boxC = AddSceneObject("Box C", 10, 1, m_Avatars[0].UUID);
-
- // field = 16 is NextOwner
- // set = 1 means add the permission; set = 0 means remove permission
- m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID,
- ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, boxC.LocalId, (uint)PermissionMask.Copy, 1);
-
- m_Scene.HandleObjectPermissionsUpdate((IClientAPI)m_Avatars[0].ClientView, m_Avatars[0].UUID,
- ((IClientAPI)(m_Avatars[0].ClientView)).SessionId, 16, boxC.LocalId, (uint)PermissionMask.Transfer, 0);
- PrintPerms(boxC);
-
- Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Copy) != 0);
- Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Modify) == 0);
- Assert.True((boxC.RootPart.NextOwnerMask & (int)PermissionMask.Transfer) == 0);
-
- InventoryItemBase item = TakeCopyToInventory(boxC);
-
- GiveInventoryItem(item.ID, m_Avatars[0], m_Avatars[1]);
-
- item = GetItemFromInventory(m_Avatars[1].UUID, "Objects", "Box C");
-
- // Check the receiver
- PrintPerms(item);
- Assert.True((item.BasePermissions & (int)PermissionMask.Copy) != 0);
- Assert.True((item.BasePermissions & (int)PermissionMask.Modify) == 0);
- Assert.True((item.BasePermissions & (int)PermissionMask.Transfer) == 0);
-
- // Rez it and check perms in scene too
- m_Scene.RezObject(m_Avatars[1].ControllingClient, item.ID, UUID.Zero, Vector3.One, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero);
- Assert.That(m_Scene.GetSceneObjectGroups().Count, Is.EqualTo(2));
- SceneObjectGroup copyBoxC = m_Scene.GetSceneObjectGroups().Find(sog => sog.OwnerID == m_Avatars[1].UUID);
- PrintPerms(copyBoxC);
- Assert.That(copyBoxC, Is.Not.Null);
-
- }
-
- #region Helper Functions
-
- private void PrintPerms(SceneObjectGroup sog)
- {
- Console.WriteLine("SOG " + sog.Name + ": " + String.Format(Perms, (PermissionMask)sog.EffectiveOwnerPerms,
- (PermissionMask)sog.EffectiveGroupPerms, (PermissionMask)sog.EffectiveEveryOnePerms, (PermissionMask)sog.RootPart.NextOwnerMask));
-
- }
-
- private void PrintPerms(InventoryItemBase item)
- {
- Console.WriteLine("Inv " + item.Name + ": " + String.Format(Perms, (PermissionMask)item.BasePermissions,
- (PermissionMask)item.GroupPermissions, (PermissionMask)item.EveryOnePermissions, (PermissionMask)item.NextPermissions));
-
+ // C, CT, MC, MCT, MT, T
+ string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T"};
+ PermissionMask[] perms = new PermissionMask[6] {
+ PermissionMask.Copy,
+ PermissionMask.Copy | PermissionMask.Transfer,
+ PermissionMask.Modify | PermissionMask.Copy,
+ PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer,
+ PermissionMask.Modify | PermissionMask.Transfer,
+ PermissionMask.Transfer
+ };
+
+ for (int i = 0; i < 6; i++)
+ TestOneBox(names[i], perms[i]);
}
- private ScenePresence AddScenePresence(string first, string last, UUID id)
+ private void TestOneBox(string name, PermissionMask mask)
{
- UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(m_Scene, first, last, id, "pw");
- ScenePresence sp = SceneHelpers.AddScenePresence(m_Scene, id);
- Assert.That(m_Scene.AuthenticateHandler.GetAgentCircuitData(id), Is.Not.Null);
-
- return sp;
- }
-
- private SceneObjectGroup AddSceneObject(string name, int suffix, int partsToTestCount, UUID ownerID)
- {
- TestHelpers.InMethod();
-
- SceneObjectGroup so = SceneHelpers.CreateSceneObject(partsToTestCount, ownerID, name, suffix);
- so.Name = name;
- so.Description = name;
-
- Assert.That(m_Scene.AddNewSceneObject(so, false), Is.True);
- SceneObjectGroup retrievedSo = m_Scene.GetSceneObjectGroup(so.UUID);
+ InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[0].UUID, "Objects", name);
- // If the parts have the same UUID then we will consider them as one and the same
- Assert.That(retrievedSo.PrimCount, Is.EqualTo(partsToTestCount));
+ Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[0], Common.TheAvatars[1]);
- return so;
- }
+ item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name);
- private InventoryItemBase TakeCopyToInventory(SceneObjectGroup sog)
- {
- InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects");
- Assert.That(objsFolder, Is.Not.Null);
+ // Check the receiver
+ Common.TheInstance.PrintPerms(item);
+ Common.TheInstance.AssertPermissions(mask, (PermissionMask)item.BasePermissions, item.Owner.ToString().Substring(34) + " : " + item.Name);
- List localIds = new List(); localIds.Add(sog.LocalId);
- m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID);
- Thread.Sleep(5000);
+ int nObjects = Common.TheScene.GetSceneObjectGroups().Count;
+ // Rez it and check perms in scene too
+ Common.TheScene.RezObject(Common.TheAvatars[1].ControllingClient, item.ID, UUID.Zero, Vector3.One, Vector3.Zero, UUID.Zero, 0, false, false, false, UUID.Zero);
+ Assert.That(Common.TheScene.GetSceneObjectGroups().Count, Is.EqualTo(nObjects + 1));
- List items = m_Scene.InventoryService.GetFolderItems(sog.OwnerID, objsFolder.ID);
- InventoryItemBase item = items.Find(i => i.Name == sog.Name);
- Assert.That(item, Is.Not.Null);
+ SceneObjectGroup box = Common.TheScene.GetSceneObjectGroups().Find(sog => sog.OwnerID == Common.TheAvatars[1].UUID && sog.Name == name);
+ Common.TheInstance.PrintPerms(box);
+ Assert.That(box, Is.Not.Null);
- return item;
+ // Check Owner permissions
+ Common.TheInstance.AssertPermissions(mask, (PermissionMask)box.EffectiveOwnerPerms, box.OwnerID.ToString().Substring(34) + " : " + box.Name);
- }
+ // Check Next Owner permissions
+ Common.TheInstance.AssertPermissions(mask, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name);
- private InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName)
- {
- InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, userID, folderName);
- Assert.That(objsFolder, Is.Not.Null);
- List items = m_Scene.InventoryService.GetFolderItems(userID, objsFolder.ID);
- InventoryItemBase item = items.Find(i => i.Name == itemName);
- Assert.That(item, Is.Not.Null);
-
- return item;
}
- private void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp)
- {
- TestClient giverClient = (TestClient)giverSp.ControllingClient;
- TestClient receiverClient = (TestClient)receiverSp.ControllingClient;
-
- UUID initialSessionId = TestHelpers.ParseTail(0x10);
- byte[] giveImBinaryBucket = new byte[17];
- byte[] itemIdBytes = itemId.GetBytes();
- Array.Copy(itemIdBytes, 0, giveImBinaryBucket, 1, itemIdBytes.Length);
-
- GridInstantMessage giveIm
- = new GridInstantMessage(
- m_Scene,
- giverSp.UUID,
- giverSp.Name,
- receiverSp.UUID,
- (byte)InstantMessageDialog.InventoryOffered,
- false,
- "inventory offered msg",
- initialSessionId,
- false,
- Vector3.Zero,
- giveImBinaryBucket,
- true);
-
- giverClient.HandleImprovedInstantMessage(giveIm);
-
- // These details might not all be correct.
- GridInstantMessage acceptIm
- = new GridInstantMessage(
- m_Scene,
- receiverSp.UUID,
- receiverSp.Name,
- giverSp.UUID,
- (byte)InstantMessageDialog.InventoryAccepted,
- false,
- "inventory accepted msg",
- initialSessionId,
- false,
- Vector3.Zero,
- null,
- true);
-
- receiverClient.HandleImprovedInstantMessage(acceptIm);
- }
- #endregion
}
}
\ No newline at end of file
--
cgit v1.1
From 1ca2a7937ebf246bb2ebe4b1355f8068912ea4b0 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 1 May 2017 14:58:03 -0700
Subject: Permissions tests: added test with 2 direct transfers with permission
changes in between (in inventory)
---
OpenSim/Tests/Permissions/Common.cs | 64 +++++++++++++++++++++++-
OpenSim/Tests/Permissions/DirectTransferTests.cs | 51 +++++++++++++++++--
2 files changed, 110 insertions(+), 5 deletions(-)
diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs
index 63b91b6..84dadf2 100644
--- a/OpenSim/Tests/Permissions/Common.cs
+++ b/OpenSim/Tests/Permissions/Common.cs
@@ -93,11 +93,16 @@ namespace OpenSim.Tests.Permissions
AddA1Object("Box MT", 14, PermissionMask.Modify | PermissionMask.Transfer);
AddA1Object("Box T", 15, PermissionMask.Transfer);
+ // MCT-C
+ AddA1Object("Box MCT-C", 16, PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer);
+
Thread.Sleep(5000);
InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[0].UUID, "Objects");
List items = m_Scene.InventoryService.GetFolderItems(m_Avatars[0].UUID, objsFolder.ID);
- Assert.That(items.Count, Is.EqualTo(6));
+ Assert.That(items.Count, Is.EqualTo(7));
+
+ RevokePermission(0, "Box MCT-C", PermissionMask.Copy);
}
private ScenePresence AddScenePresence(string first, string last, UUID id)
@@ -139,6 +144,30 @@ namespace OpenSim.Tests.Permissions
}
+ public void RevokePermission(int ownerIndex, string name, PermissionMask perm)
+ {
+ InventoryItemBase item = Common.TheInstance.GetItemFromInventory(m_Avatars[ownerIndex].UUID, "Objects", name);
+ Assert.That(item, Is.Not.Null);
+
+ // Clone it, so to avoid aliasing -- just like the viewer does.
+ InventoryItemBase clone = Common.TheInstance.CloneInventoryItem(item);
+ // Revoke the permission in this copy
+ clone.NextPermissions &= ~(uint)perm;
+ Common.TheInstance.AssertPermissions((PermissionMask)clone.NextPermissions & ~perm,
+ (PermissionMask)clone.NextPermissions, Common.TheInstance.IdStr(clone));
+ Assert.That(clone.ID == item.ID);
+
+ // Update properties of the item in inventory. This should affect the original item above.
+ Common.TheScene.UpdateInventoryItemAsset(m_Avatars[ownerIndex].ControllingClient, UUID.Zero, clone.ID, clone);
+
+ item = Common.TheInstance.GetItemFromInventory(m_Avatars[ownerIndex].UUID, "Objects", name);
+ Assert.That(item, Is.Not.Null);
+ Common.TheInstance.PrintPerms(item);
+ Common.TheInstance.AssertPermissions((PermissionMask)item.NextPermissions & ~perm,
+ (PermissionMask)item.NextPermissions, Common.TheInstance.IdStr(item));
+
+ }
+
public void PrintPerms(SceneObjectGroup sog)
{
Console.WriteLine("SOG " + sog.Name + " (" + sog.OwnerID.ToString().Substring(34) + "): " +
@@ -210,6 +239,39 @@ namespace OpenSim.Tests.Permissions
return item;
}
+ public InventoryItemBase CloneInventoryItem(InventoryItemBase item)
+ {
+ InventoryItemBase clone = new InventoryItemBase(item.ID);
+ clone.Name = item.Name;
+ clone.Description = item.Description;
+ clone.AssetID = item.AssetID;
+ clone.AssetType = item.AssetType;
+ clone.BasePermissions = item.BasePermissions;
+ clone.CreatorId = item.CreatorId;
+ clone.CurrentPermissions = item.CurrentPermissions;
+ clone.EveryOnePermissions = item.EveryOnePermissions;
+ clone.Flags = item.Flags;
+ clone.Folder = item.Folder;
+ clone.GroupID = item.GroupID;
+ clone.GroupOwned = item.GroupOwned;
+ clone.GroupPermissions = item.GroupPermissions;
+ clone.InvType = item.InvType;
+ clone.NextPermissions = item.NextPermissions;
+ clone.Owner = item.Owner;
+
+ return clone;
+ }
+
+ public string IdStr(InventoryItemBase item)
+ {
+ return item.Owner.ToString().Substring(34) + " : " + item.Name;
+ }
+
+ public string IdStr(SceneObjectGroup sog)
+ {
+ return sog.OwnerID.ToString().Substring(34) + " : " + sog.Name;
+ }
+
public void GiveInventoryItem(UUID itemId, ScenePresence giverSp, ScenePresence receiverSp)
{
TestClient giverClient = (TestClient)giverSp.ControllingClient;
diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs
index e103d01..3ca711a 100644
--- a/OpenSim/Tests/Permissions/DirectTransferTests.cs
+++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Tests.Permissions
/// Basic scene object tests (create, read and delete but not update).
///
[TestFixture]
- public class DirectTransferTests
+ public class DirectTransferTests
{
[SetUp]
@@ -57,15 +57,15 @@ namespace OpenSim.Tests.Permissions
}
///
- /// Test giving a C object.
+ /// Test giving simple objecta with various combinations of next owner perms.
///
[Test]
- public void TestGiveCBox()
+ public void TestGiveBox()
{
TestHelpers.InMethod();
// C, CT, MC, MCT, MT, T
- string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T"};
+ string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T" };
PermissionMask[] perms = new PermissionMask[6] {
PermissionMask.Copy,
PermissionMask.Copy | PermissionMask.Transfer,
@@ -108,5 +108,48 @@ namespace OpenSim.Tests.Permissions
}
+ ///
+ /// Test giving simple objecta with variour combinations of next owner perms.
+ ///
+ [Test]
+ public void TestDoubleGiveWithChange()
+ {
+ TestHelpers.InMethod();
+
+ string name = "Box MCT-C";
+ InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[0].UUID, "Objects", name);
+
+ // Now give the item to A2. We give the original item, not a clone.
+ // The giving methods are supposed to duplicate it.
+ Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[0], Common.TheAvatars[1]);
+
+ item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name);
+
+ // Check the receiver
+ Common.TheInstance.PrintPerms(item);
+ Common.TheInstance.AssertPermissions(PermissionMask.Modify | PermissionMask.Transfer,
+ (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item));
+
+ // ---------------------------
+ // Second transfer
+ //----------------------------
+
+ // A2 revokes M
+ Common.TheInstance.RevokePermission(1, name, PermissionMask.Modify);
+
+ item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name);
+
+ // Now give the item to A3. We give the original item, not a clone.
+ // The giving methods are supposed to duplicate it.
+ Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[1], Common.TheAvatars[2]);
+
+ item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[2].UUID, "Objects", name);
+
+ // Check the receiver
+ Common.TheInstance.PrintPerms(item);
+ Common.TheInstance.AssertPermissions(PermissionMask.Transfer,
+ (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item));
+
+ }
}
}
\ No newline at end of file
--
cgit v1.1
From 8498cc2f02ef61e93d603dac28c21df4321609a1 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 1 May 2017 23:07:57 +0100
Subject: save a few nanoseconds
---
.../Framework/Scenes/SceneObjectPartInventory.cs | 25 ++++++++++++++--------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 946ed09..8c9d0bb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1351,19 +1351,26 @@ namespace OpenSim.Region.Framework.Scenes
if(item.InvType == (sbyte)InventoryType.Landmark)
continue;
- if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
- mask &= ~((uint)PermissionMask.FoldedCopy);
- if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
- mask &= ~((uint)PermissionMask.FoldedTransfer);
- if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Export) == 0)
- mask &= ~((uint)PermissionMask.FoldedExport);
+ // apply current to normal permission bits
+ uint newperms = item.CurrentPermissions;
- if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
+ if ((newperms & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
- if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
+ if ((newperms & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer;
- if ((item.CurrentPermissions & (uint)PermissionMask.Export) == 0)
+ if ((newperms & (uint)PermissionMask.Export) == 0)
mask &= ~((uint)PermissionMask.Export);
+
+ // apply next owner restricted by current to folded bits
+ newperms &= item.NextPermissions;
+
+ if ((newperms & (uint)PermissionMask.Copy) == 0)
+ mask &= ~((uint)PermissionMask.FoldedCopy);
+ if ((newperms & (uint)PermissionMask.Transfer) == 0)
+ mask &= ~((uint)PermissionMask.FoldedTransfer);
+ if ((newperms & (uint)PermissionMask.Export) == 0)
+ mask &= ~((uint)PermissionMask.FoldedExport);
+
}
return mask;
}
--
cgit v1.1
From 3c43cdbbcc2687e2f5d4319c5c3c3cbad4930fab Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 1 May 2017 16:42:47 -0700
Subject: Added some indirect transfer tests -- Take Copy by another avatar
---
OpenSim/Tests/Permissions/Common.cs | 40 ++++--
OpenSim/Tests/Permissions/DirectTransferTests.cs | 10 --
OpenSim/Tests/Permissions/IndirectTransferTests.cs | 137 +++++++++++++++++++++
3 files changed, 169 insertions(+), 18 deletions(-)
create mode 100644 OpenSim/Tests/Permissions/IndirectTransferTests.cs
diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs
index 84dadf2..e62991b 100644
--- a/OpenSim/Tests/Permissions/Common.cs
+++ b/OpenSim/Tests/Permissions/Common.cs
@@ -1,6 +1,31 @@
-using System;
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+using System;
using System.Collections.Generic;
-using System.Reflection;
using System.Threading;
using Nini.Config;
using NUnit.Framework;
@@ -10,7 +35,6 @@ using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.CoreModules.World.Permissions;
using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer;
using OpenSim.Region.CoreModules.Framework.InventoryAccess;
-using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using PermissionMask = OpenSim.Framework.PermissionMask;
@@ -67,7 +91,7 @@ namespace OpenSim.Tests.Permissions
/// - 6 simple boxes inworld belonging to A0 and with Next Owner perms:
/// C, CT, MC, MCT, MT, T
/// - Copies of all of these boxes in A0's inventory in the Objects folder
- /// - One additional box in A0's inventory which is a copy of MCT, but
+ /// - One additional box inworld and in A0's inventory which is a copy of MCT, but
/// with C removed in inventory. This one is called MCT-C
///
private void SetUpBasicEnvironment()
@@ -140,7 +164,7 @@ namespace OpenSim.Tests.Permissions
PrintPerms(box);
AssertPermissions(nextOwnerPerms, (PermissionMask)box.RootPart.NextOwnerMask, box.OwnerID.ToString().Substring(34) + " : " + box.Name);
- TakeCopyToInventory(box);
+ TakeCopyToInventory(0, box);
}
@@ -218,14 +242,14 @@ namespace OpenSim.Tests.Permissions
return so;
}
- public void TakeCopyToInventory(SceneObjectGroup sog)
+ public void TakeCopyToInventory(int userIndex, SceneObjectGroup sog)
{
- InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, sog.OwnerID, "Objects");
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(m_Scene.InventoryService, m_Avatars[userIndex].UUID, "Objects");
Assert.That(objsFolder, Is.Not.Null);
List localIds = new List(); localIds.Add(sog.LocalId);
// This is an async operation
- m_Scene.DeRezObjects((IClientAPI)m_Avatars[0].ClientView, localIds, sog.UUID, DeRezAction.TakeCopy, objsFolder.ID);
+ m_Scene.DeRezObjects((IClientAPI)m_Avatars[userIndex].ClientView, localIds, m_Avatars[userIndex].UUID, DeRezAction.TakeCopy, objsFolder.ID);
}
public InventoryItemBase GetItemFromInventory(UUID userID, string folderName, string itemName)
diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs
index 3ca711a..3b711a1 100644
--- a/OpenSim/Tests/Permissions/DirectTransferTests.cs
+++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs
@@ -25,20 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Threading;
-using Nini.Config;
using NUnit.Framework;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
-using OpenSim.Region.CoreModules.World.Permissions;
-using OpenSim.Region.CoreModules.Avatar.Inventory.Transfer;
-using OpenSim.Region.CoreModules.Framework.InventoryAccess;
-using OpenSim.Region.Framework.Scenes.Serialization;
-using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using PermissionMask = OpenSim.Framework.PermissionMask;
diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs
new file mode 100644
index 0000000..6a6ba2f
--- /dev/null
+++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System.Collections.Generic;
+using System.Threading;
+using NUnit.Framework;
+using OpenMetaverse;
+using OpenSim.Framework;
+using OpenSim.Region.Framework.Scenes;
+using OpenSim.Tests.Common;
+using PermissionMask = OpenSim.Framework.PermissionMask;
+
+namespace OpenSim.Tests.Permissions
+{
+ ///
+ /// Basic scene object tests (create, read and delete but not update).
+ ///
+ [TestFixture]
+ public class IndirectTransferTests
+ {
+
+ [SetUp]
+ public void SetUp()
+ {
+ // Delete everything in A2 and A3's Objects folders from previous tests
+ for (int i = 1; i < 3; i++)
+ {
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects");
+ Assert.That(objsFolder, Is.Not.Null);
+
+ List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
+ List ids = new List();
+ foreach (InventoryItemBase it in items)
+ ids.Add(it.ID);
+
+ Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids);
+ items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
+ Assert.That(items.Count, Is.EqualTo(0), "A" + (i+1));
+ }
+ }
+
+ ///
+ /// Test giving simple objecta with various combinations of next owner perms.
+ ///
+ [Test]
+ public void SimpleTakeCopy()
+ {
+ TestHelpers.InMethod();
+
+ // The Objects folder of A2
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[1].UUID, "Objects");
+
+ // C, CT, MC, MCT, MT, T
+ string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T" };
+ PermissionMask[] perms = new PermissionMask[6] {
+ PermissionMask.Copy,
+ PermissionMask.Copy | PermissionMask.Transfer,
+ PermissionMask.Modify | PermissionMask.Copy,
+ PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer,
+ PermissionMask.Modify | PermissionMask.Transfer,
+ PermissionMask.Transfer
+ };
+
+ // Try A2 takes copies of objects that cannot be copied.
+ for (int i = 0; i < 6; i++)
+ TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]);
+ Thread.Sleep(5000);
+
+ List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID);
+ Assert.That(items.Count, Is.EqualTo(0));
+
+ // A1 makes the objects copyable
+ for (int i = 0; i < 6; i++)
+ MakeCopyable(Common.TheScene.GetSceneObjectGroups(), names[i]);
+
+ // Try A2 takes copies of objects that can be copied.
+ for (int i = 0; i < 6; i++)
+ TakeOneBox(Common.TheScene.GetSceneObjectGroups(), names[i], perms[i]);
+ Thread.Sleep(5000);
+
+ items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[1].UUID, objsFolder.ID);
+ Assert.That(items.Count, Is.EqualTo(6));
+
+ for (int i = 0; i < 6; i++)
+ {
+ InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", names[i]);
+ Assert.That(item, Is.Not.Null);
+ Common.TheInstance.AssertPermissions(perms[i], (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item));
+ }
+ }
+
+ private void TakeOneBox(List objs, string name, PermissionMask mask)
+ {
+ SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID);
+ Assert.That(box, Is.Not.Null, name);
+
+ // A2's inventory (index 1)
+ Common.TheInstance.TakeCopyToInventory(1, box);
+ }
+
+ private void MakeCopyable(List objs, string name)
+ {
+ SceneObjectGroup box = objs.Find(sog => sog.Name == name && sog.OwnerID == Common.TheAvatars[0].UUID);
+ Assert.That(box, Is.Not.Null, name);
+
+ // field = 8 is Everyone
+ // set = 1 means add the permission; set = 0 means remove permission
+ Common.TheScene.HandleObjectPermissionsUpdate((IClientAPI)Common.TheAvatars[0].ClientView, Common.TheAvatars[0].UUID,
+ Common.TheAvatars[0].ControllingClient.SessionId, 8, box.LocalId, (uint)PermissionMask.Copy, 1);
+ Common.TheInstance.PrintPerms(box);
+ }
+ }
+}
\ No newline at end of file
--
cgit v1.1
From 9c82ff76730c9eff80cace1ddece0148d8d0a7ee Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 1 May 2017 16:49:42 -0700
Subject: Shuffle some code around
---
OpenSim/Tests/Permissions/Common.cs | 20 ++++++++++++++++++++
OpenSim/Tests/Permissions/DirectTransferTests.cs | 1 +
OpenSim/Tests/Permissions/IndirectTransferTests.cs | 16 +---------------
3 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs
index e62991b..f93c120 100644
--- a/OpenSim/Tests/Permissions/Common.cs
+++ b/OpenSim/Tests/Permissions/Common.cs
@@ -286,6 +286,26 @@ namespace OpenSim.Tests.Permissions
return clone;
}
+ public void DeleteObjectsFolders()
+ {
+ // Delete everything in A2 and A3's Objects folders, so we can restart
+ for (int i = 1; i < 3; i++)
+ {
+ InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects");
+ Assert.That(objsFolder, Is.Not.Null);
+
+ List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
+ List ids = new List();
+ foreach (InventoryItemBase it in items)
+ ids.Add(it.ID);
+
+ Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids);
+ items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
+ Assert.That(items.Count, Is.EqualTo(0), "A" + (i + 1));
+ }
+
+ }
+
public string IdStr(InventoryItemBase item)
{
return item.Owner.ToString().Substring(34) + " : " + item.Name;
diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs
index 3b711a1..c68bbdf 100644
--- a/OpenSim/Tests/Permissions/DirectTransferTests.cs
+++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs
@@ -44,6 +44,7 @@ namespace OpenSim.Tests.Permissions
[SetUp]
public void SetUp()
{
+ Common.TheInstance.DeleteObjectsFolders();
}
///
diff --git a/OpenSim/Tests/Permissions/IndirectTransferTests.cs b/OpenSim/Tests/Permissions/IndirectTransferTests.cs
index 6a6ba2f..7d8027f 100644
--- a/OpenSim/Tests/Permissions/IndirectTransferTests.cs
+++ b/OpenSim/Tests/Permissions/IndirectTransferTests.cs
@@ -46,21 +46,7 @@ namespace OpenSim.Tests.Permissions
[SetUp]
public void SetUp()
{
- // Delete everything in A2 and A3's Objects folders from previous tests
- for (int i = 1; i < 3; i++)
- {
- InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects");
- Assert.That(objsFolder, Is.Not.Null);
-
- List items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
- List ids = new List();
- foreach (InventoryItemBase it in items)
- ids.Add(it.ID);
-
- Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids);
- items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
- Assert.That(items.Count, Is.EqualTo(0), "A" + (i+1));
- }
+ Common.TheInstance.DeleteObjectsFolders();
}
///
--
cgit v1.1
From a890ea312b56821c88bec69cfd36b799733f7a41 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 2 May 2017 11:23:41 +0100
Subject: disable LSL http listener (llRequestURL/llRequestSecureURL) if
ExternalHostNameForLSL is not set in cofiguration or does not resolve
---
.../CoreModules/Scripting/LSLHttp/UrlModule.cs | 69 +++++++++++++++++++---
1 file changed, 62 insertions(+), 7 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
index 311deab..895020c 100644
--- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
@@ -26,15 +26,15 @@
*/
using System;
-using System.Threading;
using System.Collections.Generic;
using System.Collections;
using System.Reflection;
+using System.Net;
+using System.Net.Sockets;
using log4net;
using Mono.Addins;
using Nini.Config;
using OpenMetaverse;
-using OpenSim.Framework;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Interfaces;
@@ -89,6 +89,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
protected Dictionary m_UrlMap =
new Dictionary();
+ protected bool m_enabled = false;
+ protected string m_ErrorStr;
protected uint m_HttpsPort = 0;
protected IHttpServer m_HttpServer = null;
protected IHttpServer m_HttpsServer = null;
@@ -118,6 +120,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public void Initialise(IConfigSource config)
{
IConfig networkConfig = config.Configs["Network"];
+ m_enabled = false;
if (networkConfig != null)
{
@@ -128,9 +131,47 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
if (ssl_enabled)
m_HttpsPort = (uint)config.Configs["Network"].GetInt("https_port", (int)m_HttpsPort);
}
+ else
+ {
+ m_ErrorStr = "[Network] configuration missing, HTTP listener for LSL disabled";
+ m_log.Warn("[URL MODULE]: " + m_ErrorStr);
+ return;
+ }
+
+ if (String.IsNullOrWhiteSpace(ExternalHostNameForLSL))
+ {
+ m_ErrorStr = "ExternalHostNameForLSL not defined in configuration, HTTP listener for LSL disabled";
+ m_log.Warn("[URL MODULE]: " + m_ErrorStr);
+ return;
+ }
+
+ IPAddress ia = null;
+ try
+ {
+ foreach (IPAddress Adr in Dns.GetHostAddresses(ExternalHostNameForLSL))
+ {
+ if (Adr.AddressFamily == AddressFamily.InterNetwork ||
+ Adr.AddressFamily == AddressFamily.InterNetworkV6) // ipv6 will most likely smoke
+ {
+ ia = Adr;
+ break;
+ }
+ }
+ }
+ catch
+ {
+ ia = null;
+ }
- if (ExternalHostNameForLSL == null)
- ExternalHostNameForLSL = System.Environment.MachineName;
+ if (ia == null)
+ {
+ m_ErrorStr = "Could not resolve ExternalHostNameForLSL, HTTP listener for LSL disabled";
+ m_log.Warn("[URL MODULE]: " + m_ErrorStr);
+ return;
+ }
+
+ m_enabled = true;
+ m_ErrorStr = String.Empty;
IConfig llFunctionsConfig = config.Configs["LL-Functions"];
@@ -146,7 +187,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public void AddRegion(Scene scene)
{
- if (m_HttpServer == null)
+ if (m_enabled && m_HttpServer == null)
{
// There can only be one
//
@@ -197,11 +238,18 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
{
UUID urlcode = UUID.Random();
+ if(!m_enabled)
+ {
+ engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", m_ErrorStr });
+ return urlcode;
+ }
+
lock (m_UrlMap)
{
if (m_UrlMap.Count >= TotalUrls)
{
- engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
+ engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED",
+ "Too many URLs already open" });
return urlcode;
}
string url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
@@ -243,6 +291,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
{
UUID urlcode = UUID.Random();
+ if(!m_enabled)
+ {
+ engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", m_ErrorStr });
+ return urlcode;
+ }
+
if (m_HttpsServer == null)
{
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
@@ -253,7 +307,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
{
if (m_UrlMap.Count >= TotalUrls)
{
- engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
+ engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED",
+ "Too many URLs already open" });
return urlcode;
}
string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";
--
cgit v1.1
From 6c2f8176aea95297bbce7f6d2d0cba178b39ae5b Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 2 May 2017 11:39:29 +0100
Subject: change opensim.ini.example setting of ExternalHostNameForLSL to a
defualt
---
bin/OpenSim.ini.example | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index b0777d7..da4cbe1 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -52,8 +52,11 @@
; name and use default public port 9000. The private port is not used
; in the configuration for a standalone.
- ;# {BaseURL} {} {BaseURL} {"http://example.com" "http://127.0.0.1"} "http://127.0.0.1"
- BaseURL = http://127.0.0.1
+ ;# {BaseHostname} {} {BaseHostname} {"example.com" "127.0.0.1"} "127.0.0.1"
+ BaseHostname = "127.0.0.1"
+
+ ;# {BaseURL} {} {BaseURL} {"http://${Const|BaseHostname} https://${Const|BaseHostname}} "http://${Const|BaseHostname}"
+ BaseURL = http://${Const|BaseHostname}
;# {PublicPort} {} {PublicPort} {8002 9000} "8002"
PublicPort = "8002"
@@ -525,10 +528,9 @@
;# {ExternalHostNameForLSL} {} {Hostname to use for HTTP-IN URLs. This should be reachable from the internet.} {}
;; Hostname to use in llRequestURL/llRequestSecureURL
- ;; if not defined - default machine name is being used
- ;; (on Windows this mean NETBIOS name - useably only inside local network)
- ; ExternalHostNameForLSL = "127.0.0.1"
-
+ ;; if not defined - llRequestURL/llRequestSecureURL are disabled
+ ExternalHostNameForLSL = ${Const|BaseHostname}
+
;# {shard} {} {Name to use for X-Secondlife-Shard header? (press enter if unsure)} {} OpenSim
;; What is reported as the "X-Secondlife-Shard"
;; Defaults to the user server url if not set
--
cgit v1.1
From a18ee3b6b354665d72b3f307bd6e52a8da230b4d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 2 May 2017 12:35:06 +0100
Subject: fix LSL_ApiHttpTests
---
.../Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
index 4dc8fc6..241a24d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
@@ -87,17 +87,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
uint port = 9999;
MainServer.RemoveHttpServer(port);
+ m_engine = new MockScriptEngine();
+ m_urlModule = new UrlModule();
+
+ IConfigSource config = new IniConfigSource();
+ config.AddConfig("Network");
+ config.Configs["Network"].Set("ExternalHostNameForLSL", "127.0.0.1");
+ m_scene = new SceneHelpers().SetupScene();
+
BaseHttpServer server = new BaseHttpServer(port, false, 0, "");
MainServer.AddHttpServer(server);
MainServer.Instance = server;
server.Start();
- m_engine = new MockScriptEngine();
- m_urlModule = new UrlModule();
-
- m_scene = new SceneHelpers().SetupScene();
- SceneHelpers.SetupSceneModules(m_scene, new IniConfigSource(), m_engine, m_urlModule);
+ SceneHelpers.SetupSceneModules(m_scene, config, m_engine, m_urlModule);
SceneObjectGroup so = SceneHelpers.AddSceneObject(m_scene);
m_scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, so.RootPart);
--
cgit v1.1
From 55f7986b449633477467f7fdda95873b4a00f8fd Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 2 May 2017 13:14:26 +0100
Subject: fix some comments
---
bin/OpenSim.ini.example | 2 +-
bin/OpenSimDefaults.ini | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index da4cbe1..021e444 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -55,7 +55,7 @@
;# {BaseHostname} {} {BaseHostname} {"example.com" "127.0.0.1"} "127.0.0.1"
BaseHostname = "127.0.0.1"
- ;# {BaseURL} {} {BaseURL} {"http://${Const|BaseHostname} https://${Const|BaseHostname}} "http://${Const|BaseHostname}"
+ ;# {BaseURL} {} {BaseURL} {"http://${Const|BaseHostname}} "http://${Const|BaseHostname}"
BaseURL = http://${Const|BaseHostname}
;# {PublicPort} {} {PublicPort} {8002 9000} "8002"
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index f70f7db..89954ef 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -600,8 +600,7 @@
; HttpBodyMaxLenMAX=16384
; Hostname to use in llRequestURL/llRequestSecureURL
- ; if not defined - default machine name is being used
- ; (on Windows this mean NETBIOS name - useably only inside local network)
+ ; if not defined - llRequestURL/llRequestSecureURL are disabled
; ExternalHostNameForLSL=127.0.0.1
; Disallow the following address ranges for user scripting calls (e.g. llHttpRequest())
--
cgit v1.1
From 710677cdc6afef7f67f700bf4efcf145d23b85d5 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 2 May 2017 15:16:56 +0100
Subject: mantis 8135
---
.../Scripting/WorldComm/WorldCommModule.cs | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
index 660e03f..a5203ea 100644
--- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
// wrap this in a try block so that defaults will work if
// the config file doesn't specify otherwise.
int maxlisteners = 1000;
- int maxhandles = 64;
+ int maxhandles = 65;
try
{
m_whisperdistance = config.Configs["Chat"].GetInt(
@@ -130,8 +130,15 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
catch (Exception)
{
}
- if (maxlisteners < 1) maxlisteners = int.MaxValue;
- if (maxhandles < 1) maxhandles = int.MaxValue;
+
+ if (maxlisteners < 1)
+ maxlisteners = int.MaxValue;
+ if (maxhandles < 1)
+ maxhandles = int.MaxValue;
+
+ if (maxlisteners < maxhandles)
+ maxlisteners = maxhandles;
+
m_listenerManager = new ListenerManager(maxlisteners, maxhandles);
m_pendingQ = new Queue();
m_pending = Queue.Synchronized(m_pendingQ);
@@ -605,11 +612,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
li.GetHandle().Equals(handle))
{
lis.Value.Remove(li);
+ m_curlisteners--;
if (lis.Value.Count == 0)
- {
- m_listeners.Remove(lis.Key);
- m_curlisteners--;
- }
+ m_listeners.Remove(lis.Key); // bailing of loop so this does not smoke
// there should be only one, so we bail out early
return;
}
@@ -718,6 +723,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
}
}
+ if(handles.Count >= m_maxhandles)
+ return -1;
+
// Note: 0 is NOT a valid handle for llListen() to return
for (int i = 1; i <= m_maxhandles; i++)
{
--
cgit v1.1
From 1bfe9354e375b77318dde4222e7fa01937d4c5b8 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 2 May 2017 15:45:33 +0100
Subject: coment out optional fields that should be edited and uncomented if
needed
---
bin/OpenSimDefaults.ini | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 89954ef..21ff8d6 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -1898,7 +1898,8 @@
; regex specifying for which regions concierge service is desired; if
; empty, then for all
- regions = "^MeetingSpace-"
+ ;regions = "^MeetingSpace-"
+ regions = ""
; for each region that matches the regions regexp you can provide
; (optionally) a welcome template using format substitution:
@@ -1906,14 +1907,14 @@
; {1} is replaced with the name of the region
; {2} is replaced with the name of the concierge (whoami variable above)
- welcomes = /path/to/welcome/template/directory
+ ;welcomes = /path/to/welcome/template/directory
; Concierge can send attendee lists to an event broker whenever an
; avatar enters or leaves a concierged region. the URL is subject
; to format substitution:
; {0} is replaced with the region's name
; {1} is replaced with the region's UUID
- broker = "http://broker.place.com/{1}"
+ ;broker = "http://broker.place.com/{1}"
[MRM]
--
cgit v1.1
From 02b43f06d1965f6492fdae692373d0d460db881e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 2 May 2017 20:45:01 +0100
Subject: recover a lost trim in permissions modules names parsing
---
OpenSim/Region/Application/OpenSimBase.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 168836c..0862fcf 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -237,7 +237,7 @@ namespace OpenSim
string permissionModules = Util.GetConfigVarFromSections(Config, "permissionmodules",
new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
- m_permsModules = new List(permissionModules.Split(','));
+ m_permsModules = new List(permissionModules.Split(',').Select(m => m.Trim()));
managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty);
managedStatsPassword = startupConfig.GetString("ManagedStatsRemoteFetchPassword", String.Empty);
--
cgit v1.1
From cffe2f87e665f986a0b05e48ceec3297dc1cedc7 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 3 May 2017 15:17:16 +0100
Subject: viewer can't tell if a taskitem is group owned if we don't tell him;
missing taskInv serial update"
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 8c9d0bb..3ed37a2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -207,6 +207,7 @@ namespace OpenSim.Region.Framework.Scenes
item.PermsGranter = UUID.Zero;
item.OwnerChanged = true;
}
+ m_inventorySerial++;
m_items.LockItemsForWrite(false);
}
@@ -222,7 +223,7 @@ namespace OpenSim.Region.Framework.Scenes
m_items.LockItemsForWrite(false);
return;
}
-
+ m_inventorySerial++;
// Don't let this set the HasGroupChanged flag for attachments
// as this happens during rez and we don't want a new asset
// for each attachment each time
@@ -1179,6 +1180,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (TaskInventoryItem item in m_items.Values)
{
UUID ownerID = item.OwnerID;
+ UUID groupID = item.GroupID;
uint everyoneMask = item.EveryonePermissions;
uint baseMask = item.BasePermissions;
uint ownerMask = item.CurrentPermissions;
@@ -1201,7 +1203,12 @@ namespace OpenSim.Region.Framework.Scenes
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
- invString.AddNameValueLine("group_id", item.GroupID.ToString());
+ invString.AddNameValueLine("group_id",groupID.ToString());
+ if(groupID != UUID.Zero && ownerID == groupID)
+ invString.AddNameValueLine("group_owned","1");
+ else
+ invString.AddNameValueLine("group_owned","0");
+
invString.AddSectionEnd();
if (includeAssets)
--
cgit v1.1
From 1b501f03f9f5013ea2a180bf51798824e1241243 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 2 May 2017 20:45:01 +0100
Subject: recover a lost trim in permissions modules names parsing
---
OpenSim/Region/Application/OpenSimBase.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 168836c..0862fcf 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -237,7 +237,7 @@ namespace OpenSim
string permissionModules = Util.GetConfigVarFromSections(Config, "permissionmodules",
new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
- m_permsModules = new List(permissionModules.Split(','));
+ m_permsModules = new List(permissionModules.Split(',').Select(m => m.Trim()));
managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty);
managedStatsPassword = startupConfig.GetString("ManagedStatsRemoteFetchPassword", String.Empty);
--
cgit v1.1
From b0244107dce787122c8b857f3903455ea7fc2281 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 3 May 2017 15:31:42 +0100
Subject: viewer can't tell if a taskitem is group owned if we don't tell him;
missing taskInv serial update
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 8c9d0bb..3ed37a2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -207,6 +207,7 @@ namespace OpenSim.Region.Framework.Scenes
item.PermsGranter = UUID.Zero;
item.OwnerChanged = true;
}
+ m_inventorySerial++;
m_items.LockItemsForWrite(false);
}
@@ -222,7 +223,7 @@ namespace OpenSim.Region.Framework.Scenes
m_items.LockItemsForWrite(false);
return;
}
-
+ m_inventorySerial++;
// Don't let this set the HasGroupChanged flag for attachments
// as this happens during rez and we don't want a new asset
// for each attachment each time
@@ -1179,6 +1180,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (TaskInventoryItem item in m_items.Values)
{
UUID ownerID = item.OwnerID;
+ UUID groupID = item.GroupID;
uint everyoneMask = item.EveryonePermissions;
uint baseMask = item.BasePermissions;
uint ownerMask = item.CurrentPermissions;
@@ -1201,7 +1203,12 @@ namespace OpenSim.Region.Framework.Scenes
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
- invString.AddNameValueLine("group_id", item.GroupID.ToString());
+ invString.AddNameValueLine("group_id",groupID.ToString());
+ if(groupID != UUID.Zero && ownerID == groupID)
+ invString.AddNameValueLine("group_owned","1");
+ else
+ invString.AddNameValueLine("group_owned","0");
+
invString.AddSectionEnd();
if (includeAssets)
--
cgit v1.1
From 94bb6d965e8c6e185b378546e2b84b1db8cadd80 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 3 May 2017 16:03:26 +0100
Subject: change taskInventory copy/move to agents inventory rules
---
.../World/Permissions/PermissionsModule.cs | 29 ++++++++++++++--------
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 7 +-----
2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 18d164f..4c4a8a5 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1678,7 +1678,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return false;
}
-
private bool CanReturnObjects(ILandObject land, ScenePresence sp, List objects)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -2289,23 +2288,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (sog == null)
return false;
- uint perms = GetObjectPermissions(userID, sog, true);
- if((perms & (uint)PermissionMask.Modify) == 0)
- return false;
-
- TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
- if(ti == null)
+ if(sog.OwnerID == userID || IsAdministrator(userID))
+ return true;
+
+ if(sog.IsAttachment)
return false;
- uint itperms = GetObjectItemPermissions(userID, ti);
+ UUID sogGroupID = sog.GroupID;
- if((itperms & (uint)PermissionMask.Copy) == 0)
+ if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
return false;
- if(sog.OwnerID != userID && (itperms & (uint)PermissionMask.Transfer) == 0)
+ TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
+ if(ti == null)
return false;
- return true;
+ ulong powers = 0;
+ if(GroupMemberPowers(sogGroupID, userID, ref powers))
+ {
+ if(powers == (ulong)GroupPowers.ObjectManipulate)
+ return true;
+
+ if((ti.EveryonePermissions & (uint)PermissionMask.Copy) != 0)
+ return true;
+ }
+ return false;
}
// object inventory to object inventory item drag and drop
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index afdd99e..ca1e0a8 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1388,11 +1388,7 @@ namespace OpenSim.Region.Framework.Scenes
}
if (!Permissions.CanCopyObjectInventory(itemId, part.UUID, remoteClient.AgentId))
- {
- // check also if we can delete the no copy item
- if(!Permissions.CanEditObject(part.UUID, remoteClient.AgentId))
- return;
- }
+ return;
string message;
InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message);
@@ -1769,7 +1765,6 @@ namespace OpenSim.Region.Framework.Scenes
itemInfo.CurrentPermissions &= currentItem.BasePermissions;
itemInfo.NextPermissions &= currentItem.BasePermissions;
}
-
}
else
{
--
cgit v1.1
From 4c42716022e2dfcf70e84b05011df6db63bbe221 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 3 May 2017 18:11:50 +0100
Subject: taskitem group owned information was still incorrect
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 3ed37a2..1db6880 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1199,15 +1199,20 @@ namespace OpenSim.Region.Framework.Scenes
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
- invString.AddNameValueLine("owner_id", ownerID.ToString());
invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString());
invString.AddNameValueLine("group_id",groupID.ToString());
if(groupID != UUID.Zero && ownerID == groupID)
+ {
+ invString.AddNameValueLine("owner_id", UUID.Zero.ToString());
invString.AddNameValueLine("group_owned","1");
+ }
else
+ {
+ invString.AddNameValueLine("owner_id", ownerID.ToString());
invString.AddNameValueLine("group_owned","0");
+ }
invString.AddSectionEnd();
--
cgit v1.1
From fc462747329379c923bcc38cd11c43823b7e3cf1 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 3 May 2017 19:10:02 +0100
Subject: still another missing conversion btw viewer and OS on groupd owned
---
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 1db6880..4df1f27 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -236,10 +236,7 @@ namespace OpenSim.Region.Framework.Scenes
IList items = new List(Items.Values);
foreach (TaskInventoryItem item in items)
{
- if (groupID != item.GroupID)
- {
- item.GroupID = groupID;
- }
+ item.GroupID = groupID;
}
m_items.LockItemsForWrite(false);
}
@@ -1020,6 +1017,9 @@ namespace OpenSim.Region.Framework.Scenes
if (item.GroupPermissions != (uint)PermissionMask.None)
item.GroupID = m_part.GroupID;
+ if(item.OwnerID == UUID.Zero) // viewer to internal enconding of group owned
+ item.OwnerID = item.GroupID;
+
if (item.AssetID == UUID.Zero)
item.AssetID = m_items[item.ItemID].AssetID;
--
cgit v1.1
From 3ef583f205910c35e7537c3d725e66629fc95a30 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 3 May 2017 19:39:42 +0100
Subject: fix right to change permissions of group owned taskitems
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index ca1e0a8..d55311e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1738,8 +1738,25 @@ namespace OpenSim.Region.Framework.Scenes
// Check if we're allowed to mess with permissions
if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
{
+ bool noChange;
if (remoteClient.AgentId != part.OwnerID) // Not owner
{
+ noChange = true;
+ if(itemInfo.OwnerID == UUID.Zero && itemInfo.GroupID != UUID.Zero)
+ {
+ if(remoteClient.IsGroupMember(itemInfo.GroupID))
+ {
+ ulong powers = remoteClient.GetGroupPowers(itemInfo.GroupID);
+ if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
+ noChange = false;
+ }
+ }
+ }
+ else
+ noChange = false;
+
+ if(noChange)
+ {
// Friends and group members can't change any perms
itemInfo.BasePermissions = currentItem.BasePermissions;
itemInfo.EveryonePermissions = currentItem.EveryonePermissions;
--
cgit v1.1
From d62aed7f468d50a3b1f9ee678be9ba66d77a9218 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 3 May 2017 21:12:16 +0100
Subject: fix right to change permissions of group owned objects
---
.../World/Permissions/PermissionsModule.cs | 33 +++++++++++++++++++++-
.../Region/Framework/Scenes/Scene.Permissions.cs | 20 +++++++++++++
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 +++--
3 files changed, 57 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 4c4a8a5..45c1c56 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -293,6 +293,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
scenePermissions.OnDeleteObject += CanDeleteObject;
scenePermissions.OnEditObjectByIDs += CanEditObjectByIDs;
scenePermissions.OnEditObject += CanEditObject;
+ scenePermissions.OnEditObjectPerms += CanEditObjectPerms;
scenePermissions.OnInventoryTransfer += CanInventoryTransfer;
scenePermissions.OnMoveObject += CanMoveObject;
scenePermissions.OnTakeObject += CanTakeObject;
@@ -391,6 +392,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
scenePermissions.OnDeleteObject -= CanDeleteObject;
scenePermissions.OnEditObjectByIDs -= CanEditObjectByIDs;
scenePermissions.OnEditObject -= CanEditObject;
+ scenePermissions.OnEditObjectPerms -= CanEditObjectPerms;
scenePermissions.OnInventoryTransfer -= CanInventoryTransfer;
scenePermissions.OnMoveObject -= CanMoveObject;
scenePermissions.OnTakeObject -= CanTakeObject;
@@ -1387,6 +1389,35 @@ namespace OpenSim.Region.CoreModules.World.Permissions
return true;
}
+ private bool CanEditObjectPerms(SceneObjectGroup sog, UUID userID)
+ {
+ DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
+ if (m_bypassPermissions) return m_bypassPermissionsValue;
+
+ if (sog == null)
+ return false;
+
+ if(sog.OwnerID == userID || IsAdministrator(userID))
+ return true;
+
+ UUID sogGroupID = sog.GroupID;
+ if(sogGroupID == UUID.Zero || sogGroupID != sog.OwnerID)
+ return false;
+
+ uint perms = sog.EffectiveOwnerPerms;
+ if((perms & (uint)PermissionMask.Modify) == 0)
+ return false;
+
+ ulong powers = 0;
+ if(GroupMemberPowers(sogGroupID, userID, ref powers))
+ {
+ if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
+ return true;
+ }
+
+ return false;
+ }
+
private bool CanEditObjectInventory(UUID objectID, UUID userID)
{
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
@@ -2306,7 +2337,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
ulong powers = 0;
if(GroupMemberPowers(sogGroupID, userID, ref powers))
{
- if(powers == (ulong)GroupPowers.ObjectManipulate)
+ if((powers & (ulong)GroupPowers.ObjectManipulate) != 0)
return true;
if((ti.EveryonePermissions & (uint)PermissionMask.Copy) != 0)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index c55a7a6..a75671e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -53,6 +53,7 @@ namespace OpenSim.Region.Framework.Scenes
public delegate bool DuplicateObjectHandler(SceneObjectGroup sog, ScenePresence sp);
public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID);
public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp);
+ public delegate bool EditObjectPermsHandler(SceneObjectGroup sog, UUID editorID);
public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID);
public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp);
public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint);
@@ -133,6 +134,7 @@ namespace OpenSim.Region.Framework.Scenes
public event DuplicateObjectHandler OnDuplicateObject;
public event EditObjectByIDsHandler OnEditObjectByIDs;
public event EditObjectHandler OnEditObject;
+ public event EditObjectPermsHandler OnEditObjectPerms;
public event EditObjectInventoryHandler OnEditObjectInventory;
public event MoveObjectHandler OnMoveObject;
public event ObjectEntryHandler OnObjectEntry;
@@ -511,6 +513,24 @@ namespace OpenSim.Region.Framework.Scenes
return true;
}
+ public bool CanEditObjectPermissions(SceneObjectGroup sog, UUID editorID)
+ {
+ EditObjectPermsHandler handler = OnEditObjectPerms;
+ if (handler != null)
+ {
+ if(sog == null)
+ return false;
+ Delegate[] list = handler.GetInvocationList();
+ foreach (EditObjectPermsHandler h in list)
+ {
+ if (h(sog, editorID) == false)
+ return false;
+ }
+ }
+ return true;
+ }
+
+
public bool CanEditObjectInventory(UUID objectID, UUID editorID)
{
EditObjectInventoryHandler handler = OnEditObjectInventory;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index f948336..d980fe5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4460,8 +4460,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
if (god)
baseMask = 0x7ffffff0;
- // Are we the owner?
- if ((AgentID == OwnerID) || god)
+ bool canChange = (AgentID == OwnerID) || god;
+ if(!canChange)
+ canChange = ParentGroup.Scene.Permissions.CanEditObjectPermissions(ParentGroup, AgentID);
+
+ if (canChange)
{
switch (field)
{
--
cgit v1.1
From 3a8dd24fd1c1aead0a81a4a9d63b59bbf9f10855 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 4 May 2017 11:37:13 +0100
Subject: move deep effective permissions aggregation to first time use and
not on changes. There flag it is need with InvalidateDeepEffectivePerms().
Add config options PropagateGroupShareOutwards and PropagateAnyOneOutwards
---
.../InventoryAccess/InventoryAccessModule.cs | 2 +-
OpenSim/Region/Framework/Scenes/Scene.cs | 18 +++-
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +-
.../Framework/Scenes/SceneObjectGroup.Inventory.cs | 98 +++++-----------------
.../Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
.../Framework/Scenes/SceneObjectPartInventory.cs | 2 +-
.../Scenes/Serialization/SceneObjectSerializer.cs | 4 +-
.../Scenes/Serialization/SceneXmlLoader.cs | 2 +-
OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 +
9 files changed, 48 insertions(+), 84 deletions(-)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index f1885da..3f3245c 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -1182,7 +1182,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
rootPart.TrimPermissions();
- so.AggregateDeepPerms();
+ so.InvalidateDeepEffectivePerms();
if (isAttachment)
so.FromItemID = item.ID;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 715ae5c..205a321 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -239,6 +239,16 @@ namespace OpenSim.Region.Framework.Scenes
public bool LegacySitOffsets = true;
///
+ /// set false to not propagare group rights outwards as legacy did
+ ///
+ public bool PropagateGroupShareOutwards = true;
+
+ ///
+ /// set false to not propagare Everyone rights outwards as legacy did
+ ///
+ public bool PropagateAnyOneOutwards = true;
+
+ ///
/// Can avatars cross from and to this region?
///
public bool AllowAvatarCrossing { get; set; }
@@ -978,7 +988,10 @@ namespace OpenSim.Region.Framework.Scenes
m_maxDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance);
m_maxRegionViewDistance = startupConfig.GetFloat("MaxRegionsViewDistance", m_maxRegionViewDistance);
+ // old versions compatibility
LegacySitOffsets = startupConfig.GetBoolean("LegacySitOffsets", LegacySitOffsets);
+ PropagateGroupShareOutwards = startupConfig.GetBoolean("PropagateGroupShareOutwards", PropagateGroupShareOutwards);
+ PropagateAnyOneOutwards = startupConfig.GetBoolean("PropagateAnyOneOutwards", PropagateAnyOneOutwards);
if (m_defaultDrawDistance > m_maxDrawDistance)
m_defaultDrawDistance = m_maxDrawDistance;
@@ -2390,8 +2403,9 @@ namespace OpenSim.Region.Framework.Scenes
EventManager.TriggerOnSceneObjectLoaded(group);
SceneObjectPart rootPart = group.GetPart(group.UUID);
rootPart.Flags &= ~PrimFlags.Scripted;
- group.AggregateDeepPerms();
+
rootPart.TrimPermissions();
+ group.InvalidateDeepEffectivePerms();
// Don't do this here - it will get done later on when sculpt data is loaded.
// group.CheckSculptAndLoad();
@@ -2662,7 +2676,7 @@ namespace OpenSim.Region.Framework.Scenes
if (UserManagementModule != null)
sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
- sceneObject.AggregateDeepPerms();
+ sceneObject.InvalidateDeepEffectivePerms();;
sceneObject.ScheduleGroupForFullUpdate();
return sceneObject;
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index a005068..91d2879 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -343,7 +343,7 @@ namespace OpenSim.Region.Framework.Scenes
sceneObject.ForceInventoryPersistence();
sceneObject.HasGroupChanged = true;
}
- sceneObject.AggregateDeepPerms();
+ sceneObject.InvalidateDeepEffectivePerms();
return ret;
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 36844a9..95a5887 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -254,13 +254,26 @@ namespace OpenSim.Region.Framework.Scenes
// new test code, to place in better place later
private object m_PermissionsLock = new object();
private bool m_EffectivePermsInvalid = true;
+ private bool m_DeepEffectivePermsInvalid = true;
+ // should called when parts chanced by their contents did not, so we know their cacche is valid
+ // in case of doubt call InvalidateDeepEffectivePerms(), it only costs a bit more cpu time
public void InvalidateEffectivePerms()
{
lock(m_PermissionsLock)
m_EffectivePermsInvalid = true;
}
+ // should called when parts chanced and their contents where accounted for
+ public void InvalidateDeepEffectivePerms()
+ {
+ lock(m_PermissionsLock)
+ {
+ m_DeepEffectivePermsInvalid = true;
+ m_EffectivePermsInvalid = true;
+ }
+ }
+
private uint m_EffectiveEveryOnePerms;
public uint EffectiveEveryOnePerms
{
@@ -317,79 +330,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- // aggregates perms scanning parts and their contents
- // AggregatePerms does same using cached parts content perms
- public void AggregateDeepPerms()
- {
- lock(m_PermissionsLock)
- {
- // aux
- const uint allmask = (uint)PermissionMask.AllEffective;
- const uint movemodmask = (uint)(PermissionMask.Move | PermissionMask.Modify);
- const uint copytransfermask = (uint)(PermissionMask.Copy | PermissionMask.Transfer);
-
- uint basePerms = (RootPart.BaseMask & allmask) | (uint)PermissionMask.Move;
- bool noBaseTransfer = (basePerms & (uint)PermissionMask.Transfer) == 0;
-
- uint rootOwnerPerms = RootPart.OwnerMask;
- uint owner = rootOwnerPerms;
- uint rootGroupPerms = RootPart.GroupMask;
- uint group = rootGroupPerms;
- uint rootEveryonePerms = RootPart.EveryoneMask;
- uint everyone = rootEveryonePerms;
-
- // date is time of writing april 30th 2017
- bool newObject = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- {
- SceneObjectPart part = parts[i];
- part.AggregateInnerPerms();
- owner &= part.AggregatedInnerOwnerPerms;
- group &= part.AggregatedInnerGroupPerms;
- if(newObject)
- everyone &= part.AggregatedInnerEveryonePerms;
- }
- // recover modify and move
- rootOwnerPerms &= movemodmask;
- owner |= rootOwnerPerms;
- if((owner & copytransfermask) == 0)
- owner |= (uint)PermissionMask.Transfer;
-
- owner &= basePerms;
- m_EffectiveOwnerPerms = owner;
- uint ownertransfermask = owner & (uint)PermissionMask.Transfer;
-
- // recover modify and move
- rootGroupPerms &= movemodmask;
- group |= rootGroupPerms;
- if(noBaseTransfer)
- group &=~(uint)PermissionMask.Copy;
- else
- group |= ownertransfermask;
-
- uint groupOrEveryone = group;
- m_EffectiveGroupPerms = group & owner;
-
- // recover move
- rootEveryonePerms &= (uint)PermissionMask.Move;
- everyone |= rootEveryonePerms;
- everyone &= ~(uint)PermissionMask.Modify;
- if(noBaseTransfer)
- everyone &=~(uint)PermissionMask.Copy;
- else
- everyone |= ownertransfermask;
-
- groupOrEveryone |= everyone;
-
- m_EffectiveEveryOnePerms = everyone & owner;
- m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner;
- m_EffectivePermsInvalid = false;
- }
- }
-
- // aggregates perms scanning parts, assuming their contents was already aggregated and cached
- // ie is AggregateDeepPerms without the part.AggregateInnerPerms() call on parts loop
public void AggregatePerms()
{
lock(m_PermissionsLock)
@@ -410,15 +350,22 @@ namespace OpenSim.Region.Framework.Scenes
uint everyone = rootEveryonePerms;
bool needUpdate = false;
+ bool propGroupOut = Scene.PropagateGroupShareOutwards;
// date is time of writing april 30th 2017
- bool newObject = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
+ bool propAnyOut = Scene.PropagateAnyOneOutwards & (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
+
+ if(m_DeepEffectivePermsInvalid)
+ part.AggregateInnerPerms();
+
owner &= part.AggregatedInnerOwnerPerms;
group &= part.AggregatedInnerGroupPerms;
- if(newObject)
+ if(propGroupOut)
+ group &= part.AggregatedInnerGroupPerms;
+ if(propAnyOut)
everyone &= part.AggregatedInnerEveryonePerms;
}
// recover modify and move
@@ -477,6 +424,7 @@ namespace OpenSim.Region.Framework.Scenes
m_EffectiveGroupOrEveryOnePerms = tmpPerms;
}
+ m_DeepEffectivePermsInvalid = false;
m_EffectivePermsInvalid = false;
if(needUpdate)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e73795e..512656b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2677,7 +2677,7 @@ namespace OpenSim.Region.Framework.Scenes
if (dupe.m_rootPart.PhysActor != null)
dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building
- dupe.AggregateDeepPerms();
+ dupe.InvalidateDeepEffectivePerms();
dupe.HasGroupChanged = true;
dupe.AttachToBackup();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 4df1f27..21bc19e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -979,7 +979,7 @@ namespace OpenSim.Region.Framework.Scenes
}
// old code end
rootPart.TrimPermissions();
- group.AggregateDeepPerms();
+ group.InvalidateDeepEffectivePerms();
}
return true;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 87d1ace..892403b 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
// Script state may, or may not, exist. Not having any, is NOT
// ever a problem.
sceneObject.LoadScriptState(reader);
- sceneObject.AggregateDeepPerms();
+ sceneObject.InvalidateDeepEffectivePerms();
return sceneObject;
}
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
// Script state may, or may not, exist. Not having any, is NOT
// ever a problem.
sceneObject.LoadScriptState(doc);
- sceneObject.AggregatePerms();
+// sceneObject.AggregatePerms();
return sceneObject;
}
catch (Exception e)
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
index 0f022dd..34fdb6d 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
//obj.RegenerateFullIDs();
scene.AddNewSceneObject(obj, true);
- obj.AggregateDeepPerms();
+ obj.InvalidateDeepEffectivePerms();
}
}
else
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index fbd7e90..7902fb1 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -626,6 +626,7 @@ namespace OpenSim.Tests.Common
//part.ObjectFlags |= (uint)PrimFlags.Phantom;
scene.AddNewSceneObject(so, true);
+ so.InvalidateDeepEffectivePerms();
return so;
}
@@ -652,6 +653,7 @@ namespace OpenSim.Tests.Common
SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail);
scene.AddNewSceneObject(so, false);
+ so.InvalidateDeepEffectivePerms();
return so;
}
--
cgit v1.1
From 34028198882be021c49725c342e8d2d494dc7286 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 4 May 2017 12:08:10 +0100
Subject: do the same in the cases we are just moving parts around and not
changing their caches (ie their taskInventory)
---
OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs | 2 +-
.../Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | 2 +-
.../Region/CoreModules/World/Vegetation/VegetationModule.cs | 2 +-
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 10 +++++-----
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +-
OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | 2 +-
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 +++++-----
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 6 ++----
.../Avatar/Attachments/TempAttachmentsModule.cs | 2 +-
.../Scripting/JsonStore/JsonStoreScriptModule.cs | 2 +-
.../OptionalModules/World/TreePopulator/TreePopulatorModule.cs | 2 +-
.../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +-
12 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
index 69fcb7d..b044e56 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
@@ -357,7 +357,7 @@ namespace OpenSim.Region.ClientStack.Linden
rootpart.NextOwnerMask = next_owner_mask;
rootpart.Material = (byte)material;
- obj.AggregatePerms();
+ obj.InvalidateDeepEffectivePerms();
m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index a7a9d1d..6a8f4c0 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions();
}
- group.AggregatePerms();
+ group.InvalidateDeepEffectivePerms();
}
part.ObjectSaleType = 0;
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
index 167f6b5..4cee7a5 100644
--- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
+++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.World.Vegetation
sceneObject.SetGroup(groupID, null);
m_scene.AddNewSceneObject(sceneObject, true);
- sceneObject.AggregatePerms();
+ sceneObject.InvalidateDeepEffectivePerms();
return sceneObject;
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index d55311e..bba7a96 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -338,7 +338,7 @@ namespace OpenSim.Region.Framework.Scenes
// Update item with new asset
item.AssetID = asset.FullID;
group.UpdateInventoryItem(item);
- group.AggregatePerms();
+ group.InvalidateEffectivePerms();
part.SendPropertiesToClient(remoteClient);
@@ -1216,7 +1216,7 @@ namespace OpenSim.Region.Framework.Scenes
}
group.RemoveInventoryItem(localID, itemID);
- group.AggregatePerms();
+ group.InvalidateEffectivePerms();
}
part.SendPropertiesToClient(remoteClient);
@@ -1967,7 +1967,7 @@ namespace OpenSim.Region.Framework.Scenes
part.Inventory.AddInventoryItem(taskItem, false);
part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
- part.ParentGroup.AggregatePerms();
+ part.ParentGroup.InvalidateEffectivePerms();
// tell anyone managing scripts that a new script exists
EventManager.TriggerNewScript(agentID, part, taskItem.ItemID);
@@ -2655,7 +2655,7 @@ namespace OpenSim.Region.Framework.Scenes
// We can only call this after adding the scene object, since the scene object references the scene
// to find out if scripts should be activated at all.
- group.AggregatePerms();
+ group.InvalidateEffectivePerms();
group.CreateScriptInstances(param, true, DefaultScriptEngine, 3);
group.ScheduleGroupForFullUpdate();
@@ -2752,7 +2752,7 @@ namespace OpenSim.Region.Framework.Scenes
// and with this comented code, if user does not set next permissions on the object
// and on ALL contents of ALL prims, he may loose rights, making the object useless
sog.ApplyNextOwnerPermissions();
- sog.AggregatePerms();
+ sog.InvalidateEffectivePerms();
sog.ScheduleGroupForFullUpdate();
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 91d2879..117d92d 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -2094,7 +2094,7 @@ namespace OpenSim.Region.Framework.Scenes
child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions();
}
- copy.AggregatePerms();
+ copy.InvalidateEffectivePerms();
}
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 95a5887..6bb92f4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Framework.Scenes
addFromAllowedDrop = (part.ParentGroup.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0;
part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop);
- part.ParentGroup.AggregatePerms();
+ part.ParentGroup.InvalidateEffectivePerms();
return true;
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 512656b..93c9b42 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2943,7 +2943,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!m_scene.Permissions.BypassPermissions())
{
ApplyNextOwnerPermissions();
- AggregatePerms();
+ InvalidateEffectivePerms();
}
}
@@ -3605,7 +3605,7 @@ namespace OpenSim.Region.Framework.Scenes
InvalidBoundsRadius();
InvalidatePartsLinkMaps();
- objectGroup.AggregatePerms();
+ objectGroup.InvalidateEffectivePerms();
if (sendEvents)
linkPart.TriggerScriptChangedEvent(Changed.LINK);
@@ -4163,7 +4163,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}",
// (OpenMetaverse.PermissionMask)RootPart.OwnerMask, Name, Scene.Name);
- AggregatePerms();
+ InvalidateEffectivePerms();
RootPart.ScheduleFullUpdate();
}
@@ -4188,7 +4188,7 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (SceneObjectPart part in Parts)
part.Inventory.ApplyGodPermissions(RootPart.BaseMask);
- AggregatePerms();
+ InvalidateEffectivePerms();
}
HasGroupChanged = true;
@@ -5447,7 +5447,7 @@ namespace OpenSim.Region.Framework.Scenes
{
part.ResetOwnerChangeFlag();
});
- AggregatePerms();
+ InvalidateEffectivePerms();
}
// clear some references to easy cg
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 21bc19e..23da90a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1031,8 +1031,7 @@ namespace OpenSim.Region.Framework.Scenes
if (considerChanged)
{
- m_part.AggregateInnerPerms();
- m_part.ParentGroup.AggregatePerms();
+ m_part.ParentGroup.InvalidateDeepEffectivePerms();
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
}
@@ -1075,8 +1074,7 @@ namespace OpenSim.Region.Framework.Scenes
m_items.Remove(itemID);
m_items.LockItemsForWrite(false);
- m_part.AggregateInnerPerms();
- m_part.ParentGroup.AggregatePerms();
+ m_part.ParentGroup.InvalidateDeepEffectivePerms();
m_inventorySerial++;
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
index 92b5831..c3f3851 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
@@ -174,7 +174,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions();
}
- hostgroup.AggregatePerms();
+ hostgroup.InvalidateEffectivePerms();
}
hostgroup.RootPart.ObjectSaleType = 0;
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
index 6cf0092..fe8d962 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
@@ -665,7 +665,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
taskItem.AssetID = asset.FullID;
host.Inventory.AddInventoryItem(taskItem, false);
- host.ParentGroup.AggregatePerms();
+ host.ParentGroup.InvalidateEffectivePerms();
m_comms.DispatchReply(scriptID,1,assetID.ToString(),reqID.ToString());
}
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
index b26fa32..da8c9a3 100644
--- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
@@ -525,7 +525,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
sceneObject.SetGroup(groupID, null);
m_scene.AddNewSceneObject(sceneObject, true);
- sceneObject.AggregatePerms();
+ sceneObject.InvalidateEffectivePerms();
return sceneObject;
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index e12cedf..e51a078 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2048,7 +2048,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.Inventory.AddInventoryItemExclusive(taskItem, false);
else
m_host.Inventory.AddInventoryItem(taskItem, false);
- m_host.ParentGroup.AggregatePerms();
+ m_host.ParentGroup.InvalidateDeepEffectivePerms();
return taskItem;
}
--
cgit v1.1
From 04a50b47bfe2b10dfaad9fd67c2247ae40e97d84 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 4 May 2017 12:35:42 +0100
Subject: the new options i add where actually bad idea, they would make the
compatibility issue ethernal. Removed and extended the ugly date hack to
group share outwards propagation, until a better way is found at least
---
OpenSim/Region/Framework/Scenes/Scene.cs | 12 ------------
.../Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | 7 +++----
2 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 205a321..e709d6c 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -239,16 +239,6 @@ namespace OpenSim.Region.Framework.Scenes
public bool LegacySitOffsets = true;
///
- /// set false to not propagare group rights outwards as legacy did
- ///
- public bool PropagateGroupShareOutwards = true;
-
- ///
- /// set false to not propagare Everyone rights outwards as legacy did
- ///
- public bool PropagateAnyOneOutwards = true;
-
- ///
/// Can avatars cross from and to this region?
///
public bool AllowAvatarCrossing { get; set; }
@@ -990,8 +980,6 @@ namespace OpenSim.Region.Framework.Scenes
// old versions compatibility
LegacySitOffsets = startupConfig.GetBoolean("LegacySitOffsets", LegacySitOffsets);
- PropagateGroupShareOutwards = startupConfig.GetBoolean("PropagateGroupShareOutwards", PropagateGroupShareOutwards);
- PropagateAnyOneOutwards = startupConfig.GetBoolean("PropagateAnyOneOutwards", PropagateAnyOneOutwards);
if (m_defaultDrawDistance > m_maxDrawDistance)
m_defaultDrawDistance = m_maxDrawDistance;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 6bb92f4..f778367 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -350,9 +350,8 @@ namespace OpenSim.Region.Framework.Scenes
uint everyone = rootEveryonePerms;
bool needUpdate = false;
- bool propGroupOut = Scene.PropagateGroupShareOutwards;
// date is time of writing april 30th 2017
- bool propAnyOut = Scene.PropagateAnyOneOutwards & (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
+ bool newobj = (RootPart.CreationDate == 0 || RootPart.CreationDate > 1493574994);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
@@ -363,9 +362,9 @@ namespace OpenSim.Region.Framework.Scenes
owner &= part.AggregatedInnerOwnerPerms;
group &= part.AggregatedInnerGroupPerms;
- if(propGroupOut)
+ if(newobj)
group &= part.AggregatedInnerGroupPerms;
- if(propAnyOut)
+ if(newobj)
everyone &= part.AggregatedInnerEveryonePerms;
}
// recover modify and move
--
cgit v1.1
From 9e12ef92344d43356ae276ae3a03921e26986a38 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 5 May 2017 01:39:38 +0100
Subject: let all clients get a group title update on create group
---
OpenSim/Addons/Groups/GroupsModule.cs | 2 +-
.../Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs
index 0e3a172..5b76e0a 100644
--- a/OpenSim/Addons/Groups/GroupsModule.cs
+++ b/OpenSim/Addons/Groups/GroupsModule.cs
@@ -787,7 +787,7 @@ namespace OpenSim.Groups
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully");
// Update the founder with new group information.
- SendAgentGroupDataUpdate(remoteClient, false);
+ SendAgentGroupDataUpdate(remoteClient, true);
}
else
remoteClient.SendCreateGroupReply(groupID, false, reason);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index d52a1d5..a39b32e 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -901,7 +901,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully");
// Update the founder with new group information.
- SendAgentGroupDataUpdate(remoteClient, false);
+ SendAgentGroupDataUpdate(remoteClient, true);
return groupID;
}
@@ -1520,12 +1520,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
lastname, activeGroupPowers, activeGroupName,
activeGroupTitle);
- if (tellOthers)
- SendScenePresenceUpdate(agentID, activeGroupTitle);
-
ScenePresence sp = (ScenePresence)remoteClient.SceneAgent;
if (sp != null)
sp.Grouptitle = activeGroupTitle;
+
+ if (tellOthers)
+ SendScenePresenceUpdate(agentID, activeGroupTitle);
}
#endregion
--
cgit v1.1
From f31fe66ce16972d902bdde58785ab648d614077d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 5 May 2017 01:53:02 +0100
Subject: fix bad move on xmlgroups
---
OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index a39b32e..65d50bb 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -1520,12 +1520,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
lastname, activeGroupPowers, activeGroupName,
activeGroupTitle);
- ScenePresence sp = (ScenePresence)remoteClient.SceneAgent;
- if (sp != null)
- sp.Grouptitle = activeGroupTitle;
if (tellOthers)
SendScenePresenceUpdate(agentID, activeGroupTitle);
+
+ ScenePresence sp = (ScenePresence)remoteClient.SceneAgent;
+ if (sp != null)
+ sp.Grouptitle = activeGroupTitle;
}
#endregion
--
cgit v1.1
From ab4f87000067a6466d3b49b825b744fccceff47f Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 4 May 2017 18:19:46 -0700
Subject: Change the engine of the groups table back to MyISAM, because MySQL
5.5 and older don't support full test search on InnoDB
---
OpenSim/Data/MySQL/Resources/os_groups_Store.migrations | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations b/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations
index 1a49900..6ec8914 100644
--- a/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations
+++ b/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations
@@ -18,7 +18,7 @@ CREATE TABLE `os_groups_groups` (
PRIMARY KEY (`GroupID`),
UNIQUE KEY `Name` (`Name`),
FULLTEXT KEY `Name_2` (`Name`)
-) ENGINE=InnoDB;
+) ENGINE=MyISAM;
CREATE TABLE `os_groups_membership` (
--
cgit v1.1
From dd883194959e082b3489deaa9935291ba2c6e53a Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 4 May 2017 18:20:10 -0700
Subject: Add a groups module to the perms test suite
---
OpenSim/Tests/Permissions/Common.cs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/OpenSim/Tests/Permissions/Common.cs b/OpenSim/Tests/Permissions/Common.cs
index f93c120..4ecce38 100644
--- a/OpenSim/Tests/Permissions/Common.cs
+++ b/OpenSim/Tests/Permissions/Common.cs
@@ -72,12 +72,21 @@ namespace OpenSim.Tests.Permissions
IConfigSource config = new IniConfigSource();
config.AddConfig("Messaging");
config.Configs["Messaging"].Set("InventoryTransferModule", "InventoryTransferModule");
+
config.AddConfig("Modules");
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
+
config.AddConfig("InventoryService");
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService");
config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestXInventoryDataPlugin");
+ config.AddConfig("Groups");
+ config.Configs["Groups"].Set("Enabled", "true");
+ config.Configs["Groups"].Set("Module", "Groups Module V2");
+ config.Configs["Groups"].Set("StorageProvider", "OpenSim.Tests.Common.dll:TestGroupsDataPlugin");
+ config.Configs["Groups"].Set("ServicesConnectorModule", "Groups Local Service Connector");
+ config.Configs["Groups"].Set("LocalService", "local");
+
m_Scene = new SceneHelpers().SetupScene("Test", UUID.Random(), 1000, 1000, config);
// Add modules
SceneHelpers.SetupSceneModules(m_Scene, config, new DefaultPermissionsModule(), new InventoryTransferModule(), new BasicInventoryAccessModule());
--
cgit v1.1
From 3f641d98bd4c9fa1ce5b98c8d071f53596d06a7a Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 4 May 2017 20:17:54 -0700
Subject: Added a fully functional groups data layer for testing.
---
OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs | 339 ++++++++++++++++++++++
1 file changed, 339 insertions(+)
create mode 100644 OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs
diff --git a/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs
new file mode 100644
index 0000000..8e2d8e6
--- /dev/null
+++ b/OpenSim/Tests/Common/Mock/TestGroupsDataPlugin.cs
@@ -0,0 +1,339 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OpenMetaverse;
+using OpenSim.Data;
+
+namespace OpenSim.Tests.Common.Mock
+{
+ public class TestGroupsDataPlugin : IGroupsData
+ {
+ class CompositeKey
+ {
+ private readonly string _key;
+ public string Key
+ {
+ get { return _key; }
+ }
+
+ public CompositeKey(UUID _k1, string _k2)
+ {
+ _key = _k1.ToString() + _k2;
+ }
+
+ public CompositeKey(UUID _k1, string _k2, string _k3)
+ {
+ _key = _k1.ToString() + _k2 + _k3;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj is CompositeKey)
+ {
+ return Key == ((CompositeKey)obj).Key;
+ }
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ public override string ToString()
+ {
+ return Key;
+ }
+ }
+
+ private Dictionary m_Groups;
+ private Dictionary m_Membership;
+ private Dictionary m_Roles;
+ private Dictionary m_RoleMembership;
+ private Dictionary m_Invites;
+ private Dictionary m_Notices;
+ private Dictionary m_Principals;
+
+ public TestGroupsDataPlugin(string connectionString, string realm)
+ {
+ m_Groups = new Dictionary();
+ m_Membership = new Dictionary();
+ m_Roles = new Dictionary();
+ m_RoleMembership = new Dictionary();
+ m_Invites = new Dictionary();
+ m_Notices = new Dictionary();
+ m_Principals = new Dictionary();
+ }
+
+ #region groups table
+ public bool StoreGroup(GroupData data)
+ {
+ return false;
+ }
+
+ public GroupData RetrieveGroup(UUID groupID)
+ {
+ if (m_Groups.ContainsKey(groupID))
+ return m_Groups[groupID];
+
+ return null;
+ }
+
+ public GroupData RetrieveGroup(string name)
+ {
+ return m_Groups.Values.First(g => g.Data.ContainsKey("Name") && g.Data["Name"] == name);
+ }
+
+ public GroupData[] RetrieveGroups(string pattern)
+ {
+ if (string.IsNullOrEmpty(pattern))
+ pattern = "1";
+
+ IEnumerable groups = m_Groups.Values.Where(g => g.Data.ContainsKey("Name") && (g.Data["Name"].StartsWith(pattern) || g.Data["Name"].EndsWith(pattern)));
+
+ return (groups != null) ? groups.ToArray() : new GroupData[0];
+ }
+
+ public bool DeleteGroup(UUID groupID)
+ {
+ return m_Groups.Remove(groupID);
+ }
+
+ public int GroupsCount()
+ {
+ return m_Groups.Count;
+ }
+ #endregion
+
+ #region membership table
+ public MembershipData RetrieveMember(UUID groupID, string pricipalID)
+ {
+ CompositeKey dkey = new CompositeKey(groupID, pricipalID);
+ if (m_Membership.ContainsKey(dkey))
+ return m_Membership[dkey];
+
+ return null;
+ }
+
+ public MembershipData[] RetrieveMembers(UUID groupID)
+ {
+ IEnumerable keys = m_Membership.Keys.Where(k => k.Key.StartsWith(groupID.ToString()));
+ return keys.Where(m_Membership.ContainsKey).Select(x => m_Membership[x]).ToArray();
+ }
+
+ public MembershipData[] RetrieveMemberships(string principalID)
+ {
+ IEnumerable keys = m_Membership.Keys.Where(k => k.Key.EndsWith(principalID.ToString()));
+ return keys.Where(m_Membership.ContainsKey).Select(x => m_Membership[x]).ToArray();
+ }
+
+ public MembershipData[] RetrievePrincipalGroupMemberships(string principalID)
+ {
+ return RetrieveMemberships(principalID);
+ }
+
+ public MembershipData RetrievePrincipalGroupMembership(string principalID, UUID groupID)
+ {
+ CompositeKey dkey = new CompositeKey(groupID, principalID);
+ if (m_Membership.ContainsKey(dkey))
+ return m_Membership[dkey];
+ return null;
+ }
+
+ public bool StoreMember(MembershipData data)
+ {
+ CompositeKey dkey = new CompositeKey(data.GroupID, data.PrincipalID);
+ m_Membership[dkey] = data;
+ return true;
+ }
+
+ public bool DeleteMember(UUID groupID, string principalID)
+ {
+ CompositeKey dkey = new CompositeKey(groupID, principalID);
+ if (m_Membership.ContainsKey(dkey))
+ return m_Membership.Remove(dkey);
+
+ return false;
+ }
+
+ public int MemberCount(UUID groupID)
+ {
+ return m_Membership.Count;
+ }
+ #endregion
+
+ #region roles table
+ public bool StoreRole(RoleData data)
+ {
+ CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString());
+ m_Roles[dkey] = data;
+ return true;
+ }
+
+ public RoleData RetrieveRole(UUID groupID, UUID roleID)
+ {
+ CompositeKey dkey = new CompositeKey(groupID, roleID.ToString());
+ if (m_Roles.ContainsKey(dkey))
+ return m_Roles[dkey];
+
+ return null;
+ }
+
+ public RoleData[] RetrieveRoles(UUID groupID)
+ {
+ IEnumerable keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString()));
+ return keys.Where(m_Roles.ContainsKey).Select(x => m_Roles[x]).ToArray();
+ }
+
+ public bool DeleteRole(UUID groupID, UUID roleID)
+ {
+ CompositeKey dkey = new CompositeKey(groupID, roleID.ToString());
+ if (m_Roles.ContainsKey(dkey))
+ return m_Roles.Remove(dkey);
+
+ return false;
+ }
+
+ public int RoleCount(UUID groupID)
+ {
+ return m_Roles.Count;
+ }
+ #endregion
+
+ #region rolememberhip table
+ public RoleMembershipData[] RetrieveRolesMembers(UUID groupID)
+ {
+ IEnumerable keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString()));
+ return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray();
+ }
+
+ public RoleMembershipData[] RetrieveRoleMembers(UUID groupID, UUID roleID)
+ {
+ IEnumerable keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString() + roleID.ToString()));
+ return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray();
+ }
+
+ public RoleMembershipData[] RetrieveMemberRoles(UUID groupID, string principalID)
+ {
+ IEnumerable keys = m_Roles.Keys.Where(k => k.Key.StartsWith(groupID.ToString()) && k.Key.EndsWith(principalID));
+ return keys.Where(m_RoleMembership.ContainsKey).Select(x => m_RoleMembership[x]).ToArray();
+ }
+
+ public RoleMembershipData RetrieveRoleMember(UUID groupID, UUID roleID, string principalID)
+ {
+ CompositeKey dkey = new CompositeKey(groupID, roleID.ToString(), principalID);
+ if (m_RoleMembership.ContainsKey(dkey))
+ return m_RoleMembership[dkey];
+
+ return null;
+ }
+
+ public int RoleMemberCount(UUID groupID, UUID roleID)
+ {
+ return m_RoleMembership.Count;
+ }
+
+ public bool StoreRoleMember(RoleMembershipData data)
+ {
+ CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString(), data.PrincipalID);
+ m_RoleMembership[dkey] = data;
+ return true;
+ }
+
+ public bool DeleteRoleMember(RoleMembershipData data)
+ {
+ CompositeKey dkey = new CompositeKey(data.GroupID, data.RoleID.ToString(), data.PrincipalID);
+ if (m_RoleMembership.ContainsKey(dkey))
+ return m_RoleMembership.Remove(dkey);
+
+ return false;
+ }
+
+ public bool DeleteMemberAllRoles(UUID groupID, string principalID)
+ {
+ List keys = m_RoleMembership.Keys.Where(k => k.Key.StartsWith(groupID.ToString()) && k.Key.EndsWith(principalID)).ToList();
+ foreach (CompositeKey k in keys)
+ m_RoleMembership.Remove(k);
+ return true;
+ }
+ #endregion
+
+ #region principals table
+ public bool StorePrincipal(PrincipalData data)
+ {
+ m_Principals[data.PrincipalID] = data;
+ return true;
+ }
+
+ public PrincipalData RetrievePrincipal(string principalID)
+ {
+ if (m_Principals.ContainsKey(principalID))
+ return m_Principals[principalID];
+
+ return null;
+ }
+
+ public bool DeletePrincipal(string principalID)
+ {
+ if (m_Principals.ContainsKey(principalID))
+ return m_Principals.Remove(principalID);
+ return false;
+ }
+ #endregion
+
+ #region invites table
+ public bool StoreInvitation(InvitationData data)
+ {
+ return false;
+ }
+
+ public InvitationData RetrieveInvitation(UUID inviteID)
+ {
+ return null;
+ }
+
+ public InvitationData RetrieveInvitation(UUID groupID, string principalID)
+ {
+ return null;
+ }
+
+ public bool DeleteInvite(UUID inviteID)
+ {
+ return false;
+ }
+
+ public void DeleteOldInvites()
+ {
+ }
+ #endregion
+
+ #region notices table
+ public bool StoreNotice(NoticeData data)
+ {
+ return false;
+ }
+
+ public NoticeData RetrieveNotice(UUID noticeID)
+ {
+ return null;
+ }
+
+ public NoticeData[] RetrieveNotices(UUID groupID)
+ {
+ return new NoticeData[0];
+ }
+
+ public bool DeleteNotice(UUID noticeID)
+ {
+ return false;
+ }
+
+ public void DeleteOldNotices()
+ {
+ }
+ #endregion
+
+ }
+}
--
cgit v1.1
From 3bc64f638af9e28efda1d0b1ca9b0f0b45d88b0b Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 5 May 2017 17:44:33 +0100
Subject: add a few guard checks on serviceThrottlemodule
---
.../Framework/ServiceThrottle/ServiceThrottleModule.cs | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs b/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs
index 924a1a3..2c74c0e 100644
--- a/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/ServiceThrottle/ServiceThrottleModule.cs
@@ -119,7 +119,15 @@ namespace OpenSim.Region.CoreModules.Framework
if(!client.IsActive)
return;
- GridRegion r = m_scenes[0].GridService.GetRegionByUUID(UUID.Zero, regionID);
+ if(m_scenes.Count == 0)
+ return;
+
+ Scene baseScene = m_scenes[0];
+
+ if(baseScene == null || baseScene.ShuttingDown)
+ return;
+
+ GridRegion r = baseScene.GridService.GetRegionByUUID(UUID.Zero, regionID);
if(!client.IsActive)
return;
--
cgit v1.1
From 8e300168419d13b00bfaf76c5b6d9b9cb5313970 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 5 May 2017 22:24:05 +0100
Subject: revert to older CSJ2K.dll since new seems have issues on linux with
existent textures/sculpts
---
bin/CSJ2K.dll | Bin 483328 -> 502784 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/CSJ2K.dll b/bin/CSJ2K.dll
index e882e4c..238291f 100755
Binary files a/bin/CSJ2K.dll and b/bin/CSJ2K.dll differ
--
cgit v1.1
From d9038e650a8cbacc3463c6989b5af1e8429a1e8b Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 01:25:54 +0100
Subject: MySQLConnector is not a MS product
---
OpenSim/Data/MySQL/MySQLAssetData.cs | 7 ++++++
OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 2 ++
OpenSim/Data/MySQL/MySQLEstateData.cs | 11 +++++++---
OpenSim/Data/MySQL/MySQLFSAssetData.cs | 11 ++++++++--
OpenSim/Data/MySQL/MySQLFramework.cs | 9 ++++++--
OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | 12 +++++++----
OpenSim/Data/MySQL/MySQLInventoryData.cs | 15 +++++++++++++
OpenSim/Data/MySQL/MySQLRegionData.cs | 3 +++
OpenSim/Data/MySQL/MySQLSimulationData.cs | 30 +++++++++++++++++++++++++-
OpenSim/Data/MySQL/MySQLUserProfilesData.cs | 16 ++++++++++++++
OpenSim/Data/MySQL/MySQLXAssetData.cs | 7 +++++-
OpenSim/Data/MySQL/MySQLXInventoryData.cs | 1 -
12 files changed, 110 insertions(+), 14 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index f16cd91..27cc0ba 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -75,6 +75,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "AssetStore");
m.Update();
+ dbcon.Close();
}
}
@@ -144,6 +145,7 @@ namespace OpenSim.Data.MySQL
string.Format("[ASSETS DB]: MySql failure fetching asset {0}. Exception ", assetID), e);
}
}
+ dbcon.Close();
}
return asset;
@@ -209,6 +211,7 @@ namespace OpenSim.Data.MySQL
return false;
}
}
+ dbcon.Close();
}
}
@@ -238,6 +241,7 @@ namespace OpenSim.Data.MySQL
e);
}
}
+ dbcon.Close();
}
}
@@ -270,6 +274,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
bool[] results = new bool[uuids.Length];
@@ -334,6 +339,7 @@ namespace OpenSim.Data.MySQL
e);
}
}
+ dbcon.Close();
}
return retList;
@@ -350,6 +356,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?id", id);
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
return true;
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
index af6be75..5030c1d 100644
--- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
+++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
@@ -59,6 +59,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "AuthStore");
m.Update();
+ dbcon.Close();
}
}
@@ -99,6 +100,7 @@ namespace OpenSim.Data.MySQL
return null;
}
}
+ dbcon.Close();
}
}
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index a5c8d24..12593f6 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -171,12 +171,13 @@ namespace OpenSim.Data.MySQL
}
}
}
-
if (!found && create)
{
DoCreate(es);
LinkRegion(regionID, (int)es.EstateID);
}
+ cmd.Connection = null;
+ dbcon.Close();
}
LoadBanList(es);
@@ -231,6 +232,7 @@ namespace OpenSim.Data.MySQL
es.Save();
}
+ dbcon.Close();
}
}
@@ -263,6 +265,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
SaveBanList(es);
@@ -300,6 +303,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
@@ -329,6 +333,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
}
}
+ dbcon.Close();
}
}
@@ -358,6 +363,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
}
}
+ dbcon.Close();
}
}
@@ -383,6 +389,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
return uuids.ToArray();
@@ -437,7 +444,6 @@ namespace OpenSim.Data.MySQL
reader.Close();
}
}
-
dbcon.Close();
}
@@ -466,7 +472,6 @@ namespace OpenSim.Data.MySQL
reader.Close();
}
}
-
dbcon.Close();
}
diff --git a/OpenSim/Data/MySQL/MySQLFSAssetData.cs b/OpenSim/Data/MySQL/MySQLFSAssetData.cs
index 2837ce3..0918596 100644
--- a/OpenSim/Data/MySQL/MySQLFSAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLFSAssetData.cs
@@ -121,9 +121,13 @@ namespace OpenSim.Data.MySQL
}
catch (MySqlException e)
{
+ cmd.Connection = null;
+ conn.Close();
m_log.ErrorFormat("[FSASSETS]: Query {0} failed with {1}", cmd.CommandText, e.ToString());
return false;
}
+ cmd.Connection = null;
+ conn.Close();
}
return true;
@@ -175,7 +179,7 @@ namespace OpenSim.Data.MySQL
UpdateAccessTime(id, AccessTime);
}
}
-
+ conn.Close();
}
return meta;
@@ -206,6 +210,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?id", AssetID);
cmd.ExecuteNonQuery();
}
+ conn.Close();
}
}
@@ -299,6 +304,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ conn.Close();
}
for (int i = 0; i < uuids.Length; i++)
@@ -333,6 +339,7 @@ namespace OpenSim.Data.MySQL
count = Convert.ToInt32(reader["count"]);
}
}
+ conn.Close();
}
return count;
@@ -413,8 +420,8 @@ namespace OpenSim.Data.MySQL
imported++;
}
}
-
}
+ importConn.Close();
}
MainConsole.Instance.Output(String.Format("Import done, {0} assets imported", imported));
diff --git a/OpenSim/Data/MySQL/MySQLFramework.cs b/OpenSim/Data/MySQL/MySQLFramework.cs
index 93662db..98106f0 100644
--- a/OpenSim/Data/MySQL/MySQLFramework.cs
+++ b/OpenSim/Data/MySQL/MySQLFramework.cs
@@ -74,7 +74,9 @@ namespace OpenSim.Data.MySQL
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
- return ExecuteNonQueryWithConnection(cmd, dbcon);
+ int ret = ExecuteNonQueryWithConnection(cmd, dbcon);
+ dbcon.Close();
+ return ret;
}
}
else
@@ -97,12 +99,15 @@ namespace OpenSim.Data.MySQL
try
{
- return cmd.ExecuteNonQuery();
+ int ret = cmd.ExecuteNonQuery();
+ cmd.Connection = null;
+ return ret;
}
catch (Exception e)
{
m_log.Error(e.Message, e);
m_log.Error(Environment.StackTrace.ToString());
+ cmd.Connection = null;
return 0;
}
}
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index bd8bbd5..9bd3c0c 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -160,8 +160,9 @@ namespace OpenSim.Data.MySQL
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
-
- return DoQueryWithConnection(cmd, dbcon);
+ T[] ret = DoQueryWithConnection(cmd, dbcon);
+ dbcon.Close();
+ return ret;
}
}
else
@@ -243,7 +244,7 @@ namespace OpenSim.Data.MySQL
result.Add(row);
}
}
-
+ cmd.Connection = null;
return result.ToArray();
}
@@ -402,7 +403,10 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
cmd.Connection = dbcon;
- return cmd.ExecuteScalar();
+ Object ret = cmd.ExecuteScalar();
+ cmd.Connection = null;
+ dbcon.Close();
+ return ret;
}
}
else
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index 382d4a5..3216544 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -78,6 +78,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, assem, "InventoryStore");
m.Update();
+ dbcon.Close();
}
}
@@ -133,6 +134,7 @@ namespace OpenSim.Data.MySQL
return items;
}
}
+ dbcon.Close();
}
}
}
@@ -173,6 +175,7 @@ namespace OpenSim.Data.MySQL
return items;
}
}
+ dbcon.Close();
}
}
}
@@ -224,6 +227,7 @@ namespace OpenSim.Data.MySQL
return rootFolder;
}
}
+ dbcon.Close();
}
}
}
@@ -264,6 +268,7 @@ namespace OpenSim.Data.MySQL
return items;
}
}
+ dbcon.Close();
}
}
}
@@ -355,6 +360,7 @@ namespace OpenSim.Data.MySQL
return item;
}
}
+ dbcon.Close();
}
}
}
@@ -420,6 +426,7 @@ namespace OpenSim.Data.MySQL
return folder;
}
}
+ dbcon.Close();
}
}
}
@@ -497,6 +504,8 @@ namespace OpenSim.Data.MySQL
result.Dispose();
}
+ dbcon.Close();
+
using (MySqlCommand result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", dbcon))
{
result.Parameters.AddWithValue("?folderID", item.Folder.ToString());
@@ -540,6 +549,7 @@ namespace OpenSim.Data.MySQL
lock (m_dbLock)
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (MySqlException e)
@@ -600,6 +610,7 @@ namespace OpenSim.Data.MySQL
m_log.Error(e.ToString());
}
}
+ dbcon.Close();
}
}
@@ -643,6 +654,7 @@ namespace OpenSim.Data.MySQL
m_log.Error(e.ToString());
}
}
+ dbcon.Close();
}
}
@@ -806,6 +818,7 @@ namespace OpenSim.Data.MySQL
lock (m_dbLock)
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (MySqlException e)
@@ -833,6 +846,7 @@ namespace OpenSim.Data.MySQL
lock (m_dbLock)
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (MySqlException e)
@@ -889,6 +903,7 @@ namespace OpenSim.Data.MySQL
return list;
}
}
+ dbcon.Close();
}
}
catch (Exception e)
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 0e55285..46df421 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -60,6 +60,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "GridStore");
m.Update();
+ dbcon.Close();
}
}
@@ -260,6 +261,8 @@ namespace OpenSim.Data.MySQL
retList.Add(ret);
}
}
+ cmd.Connection = null;
+ dbcon.Close();
}
return retList;
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 5740b91..8d1a4a5 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -88,6 +88,7 @@ namespace OpenSim.Data.MySQL
//
Migration m = new Migration(dbcon, Assembly, "RegionStore");
m.Update();
+ dbcon.Close();
}
}
@@ -334,6 +335,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
}
@@ -372,6 +374,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
}
@@ -411,6 +414,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
}
@@ -460,6 +464,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
@@ -535,6 +540,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
@@ -580,6 +586,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
prim.Inventory.RestoreInventoryItems(inventory);
@@ -634,6 +641,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
});
@@ -681,6 +689,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
});
@@ -727,6 +736,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
@@ -762,6 +772,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
@@ -783,6 +794,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
}
@@ -842,6 +854,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
}
}
+ dbcon.Close();
}
}
}
@@ -939,6 +952,7 @@ namespace OpenSim.Data.MySQL
nWP.valid = true;
}
}
+ dbcon.Close();
}
return nWP;
@@ -976,6 +990,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
@@ -1084,6 +1099,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
@@ -1099,6 +1115,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?regionID", regionID.ToString());
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
@@ -1127,6 +1144,7 @@ namespace OpenSim.Data.MySQL
return Convert.ToString(result["llsd_settings"]);
}
}
+ dbcon.Close();
}
}
@@ -1145,6 +1163,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
@@ -1160,6 +1179,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
#endregion
@@ -1212,7 +1232,7 @@ namespace OpenSim.Data.MySQL
FillRegionSettingsCommand(cmd, rs);
ExecuteNonQuery(cmd);
}
-
+ dbcon.Close();
SaveSpawnPoints(rs);
}
}
@@ -1259,6 +1279,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
@@ -2123,6 +2144,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
}
+ dbcon.Close();
}
}
}
@@ -2152,6 +2174,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
@@ -2187,6 +2210,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
}
@@ -2221,6 +2245,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
}
}
+ dbcon.Close();
}
}
}
@@ -2240,6 +2265,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
@@ -2257,6 +2283,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
@@ -2280,6 +2307,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
return ret;
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
index 8af2a3e..dfc3711 100644
--- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
@@ -69,6 +69,7 @@ namespace OpenSim.Data.MySQL
Migration m = new Migration(dbcon, Assembly, "UserProfiles");
m.Update();
+ dbcon.Close();
}
}
#endregion Member Functions
@@ -121,6 +122,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
return data;
}
@@ -228,6 +230,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -258,6 +261,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?recordId", recordId.ToString());
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -352,6 +356,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -474,6 +479,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -504,6 +510,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -548,6 +555,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -596,6 +604,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -719,6 +728,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -759,6 +769,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -884,6 +895,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -939,6 +951,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -975,6 +988,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -1035,6 +1049,7 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
}
}
catch (Exception e)
@@ -1072,6 +1087,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (Exception e)
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs
index 2c6acde..2ef7f8f 100644
--- a/OpenSim/Data/MySQL/MySQLXAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs
@@ -97,6 +97,7 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "XAssetStore");
m.Update();
+ dbcon.Close();
}
}
@@ -184,6 +185,7 @@ namespace OpenSim.Data.MySQL
m_log.Error(string.Format("[MYSQL XASSET DATA]: Failure fetching asset {0}", assetID), e);
}
}
+ dbcon.Close();
}
return asset;
@@ -303,6 +305,7 @@ namespace OpenSim.Data.MySQL
transaction.Commit();
}
+ dbcon.Close();
}
}
@@ -344,6 +347,7 @@ namespace OpenSim.Data.MySQL
"[XASSET MYSQL DB]: Failure updating access_time for asset {0} with name {1}",
assetMetadata.ID, assetMetadata.Name);
}
+ dbcon.Close();
}
}
@@ -474,6 +478,7 @@ namespace OpenSim.Data.MySQL
m_log.Error("[XASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString());
}
}
+ dbcon.Close();
}
return retList;
@@ -492,9 +497,9 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?ID", id);
cmd.ExecuteNonQuery();
}
-
// TODO: How do we deal with data from deleted assets? Probably not easily reapable unless we
// keep a reference count (?)
+ dbcon.Close();
}
return true;
diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
index 4e41fec..5019994 100644
--- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
@@ -328,7 +328,6 @@ namespace OpenSim.Data.MySQL
{
return false;
}
- cmd.Dispose();
}
dbcon.Close();
--
cgit v1.1
From d26a9ed0b18384d38c6070f7a7efdc61bcc7e75e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 01:41:33 +0100
Subject: fix wrong placement
---
OpenSim/Data/MySQL/MySQLInventoryData.cs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index 3216544..c93af0b 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -504,8 +504,6 @@ namespace OpenSim.Data.MySQL
result.Dispose();
}
- dbcon.Close();
-
using (MySqlCommand result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", dbcon))
{
result.Parameters.AddWithValue("?folderID", item.Folder.ToString());
@@ -513,6 +511,7 @@ namespace OpenSim.Data.MySQL
lock (m_dbLock)
result.ExecuteNonQuery();
}
+ dbcon.Close();
}
}
catch (MySqlException e)
--
cgit v1.1
From 025bef4e07fa134fe93c56abe7a9e9b3006413e1 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 01:47:26 +0100
Subject: fix a few wrong placement ( this is a test by the way )
---
OpenSim/Data/MySQL/MySQLInventoryData.cs | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index c93af0b..cc787cc 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -131,10 +131,10 @@ namespace OpenSim.Data.MySQL
items.Add(item);
}
+ dbcon.Close();
return items;
}
}
- dbcon.Close();
}
}
}
@@ -172,10 +172,10 @@ namespace OpenSim.Data.MySQL
while (reader.Read())
items.Add(readInventoryFolder(reader));
+ dbcon.Close();
return items;
}
}
- dbcon.Close();
}
}
}
@@ -224,10 +224,10 @@ namespace OpenSim.Data.MySQL
if (items.Count > 0)
rootFolder = items[0];
+ dbcon.Close();
return rootFolder;
}
}
- dbcon.Close();
}
}
}
@@ -265,10 +265,10 @@ namespace OpenSim.Data.MySQL
while (reader.Read())
items.Add(readInventoryFolder(reader));
+ dbcon.Close();
return items;
}
}
- dbcon.Close();
}
}
}
@@ -357,10 +357,10 @@ namespace OpenSim.Data.MySQL
if (reader.Read())
item = readInventoryItem(reader);
+ dbcon.Close();
return item;
}
}
- dbcon.Close();
}
}
}
@@ -423,10 +423,10 @@ namespace OpenSim.Data.MySQL
if (reader.Read())
folder = readInventoryFolder(reader);
+ dbcon.Close();
return folder;
}
}
- dbcon.Close();
}
}
}
@@ -899,10 +899,10 @@ namespace OpenSim.Data.MySQL
if (item != null)
list.Add(item);
}
+ dbcon.Close();
return list;
}
}
- dbcon.Close();
}
}
catch (Exception e)
--
cgit v1.1
From ae191cd3042fec6b753b41b19907d236690a70cf Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 15:57:47 +0100
Subject: dispose some MemoryStreams
---
.../Capabilities/Handlers/GetTexture/GetTextureHandler.cs | 5 -----
.../Handlers/GetTexture/GetTextureRobustHandler.cs | 6 ------
.../CoreModules/Avatar/BakedTextures/XBakesModule.cs | 2 ++
OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs | 15 +++++++++------
4 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 062a842..e73cf9e 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -362,8 +362,6 @@ namespace OpenSim.Capabilities.Handlers
{
// Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data
- imgstream = new MemoryStream();
-
// Decode image to System.Drawing.Image
if (OpenJPEG.DecodeToImage(texture.Data, out managedImage, out image) && image != null)
{
@@ -404,10 +402,7 @@ namespace OpenSim.Capabilities.Handlers
if(managedImage != null)
managedImage.Clear();
if (imgstream != null)
- {
- imgstream.Close();
imgstream.Dispose();
- }
}
return data;
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs
index d5df7a2..c339ec5 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs
@@ -368,9 +368,6 @@ namespace OpenSim.Capabilities.Handlers
try
{
// Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data
-
- imgstream = new MemoryStream();
-
// Decode image to System.Drawing.Image
if (OpenJPEG.DecodeToImage(texture.Data, out managedImage, out image) && image != null)
{
@@ -412,10 +409,7 @@ namespace OpenSim.Capabilities.Handlers
managedImage.Clear();
if (imgstream != null)
- {
- imgstream.Close();
imgstream.Dispose();
- }
}
return data;
diff --git a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
index 27e84b0..cfa9581 100644
--- a/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/BakedTextures/XBakesModule.cs
@@ -216,6 +216,8 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
rc.Request(reqStream, m_Auth);
m_log.DebugFormat("[XBakes]: stored {0} textures for user {1}", numberWears, agentId);
}
+ if(reqStream != null)
+ reqStream.Dispose();
}, null, "XBakesModule.Store"
);
}
diff --git a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs
index f292b95..ffd8ef6 100644
--- a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs
@@ -215,13 +215,16 @@ namespace OpenSim.Server.Handlers.MapImage
private byte[] DocToBytes(XmlDocument doc)
{
- MemoryStream ms = new MemoryStream();
- XmlTextWriter xw = new XmlTextWriter(ms, null);
- xw.Formatting = Formatting.Indented;
- doc.WriteTo(xw);
- xw.Flush();
-
+ using(MemoryStream ms = new MemoryStream())
+ {
+ using(XmlTextWriter xw = new XmlTextWriter(ms,null))
+ {
+ xw.Formatting = Formatting.Indented;
+ doc.WriteTo(xw);
+ xw.Flush();
+ }
return ms.ToArray();
+ }
}
private System.Net.IPAddress GetCallerIP(IOSHttpRequest request)
--
cgit v1.1
From eb93855d84414be6c9e927c0da3be56ae6831573 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 17:47:43 +0100
Subject: dispose some MemoryStreams
---
OpenSim/Data/MySQL/MySQLXAssetData.cs | 14 ++++++++------
OpenSim/Data/PGSQL/PGSQLXAssetData.cs | 10 ++++++----
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs
index 2ef7f8f..23f6837 100644
--- a/OpenSim/Data/MySQL/MySQLXAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs
@@ -163,13 +163,15 @@ namespace OpenSim.Data.MySQL
if (m_enableCompression)
{
- using (GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), CompressionMode.Decompress))
+ using(GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data),
+ CompressionMode.Decompress))
{
- MemoryStream outputStream = new MemoryStream();
- WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
-// int compressedLength = asset.Data.Length;
- asset.Data = outputStream.ToArray();
-
+ using(MemoryStream outputStream = new MemoryStream())
+ {
+ WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
+// int compressedLength = asset.Data.Length;
+ asset.Data = outputStream.ToArray();
+ }
// m_log.DebugFormat(
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
diff --git a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
index 6e88489..000a446 100644
--- a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
@@ -173,13 +173,15 @@ namespace OpenSim.Data.PGSQL
if (m_enableCompression)
{
- using (GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), CompressionMode.Decompress))
+ using (GZipStream decompressionStream = new GZipStream( new MemoryStream(asset.Data),
+ CompressionMode.Decompress))
{
- MemoryStream outputStream = new MemoryStream();
- WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
+ using(MemoryStream outputStream = new MemoryStream())
+ {
+ WebUtil.CopyStream(decompressionStream,outputStream,int.MaxValue);
// int compressedLength = asset.Data.Length;
asset.Data = outputStream.ToArray();
-
+ }
// m_log.DebugFormat(
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
--
cgit v1.1
From 54eb6fc779c578e28ea4f5a17aebb956838ab14d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 18:25:07 +0100
Subject: GZipStream does have a CopyTo()
---
OpenSim/Data/MySQL/MySQLXAssetData.cs | 10 +++++-----
OpenSim/Data/PGSQL/PGSQLXAssetData.cs | 18 +++++++++---------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs
index 23f6837..e519a94 100644
--- a/OpenSim/Data/MySQL/MySQLXAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs
@@ -163,19 +163,19 @@ namespace OpenSim.Data.MySQL
if (m_enableCompression)
{
- using(GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data),
- CompressionMode.Decompress))
+ using(MemoryStream ms = new MemoryStream(asset.Data))
+ using(GZipStream decompressionStream = new GZipStream(ms, CompressionMode.Decompress))
{
using(MemoryStream outputStream = new MemoryStream())
{
- WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
+ decompressionStream.CopyTo(outputStream, int.MaxValue);
// int compressedLength = asset.Data.Length;
- asset.Data = outputStream.ToArray();
+ asset.Data = outputStream.ToArray();
}
// m_log.DebugFormat(
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
- }
+ }
}
UpdateAccessTime(asset.Metadata, (int)dbReader["AccessTime"]);
diff --git a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
index 000a446..1798d20 100644
--- a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
@@ -173,18 +173,18 @@ namespace OpenSim.Data.PGSQL
if (m_enableCompression)
{
- using (GZipStream decompressionStream = new GZipStream( new MemoryStream(asset.Data),
- CompressionMode.Decompress))
+ using(MemoryStream ms = new MemoryStream(asset.Data))
+ using(GZipStream decompressionStream = new GZipStream(ms, CompressionMode.Decompress))
{
using(MemoryStream outputStream = new MemoryStream())
{
- WebUtil.CopyStream(decompressionStream,outputStream,int.MaxValue);
- // int compressedLength = asset.Data.Length;
- asset.Data = outputStream.ToArray();
- }
- // m_log.DebugFormat(
- // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
- // asset.ID, asset.Name, asset.Data.Length, compressedLength);
+ decompressionStream.CopyTo(outputStream,int.MaxValue);
+ // int compressedLength = asset.Data.Length;
+ asset.Data = outputStream.ToArray();
+ }
+ // m_log.DebugFormat(
+ // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
+ // asset.ID, asset.Name, asset.Data.Length, compressedLength);
}
}
--
cgit v1.1
From 504736eb433d4f032c1930b70d9007934caef9c5 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 20:23:55 +0100
Subject: build const strings a compile time...
---
OpenSim/Data/MySQL/MySQLUserProfilesData.cs | 347 ++++++++++++----------------
1 file changed, 146 insertions(+), 201 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
index dfc3711..c98e017 100644
--- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Data.MySQL
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
{
- string query = "SELECT classifieduuid, name FROM classifieds WHERE creatoruuid = ?Id";
+ const string query = "SELECT classifieduuid, name FROM classifieds WHERE creatoruuid = ?Id";
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
{
@@ -129,52 +129,51 @@ namespace OpenSim.Data.MySQL
public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result)
{
- string query = string.Empty;
-
-
- query += "INSERT INTO classifieds (";
- query += "`classifieduuid`,";
- query += "`creatoruuid`,";
- query += "`creationdate`,";
- query += "`expirationdate`,";
- query += "`category`,";
- query += "`name`,";
- query += "`description`,";
- query += "`parceluuid`,";
- query += "`parentestate`,";
- query += "`snapshotuuid`,";
- query += "`simname`,";
- query += "`posglobal`,";
- query += "`parcelname`,";
- query += "`classifiedflags`,";
- query += "`priceforlisting`) ";
- query += "VALUES (";
- query += "?ClassifiedId,";
- query += "?CreatorId,";
- query += "?CreatedDate,";
- query += "?ExpirationDate,";
- query += "?Category,";
- query += "?Name,";
- query += "?Description,";
- query += "?ParcelId,";
- query += "?ParentEstate,";
- query += "?SnapshotId,";
- query += "?SimName,";
- query += "?GlobalPos,";
- query += "?ParcelName,";
- query += "?Flags,";
- query += "?ListingPrice ) ";
- query += "ON DUPLICATE KEY UPDATE ";
- query += "category=?Category, ";
- query += "expirationdate=?ExpirationDate, ";
- query += "name=?Name, ";
- query += "description=?Description, ";
- query += "parentestate=?ParentEstate, ";
- query += "posglobal=?GlobalPos, ";
- query += "parcelname=?ParcelName, ";
- query += "classifiedflags=?Flags, ";
- query += "priceforlisting=?ListingPrice, ";
- query += "snapshotuuid=?SnapshotId";
+ const string query =
+ "INSERT INTO classifieds ("
+ + "`classifieduuid`,"
+ + "`creatoruuid`,"
+ + "`creationdate`,"
+ + "`expirationdate`,"
+ + "`category`,"
+ + "`name`,"
+ + "`description`,"
+ + "`parceluuid`,"
+ + "`parentestate`,"
+ + "`snapshotuuid`,"
+ + "`simname`,"
+ + "`posglobal`,"
+ + "`parcelname`,"
+ + "`classifiedflags`,"
+ + "`priceforlisting`) "
+ + "VALUES ("
+ + "?ClassifiedId,"
+ + "?CreatorId,"
+ + "?CreatedDate,"
+ + "?ExpirationDate,"
+ + "?Category,"
+ + "?Name,"
+ + "?Description,"
+ + "?ParcelId,"
+ + "?ParentEstate,"
+ + "?SnapshotId,"
+ + "?SimName,"
+ + "?GlobalPos,"
+ + "?ParcelName,"
+ + "?Flags,"
+ + "?ListingPrice ) "
+ + "ON DUPLICATE KEY UPDATE "
+ + "category=?Category, "
+ + "expirationdate=?ExpirationDate, "
+ + "name=?Name, "
+ + "description=?Description, "
+ + "parentestate=?ParentEstate, "
+ + "posglobal=?GlobalPos, "
+ + "parcelname=?ParcelName, "
+ + "classifiedflags=?Flags, "
+ + "priceforlisting=?ListingPrice, "
+ + "snapshotuuid=?SnapshotId"
+ ;
if(string.IsNullOrEmpty(ad.ParcelName))
ad.ParcelName = "Unknown";
@@ -245,10 +244,7 @@ namespace OpenSim.Data.MySQL
public bool DeleteClassifiedRecord(UUID recordId)
{
- string query = string.Empty;
-
- query += "DELETE FROM classifieds WHERE ";
- query += "classifieduuid = ?recordId";
+ const string query = "DELETE FROM classifieds WHERE classifieduuid = ?recordId";
try
{
@@ -275,10 +271,8 @@ namespace OpenSim.Data.MySQL
public bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result)
{
- string query = string.Empty;
- query += "SELECT * FROM classifieds WHERE ";
- query += "classifieduuid = ?AdId";
+ const string query = "SELECT * FROM classifieds WHERE classifieduuid = ?AdId";
try
{
@@ -326,10 +320,8 @@ namespace OpenSim.Data.MySQL
#region Picks Queries
public OSDArray GetAvatarPicks(UUID avatarId)
{
- string query = string.Empty;
+ const string query = "SELECT `pickuuid`,`name` FROM userpicks WHERE creatoruuid = ?Id";
- query += "SELECT `pickuuid`,`name` FROM userpicks WHERE ";
- query += "creatoruuid = ?Id";
OSDArray data = new OSDArray();
try
@@ -369,12 +361,8 @@ namespace OpenSim.Data.MySQL
public UserProfilePick GetPickInfo(UUID avatarId, UUID pickId)
{
- string query = string.Empty;
UserProfilePick pick = new UserProfilePick();
-
- query += "SELECT * FROM userpicks WHERE ";
- query += "creatoruuid = ?CreatorId AND ";
- query += "pickuuid = ?PickId";
+ const string query = "SELECT * FROM userpicks WHERE creatoruuid = ?CreatorId AND pickuuid = ?PickId";
try
{
@@ -427,33 +415,33 @@ namespace OpenSim.Data.MySQL
public bool UpdatePicksRecord(UserProfilePick pick)
{
- string query = string.Empty;
-
- query += "INSERT INTO userpicks VALUES (";
- query += "?PickId,";
- query += "?CreatorId,";
- query += "?TopPick,";
- query += "?ParcelId,";
- query += "?Name,";
- query += "?Desc,";
- query += "?SnapshotId,";
- query += "?User,";
- query += "?Original,";
- query += "?SimName,";
- query += "?GlobalPos,";
- query += "?SortOrder,";
- query += "?Enabled,";
- query += "?Gatekeeper)";
- query += "ON DUPLICATE KEY UPDATE ";
- query += "parceluuid=?ParcelId,";
- query += "name=?Name,";
- query += "description=?Desc,";
- query += "user=?User,";
- query += "simname=?SimName,";
- query += "snapshotuuid=?SnapshotId,";
- query += "pickuuid=?PickId,";
- query += "posglobal=?GlobalPos,";
- query += "gatekeeper=?Gatekeeper";
+ const string query =
+ "INSERT INTO userpicks VALUES ("
+ + "?PickId,"
+ + "?CreatorId,"
+ + "?TopPick,"
+ + "?ParcelId,"
+ + "?Name,"
+ + "?Desc,"
+ + "?SnapshotId,"
+ + "?User,"
+ + "?Original,"
+ + "?SimName,"
+ + "?GlobalPos,"
+ + "?SortOrder,"
+ + "?Enabled,"
+ + "?Gatekeeper)"
+ + "ON DUPLICATE KEY UPDATE "
+ + "parceluuid=?ParcelId,"
+ + "name=?Name,"
+ + "description=?Desc,"
+ + "user=?User,"
+ + "simname=?SimName,"
+ + "snapshotuuid=?SnapshotId,"
+ + "pickuuid=?PickId,"
+ + "posglobal=?GlobalPos,"
+ + "gatekeeper=?Gatekeeper"
+ ;
try
{
@@ -493,10 +481,7 @@ namespace OpenSim.Data.MySQL
public bool DeletePicksRecord(UUID pickId)
{
- string query = string.Empty;
-
- query += "DELETE FROM userpicks WHERE ";
- query += "pickuuid = ?PickId";
+ string query = "DELETE FROM userpicks WHERE pickuuid = ?PickId";
try
{
@@ -526,11 +511,7 @@ namespace OpenSim.Data.MySQL
#region Avatar Notes Queries
public bool GetAvatarNotes(ref UserProfileNotes notes)
{ // WIP
- string query = string.Empty;
-
- query += "SELECT `notes` FROM usernotes WHERE ";
- query += "useruuid = ?Id AND ";
- query += "targetuuid = ?TargetId";
+ const string query = "SELECT `notes` FROM usernotes WHERE useruuid = ?Id AND targetuuid = ?TargetId";
try
{
@@ -568,26 +549,25 @@ namespace OpenSim.Data.MySQL
public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result)
{
- string query = string.Empty;
+ string query;
bool remove;
if(string.IsNullOrEmpty(note.Notes))
{
remove = true;
- query += "DELETE FROM usernotes WHERE ";
- query += "useruuid=?UserId AND ";
- query += "targetuuid=?TargetId";
+ query = "DELETE FROM usernotes WHERE useruuid=?UserId AND targetuuid=?TargetId";
}
else
{
remove = false;
- query += "INSERT INTO usernotes VALUES ( ";
- query += "?UserId,";
- query += "?TargetId,";
- query += "?Notes )";
- query += "ON DUPLICATE KEY ";
- query += "UPDATE ";
- query += "notes=?Notes";
+ query = "INSERT INTO usernotes VALUES ("
+ + "?UserId,"
+ + "?TargetId,"
+ + "?Notes )"
+ + "ON DUPLICATE KEY "
+ + "UPDATE "
+ + "notes=?Notes"
+ ;
}
try
@@ -621,10 +601,7 @@ namespace OpenSim.Data.MySQL
#region Avatar Properties
public bool GetAvatarProperties(ref UserProfileProperties props, ref string result)
{
- string query = string.Empty;
-
- query += "SELECT * FROM userprofile WHERE ";
- query += "useruuid = ?Id";
+ string query = "SELECT * FROM userprofile WHERE useruuid = ?Id";
try
{
@@ -673,35 +650,36 @@ namespace OpenSim.Data.MySQL
props.PublishProfile = false;
props.PublishMature = false;
- query = "INSERT INTO userprofile (";
- query += "useruuid, ";
- query += "profilePartner, ";
- query += "profileAllowPublish, ";
- query += "profileMaturePublish, ";
- query += "profileURL, ";
- query += "profileWantToMask, ";
- query += "profileWantToText, ";
- query += "profileSkillsMask, ";
- query += "profileSkillsText, ";
- query += "profileLanguages, ";
- query += "profileImage, ";
- query += "profileAboutText, ";
- query += "profileFirstImage, ";
- query += "profileFirstText) VALUES (";
- query += "?userId, ";
- query += "?profilePartner, ";
- query += "?profileAllowPublish, ";
- query += "?profileMaturePublish, ";
- query += "?profileURL, ";
- query += "?profileWantToMask, ";
- query += "?profileWantToText, ";
- query += "?profileSkillsMask, ";
- query += "?profileSkillsText, ";
- query += "?profileLanguages, ";
- query += "?profileImage, ";
- query += "?profileAboutText, ";
- query += "?profileFirstImage, ";
- query += "?profileFirstText)";
+ query = "INSERT INTO userprofile ("
+ + "useruuid, "
+ + "profilePartner, "
+ + "profileAllowPublish, "
+ + "profileMaturePublish, "
+ + "profileURL, "
+ + "profileWantToMask, "
+ + "profileWantToText, "
+ + "profileSkillsMask, "
+ + "profileSkillsText, "
+ + "profileLanguages, "
+ + "profileImage, "
+ + "profileAboutText, "
+ + "profileFirstImage, "
+ + "profileFirstText) VALUES ("
+ + "?userId, "
+ + "?profilePartner, "
+ + "?profileAllowPublish, "
+ + "?profileMaturePublish, "
+ + "?profileURL, "
+ + "?profileWantToMask, "
+ + "?profileWantToText, "
+ + "?profileSkillsMask, "
+ + "?profileSkillsText, "
+ + "?profileLanguages, "
+ + "?profileImage, "
+ + "?profileAboutText, "
+ + "?profileFirstImage, "
+ + "?profileFirstText)"
+ ;
dbcon.Close();
dbcon.Open();
@@ -743,15 +721,10 @@ namespace OpenSim.Data.MySQL
public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result)
{
- string query = string.Empty;
-
- query += "UPDATE userprofile SET ";
- query += "profileURL=?profileURL, ";
- query += "profileImage=?image, ";
- query += "profileAboutText=?abouttext,";
- query += "profileFirstImage=?firstlifeimage,";
- query += "profileFirstText=?firstlifetext ";
- query += "WHERE useruuid=?uuid";
+ const string query = "UPDATE userprofile SET profileURL=?profileURL,"
+ + "profileImage=?image, profileAboutText=?abouttext,"
+ + "profileFirstImage=?firstlifeimage, profileFirstText=?firstlifetext "
+ + "WHERE useruuid=?uuid";
try
{
@@ -786,15 +759,13 @@ namespace OpenSim.Data.MySQL
#region Avatar Interests
public bool UpdateAvatarInterests(UserProfileProperties up, ref string result)
{
- string query = string.Empty;
-
- query += "UPDATE userprofile SET ";
- query += "profileWantToMask=?WantMask, ";
- query += "profileWantToText=?WantText,";
- query += "profileSkillsMask=?SkillsMask,";
- query += "profileSkillsText=?SkillsText, ";
- query += "profileLanguages=?Languages ";
- query += "WHERE useruuid=?uuid";
+ const string query = "UPDATE userprofile SET "
+ + "profileWantToMask=?WantMask, "
+ + "profileWantToText=?WantText,"
+ + "profileSkillsMask=?SkillsMask,"
+ + "profileSkillsText=?SkillsText, "
+ + "profileLanguages=?Languages "
+ + "WHERE useruuid=?uuid";
try
{
@@ -828,18 +799,17 @@ namespace OpenSim.Data.MySQL
public OSDArray GetUserImageAssets(UUID avatarId)
{
OSDArray data = new OSDArray();
- string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = ?Id";
+ const string queryA = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = ?Id";
// Get classified image assets
-
try
{
using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
{
dbcon.Open();
- using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`classifieds`"), dbcon))
+ using (MySqlCommand cmd = new MySqlCommand(string.Format (queryA,"`classifieds`"), dbcon))
{
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
@@ -858,7 +828,7 @@ namespace OpenSim.Data.MySQL
dbcon.Close();
dbcon.Open();
- using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon))
+ using (MySqlCommand cmd = new MySqlCommand(string.Format (queryA,"`userpicks`"), dbcon))
{
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
@@ -877,9 +847,9 @@ namespace OpenSim.Data.MySQL
dbcon.Close();
dbcon.Open();
- query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = ?Id";
+ const string queryB = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = ?Id";
- using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon))
+ using (MySqlCommand cmd = new MySqlCommand(string.Format (queryB,"`userpicks`"), dbcon))
{
cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
@@ -909,11 +879,7 @@ namespace OpenSim.Data.MySQL
#region User Preferences
public bool GetUserPreferences(ref UserPreferences pref, ref string result)
{
- string query = string.Empty;
-
- query += "SELECT imviaemail,visible,email FROM ";
- query += "usersettings WHERE ";
- query += "useruuid = ?Id";
+ const string query = "SELECT imviaemail,visible,email FROM usersettings WHERE useruuid = ?Id";
try
{
@@ -937,10 +903,9 @@ namespace OpenSim.Data.MySQL
dbcon.Close();
dbcon.Open();
- query = "INSERT INTO usersettings VALUES ";
- query += "(?uuid,'false','false', ?Email)";
+ const string queryB = "INSERT INTO usersettings VALUES (?uuid,'false','false', ?Email)";
- using (MySqlCommand put = new MySqlCommand(query, dbcon))
+ using (MySqlCommand put = new MySqlCommand(queryB, dbcon))
{
put.Parameters.AddWithValue("?Email", pref.EMail);
@@ -966,13 +931,9 @@ namespace OpenSim.Data.MySQL
public bool UpdateUserPreferences(ref UserPreferences pref, ref string result)
{
- string query = string.Empty;
-
- query += "UPDATE usersettings SET ";
- query += "imviaemail=?ImViaEmail, ";
- query += "visible=?Visible, ";
- query += "email=?EMail ";
- query += "WHERE useruuid=?uuid";
+ const string query = "UPDATE usersettings SET imviaemail=?ImViaEmail,"
+ + "visible=?Visible, email=?EMail "
+ + "WHERE useruuid=?uuid";
try
{
@@ -1005,11 +966,7 @@ namespace OpenSim.Data.MySQL
#region Integration
public bool GetUserAppData(ref UserAppData props, ref string result)
{
- string query = string.Empty;
-
- query += "SELECT * FROM `userdata` WHERE ";
- query += "UserId = ?Id AND ";
- query += "TagId = ?TagId";
+ const string query = "SELECT * FROM `userdata` WHERE UserId = ?Id AND TagId = ?TagId";
try
{
@@ -1031,13 +988,8 @@ namespace OpenSim.Data.MySQL
}
else
{
- query += "INSERT INTO userdata VALUES ( ";
- query += "?UserId,";
- query += "?TagId,";
- query += "?DataKey,";
- query += "?DataVal) ";
-
- using (MySqlCommand put = new MySqlCommand(query, dbcon))
+ const string queryB = "INSERT INTO userdata VALUES (?UserId, ?TagId, ?DataKey, ?DataVal)";
+ using (MySqlCommand put = new MySqlCommand(queryB, dbcon))
{
put.Parameters.AddWithValue("?UserId", props.UserId.ToString());
put.Parameters.AddWithValue("?TagId", props.TagId.ToString());
@@ -1064,14 +1016,7 @@ namespace OpenSim.Data.MySQL
public bool SetUserAppData(UserAppData props, ref string result)
{
- string query = string.Empty;
-
- query += "UPDATE userdata SET ";
- query += "TagId = ?TagId, ";
- query += "DataKey = ?DataKey, ";
- query += "DataVal = ?DataVal WHERE ";
- query += "UserId = ?UserId AND ";
- query += "TagId = ?TagId";
+ const string query = "UPDATE userdata SET TagId = ?TagId, DataKey = ?DataKey, DataVal = ?DataVal WHERE UserId = ?UserId AND TagId = ?TagId";
try
{
--
cgit v1.1
From 76337b1d8e532173d37038539163cbda9a742281 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 20:38:38 +0100
Subject: another misplaced close
---
OpenSim/Data/MySQL/MySQLAssetData.cs | 42 ++++++++++++++++++------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index 27cc0ba..8569c90 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -158,28 +158,27 @@ namespace OpenSim.Data.MySQL
/// On failure : Throw an exception and attempt to reconnect to database
override public bool StoreAsset(AssetBase asset)
{
- using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
+ string assetName = asset.Name;
+ if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
{
- dbcon.Open();
-
- string assetName = asset.Name;
- if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
- {
- assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
- m_log.WarnFormat(
- "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
- asset.Name, asset.ID, asset.Name.Length, assetName.Length);
- }
+ assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
+ m_log.WarnFormat(
+ "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
+ asset.Name, asset.ID, asset.Name.Length, assetName.Length);
+ }
- string assetDescription = asset.Description;
- if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
- {
- assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
- m_log.WarnFormat(
- "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
- asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
- }
+ string assetDescription = asset.Description;
+ if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
+ {
+ assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
+ m_log.WarnFormat(
+ "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
+ asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
+ }
+ using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
+ {
+ dbcon.Open();
using (MySqlCommand cmd =
new MySqlCommand(
"replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, CreatorID, data)" +
@@ -202,16 +201,17 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
cmd.Parameters.AddWithValue("?data", asset.Data);
cmd.ExecuteNonQuery();
+ dbcon.Close();
return true;
}
catch (Exception e)
{
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
asset.FullID, asset.Name, e.Message);
+ dbcon.Close();
return false;
}
- }
- dbcon.Close();
+ }
}
}
--
cgit v1.1
From 4b2ef46de6dc49926f111d30d2a26b6bf8c19601 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 20:40:29 +0100
Subject: don't hold dbconn longer than necessart
---
OpenSim/Data/MySQL/MySQLXAssetData.cs | 52 +++++++++++++++++++++--------------
1 file changed, 31 insertions(+), 21 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs
index e519a94..9f9c9cf 100644
--- a/OpenSim/Data/MySQL/MySQLXAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs
@@ -131,6 +131,7 @@ namespace OpenSim.Data.MySQL
// m_log.DebugFormat("[MYSQL XASSET DATA]: Looking for asset {0}", assetID);
AssetBase asset = null;
+ int accessTime = 0;
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
@@ -141,7 +142,6 @@ namespace OpenSim.Data.MySQL
dbcon))
{
cmd.Parameters.AddWithValue("?ID", assetID.ToString());
-
try
{
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
@@ -160,25 +160,7 @@ namespace OpenSim.Data.MySQL
asset.Temporary = Convert.ToBoolean(dbReader["Temporary"]);
asset.Flags = (AssetFlags)Convert.ToInt32(dbReader["AssetFlags"]);
-
- if (m_enableCompression)
- {
- using(MemoryStream ms = new MemoryStream(asset.Data))
- using(GZipStream decompressionStream = new GZipStream(ms, CompressionMode.Decompress))
- {
- using(MemoryStream outputStream = new MemoryStream())
- {
- decompressionStream.CopyTo(outputStream, int.MaxValue);
-// int compressedLength = asset.Data.Length;
- asset.Data = outputStream.ToArray();
- }
-// m_log.DebugFormat(
-// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
-// asset.ID, asset.Name, asset.Data.Length, compressedLength);
- }
- }
-
- UpdateAccessTime(asset.Metadata, (int)dbReader["AccessTime"]);
+ accessTime = (int)dbReader["AccessTime"];
}
}
}
@@ -190,7 +172,35 @@ namespace OpenSim.Data.MySQL
dbcon.Close();
}
- return asset;
+ if(asset == null)
+ return asset;
+
+ if(accessTime > 0)
+ {
+ try
+ {
+ UpdateAccessTime(asset.Metadata, accessTime);
+ }
+ catch { }
+ }
+
+ if (m_enableCompression && asset.Data != null)
+ {
+ using(MemoryStream ms = new MemoryStream(asset.Data))
+ using(GZipStream decompressionStream = new GZipStream(ms, CompressionMode.Decompress))
+ {
+ using(MemoryStream outputStream = new MemoryStream())
+ {
+ decompressionStream.CopyTo(outputStream, int.MaxValue);
+// int compressedLength = asset.Data.Length;
+ asset.Data = outputStream.ToArray();
+ }
+// m_log.DebugFormat(
+// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
+// asset.ID, asset.Name, asset.Data.Length, compressedLength);
+ }
+ }
+ return asset;
}
///
--
cgit v1.1
From c57215687f6ab0a9585c5331edc2da89a88b8a28 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 21:43:22 +0100
Subject: a few more changes on mysql
---
OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 36 ++++++++--------
OpenSim/Data/MySQL/MySQLEstateData.cs | 7 +--
OpenSim/Data/MySQL/MySQLFSAssetData.cs | 3 +-
OpenSim/Data/MySQL/MySQLSimulationData.cs | 62 +++++++++++++++------------
4 files changed, 60 insertions(+), 48 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
index 5030c1d..fef582e 100644
--- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
+++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
@@ -77,30 +77,32 @@ namespace OpenSim.Data.MySQL
{
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
- IDataReader result = cmd.ExecuteReader();
-
- if (result.Read())
+ using(IDataReader result = cmd.ExecuteReader())
{
- ret.PrincipalID = principalID;
+ if(result.Read())
+ {
+ ret.PrincipalID = principalID;
- CheckColumnNames(result);
+ CheckColumnNames(result);
- foreach (string s in m_ColumnNames)
- {
- if (s == "UUID")
- continue;
+ foreach(string s in m_ColumnNames)
+ {
+ if(s == "UUID")
+ continue;
- ret.Data[s] = result[s].ToString();
- }
+ ret.Data[s] = result[s].ToString();
+ }
- return ret;
- }
- else
- {
- return null;
+ dbcon.Close();
+ return ret;
+ }
+ else
+ {
+ dbcon.Close();
+ return null;
+ }
}
}
- dbcon.Close();
}
}
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index 12593f6..eeedf02 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -82,6 +82,7 @@ namespace OpenSim.Data.MySQL
Migration m = new Migration(dbcon, Assembly, "EstateStore");
m.Update();
+ dbcon.Close();
Type t = typeof(EstateSettings);
m_Fields = t.GetFields(BindingFlags.NonPublic |
@@ -143,7 +144,6 @@ namespace OpenSim.Data.MySQL
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
-
cmd.Connection = dbcon;
bool found = false;
@@ -171,13 +171,14 @@ namespace OpenSim.Data.MySQL
}
}
}
+ dbcon.Close();
+ cmd.Connection = null;
+
if (!found && create)
{
DoCreate(es);
LinkRegion(regionID, (int)es.EstateID);
}
- cmd.Connection = null;
- dbcon.Close();
}
LoadBanList(es);
diff --git a/OpenSim/Data/MySQL/MySQLFSAssetData.cs b/OpenSim/Data/MySQL/MySQLFSAssetData.cs
index 0918596..6c48607 100644
--- a/OpenSim/Data/MySQL/MySQLFSAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLFSAssetData.cs
@@ -78,6 +78,7 @@ namespace OpenSim.Data.MySQL
conn.Open();
Migration m = new Migration(conn, Assembly, "FSAssetStore");
m.Update();
+ conn.Close();
}
}
catch (MySqlException e)
@@ -126,8 +127,8 @@ namespace OpenSim.Data.MySQL
m_log.ErrorFormat("[FSASSETS]: Query {0} failed with {1}", cmd.CommandText, e.ToString());
return false;
}
- cmd.Connection = null;
conn.Close();
+ cmd.Connection = null;
}
return true;
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 8d1a4a5..3ea5805 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -262,6 +262,7 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
}
}
+ dbcon.Close();
}
}
}
@@ -301,6 +302,7 @@ namespace OpenSim.Data.MySQL
cmd.CommandText = "delete from prims where SceneGroupID= ?UUID";
ExecuteNonQuery(cmd);
}
+ dbcon.Close();
}
}
@@ -961,6 +963,7 @@ namespace OpenSim.Data.MySQL
public virtual RegionSettings LoadRegionSettings(UUID regionUUID)
{
RegionSettings rs = null;
+ bool needStore = false;
lock (m_dbLock)
{
@@ -986,7 +989,7 @@ namespace OpenSim.Data.MySQL
rs.RegionUUID = regionUUID;
rs.OnSave += StoreRegionSettings;
- StoreRegionSettings(rs);
+ needStore = true;
}
}
}
@@ -994,6 +997,9 @@ namespace OpenSim.Data.MySQL
}
}
+ if(needStore)
+ StoreRegionSettings(rs);
+
LoadSpawnPoints(rs);
return rs;
@@ -1007,31 +1013,32 @@ namespace OpenSim.Data.MySQL
using (MySqlCommand cmd = dbcon.CreateCommand())
{
- cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, ";
- cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, ";
- cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, ";
- cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, ";
- cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, ";
- cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, ";
- cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, ";
- cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, ";
- cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, ";
- cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, ";
- cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, ";
- cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, ";
- cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, ";
- cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, ";
- cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, ";
- cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, ";
- cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, ";
- cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, ";
- cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, ";
- cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, ";
- cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, ";
- cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, ";
- cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, ";
- cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, ";
- cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)";
+ cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, "
+ + "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, "
+ + "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, "
+ + "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, "
+ + "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, "
+ + "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, "
+ + "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, "
+ + "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, "
+ + "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, "
+ + "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, "
+ + "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, "
+ + "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, "
+ + "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, "
+ + "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, "
+ + "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, "
+ + "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, "
+ + "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, "
+ + "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, "
+ + "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, "
+ + "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, "
+ + "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, "
+ + "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, "
+ + "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, "
+ + "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, "
+ + "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)"
+ ;
cmd.Parameters.AddWithValue("region_id", wl.regionID);
cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X);
@@ -1137,14 +1144,15 @@ namespace OpenSim.Data.MySQL
IDataReader result = ExecuteReader(cmd);
if (!result.Read())
{
+ dbcon.Close();
return String.Empty;
}
else
{
+ dbcon.Close();
return Convert.ToString(result["llsd_settings"]);
}
}
- dbcon.Close();
}
}
--
cgit v1.1
From de55ad9545a9a2709899efd57c1a81c4798bb779 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 6 May 2017 22:12:45 +0100
Subject: oops closed too soon
---
OpenSim/Data/MySQL/MySQLSimulationData.cs | 169 +++++++++++++++---------------
1 file changed, 87 insertions(+), 82 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 3ea5805..4766372 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -878,80 +878,82 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString());
- IDataReader result = ExecuteReader(cmd);
- if (!result.Read())
+ using(IDataReader result = ExecuteReader(cmd))
{
- //No result, so store our default windlight profile and return it
- nWP.regionID = regionUUID;
-// StoreRegionWindlightSettings(nWP);
- return nWP;
- }
- else
- {
- nWP.regionID = DBGuid.FromDB(result["region_id"]);
- nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]);
- nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]);
- nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]);
- nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]);
- nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]);
- nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]);
- nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]);
- nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]);
- nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]);
- nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]);
- nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]);
- nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]);
- nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]);
- nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]);
- nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]);
- nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]);
- nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]);
- UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture);
- nWP.horizon.X = Convert.ToSingle(result["horizon_r"]);
- nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]);
- nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]);
- nWP.horizon.W = Convert.ToSingle(result["horizon_i"]);
- nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]);
- nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]);
- nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]);
- nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]);
- nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]);
- nWP.hazeDensity = Convert.ToSingle(result["haze_density"]);
- nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]);
- nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]);
- nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]);
- nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]);
- nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]);
- nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]);
- nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]);
- nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]);
- nWP.ambient.X = Convert.ToSingle(result["ambient_r"]);
- nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]);
- nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]);
- nWP.ambient.W = Convert.ToSingle(result["ambient_i"]);
- nWP.eastAngle = Convert.ToSingle(result["east_angle"]);
- nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]);
- nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]);
- nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]);
- nWP.starBrightness = Convert.ToSingle(result["star_brightness"]);
- nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]);
- nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]);
- nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]);
- nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]);
- nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]);
- nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]);
- nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]);
- nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]);
- nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]);
- nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]);
- nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]);
- nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]);
- nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]);
- nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]);
- nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]);
- nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]);
- nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]);
- nWP.valid = true;
+ if(!result.Read())
+ {
+ //No result, so store our default windlight profile and return it
+ nWP.regionID = regionUUID;
+ // StoreRegionWindlightSettings(nWP);
+ return nWP;
+ }
+ else
+ {
+ nWP.regionID = DBGuid.FromDB(result["region_id"]);
+ nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]);
+ nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]);
+ nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]);
+ nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]);
+ nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]);
+ nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]);
+ nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]);
+ nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]);
+ nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]);
+ nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]);
+ nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]);
+ nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]);
+ nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]);
+ nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]);
+ nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]);
+ nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]);
+ nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]);
+ UUID.TryParse(result["normal_map_texture"].ToString(),out nWP.normalMapTexture);
+ nWP.horizon.X = Convert.ToSingle(result["horizon_r"]);
+ nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]);
+ nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]);
+ nWP.horizon.W = Convert.ToSingle(result["horizon_i"]);
+ nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]);
+ nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]);
+ nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]);
+ nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]);
+ nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]);
+ nWP.hazeDensity = Convert.ToSingle(result["haze_density"]);
+ nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]);
+ nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]);
+ nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]);
+ nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]);
+ nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]);
+ nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]);
+ nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]);
+ nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]);
+ nWP.ambient.X = Convert.ToSingle(result["ambient_r"]);
+ nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]);
+ nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]);
+ nWP.ambient.W = Convert.ToSingle(result["ambient_i"]);
+ nWP.eastAngle = Convert.ToSingle(result["east_angle"]);
+ nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]);
+ nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]);
+ nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]);
+ nWP.starBrightness = Convert.ToSingle(result["star_brightness"]);
+ nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]);
+ nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]);
+ nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]);
+ nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]);
+ nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]);
+ nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]);
+ nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]);
+ nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]);
+ nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]);
+ nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]);
+ nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]);
+ nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]);
+ nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]);
+ nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]);
+ nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]);
+ nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]);
+ nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]);
+ nWP.valid = true;
+ }
}
}
dbcon.Close();
@@ -1141,16 +1143,19 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
- IDataReader result = ExecuteReader(cmd);
- if (!result.Read())
- {
- dbcon.Close();
- return String.Empty;
- }
- else
+ using(IDataReader result = ExecuteReader(cmd))
{
- dbcon.Close();
- return Convert.ToString(result["llsd_settings"]);
+ if(!result.Read())
+ {
+ dbcon.Close();
+ return String.Empty;
+ }
+ else
+ {
+ string ret = Convert.ToString(result["llsd_settings"]);
+ dbcon.Close();
+ return ret;
+ }
}
}
}
--
cgit v1.1
From d0912b61516914f810ba306641aaaa813134462e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 7 May 2017 00:47:45 +0100
Subject: let StreamReader be in using statements
---
.../Hypergrid/HGGroupsServiceRobustConnector.cs | 7 ++--
.../Groups/Remote/GroupsServiceRobustConnector.cs | 7 ++--
.../Framework/Servers/HttpServer/BaseHttpServer.cs | 42 ++++++++--------------
.../Servers/HttpServer/RestStreamHandler.cs | 7 ++--
.../ClientStack/Linden/Caps/RegionConsoleModule.cs | 5 +--
.../Avatar/Friends/FriendsRequestHandler.cs | 7 ++--
.../World/Estate/EstateRequestHandler.cs | 7 ++--
.../Avatar/Concierge/ConciergeModule.cs | 5 ++-
.../AuthenticationServerPostHandler.cs | 8 ++---
.../Handlers/Authentication/OpenIdServerHandler.cs | 5 ++-
.../Handlers/Avatar/AvatarServerPostHandler.cs | 6 ++--
.../Handlers/BakedTextures/XBakesPostHandler.cs | 6 ++--
.../Handlers/Estate/EstateDataRobustConnector.cs | 7 ++--
.../Handlers/Friends/FriendsServerPostHandler.cs | 6 ++--
.../Server/Handlers/Grid/GridServerPostHandler.cs | 6 ++--
.../Handlers/GridUser/GridUserServerPostHandler.cs | 6 ++--
.../Hypergrid/HGFriendsServerPostHandler.cs | 6 ++--
.../Handlers/Inventory/XInventoryInConnector.cs | 6 ++--
.../Server/Handlers/Map/MapAddServerConnector.cs | 6 ++--
.../Handlers/Map/MapRemoveServerConnector.cs | 6 ++--
.../UserAccounts/UserAccountServerPostHandler.cs | 6 ++--
.../Neighbour/NeighbourServicesConnector.cs | 2 +-
22 files changed, 81 insertions(+), 88 deletions(-)
diff --git a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs
index af00770..51f3ec1 100644
--- a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs
+++ b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs
@@ -115,9 +115,10 @@ namespace OpenSim.Groups
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
+
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs
index 598e7a5..8502bb5 100644
--- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs
+++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs
@@ -91,9 +91,10 @@ namespace OpenSim.Groups
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
+
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index fb92b92..c32ee28 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -399,11 +399,10 @@ namespace OpenSim.Framework.Servers.HttpServer
Stream requestStream = req.InputStream;
+ string requestBody;
Encoding encoding = Encoding.UTF8;
- StreamReader reader = new StreamReader(requestStream, encoding);
-
- string requestBody = reader.ReadToEnd();
- reader.Close();
+ using(StreamReader reader = new StreamReader(requestStream, encoding))
+ requestBody = reader.ReadToEnd();
Hashtable keysvals = new Hashtable();
Hashtable headervals = new Hashtable();
@@ -567,13 +566,10 @@ namespace OpenSim.Framework.Servers.HttpServer
IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler;
Stream requestStream = request.InputStream;
+ string requestBody;
Encoding encoding = Encoding.UTF8;
- StreamReader reader = new StreamReader(requestStream, encoding);
-
- string requestBody = reader.ReadToEnd();
-
- reader.Close();
- //requestStream.Close();
+ using(StreamReader reader = new StreamReader(requestStream, encoding))
+ requestBody = reader.ReadToEnd();
Hashtable keysvals = new Hashtable();
Hashtable headervals = new Hashtable();
@@ -690,7 +686,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
- request.InputStream.Close();
+ request.InputStream.Dispose();
if (buffer != null)
{
@@ -998,7 +994,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
String requestBody;
- Stream requestStream = request.InputStream;
+ Stream requestStream = Util.Copy(request.InputStream);
Stream innerStream = null;
try
{
@@ -1009,9 +1005,8 @@ namespace OpenSim.Framework.Servers.HttpServer
}
using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8))
- {
requestBody = reader.ReadToEnd();
- }
+
}
finally
{
@@ -1263,12 +1258,10 @@ namespace OpenSim.Framework.Servers.HttpServer
//m_log.Warn("[BASE HTTP SERVER]: We've figured out it's a LLSD Request");
Stream requestStream = request.InputStream;
+ string requestBody;
Encoding encoding = Encoding.UTF8;
- StreamReader reader = new StreamReader(requestStream, encoding);
-
- string requestBody = reader.ReadToEnd();
- reader.Close();
- requestStream.Close();
+ using(StreamReader reader = new StreamReader(requestStream, encoding))
+ requestBody= reader.ReadToEnd();
//m_log.DebugFormat("[OGP]: {0}:{1}", request.RawUrl, requestBody);
response.KeepAlive = true;
@@ -1592,15 +1585,10 @@ namespace OpenSim.Framework.Servers.HttpServer
byte[] buffer;
Stream requestStream = request.InputStream;
-
+ string requestBody;
Encoding encoding = Encoding.UTF8;
- StreamReader reader = new StreamReader(requestStream, encoding);
-
- string requestBody = reader.ReadToEnd();
- // avoid warning for now
- reader.ReadToEnd();
- reader.Close();
- requestStream.Close();
+ using(StreamReader reader = new StreamReader(requestStream, encoding))
+ requestBody = reader.ReadToEnd();
Hashtable keysvals = new Hashtable();
Hashtable headervals = new Hashtable();
diff --git a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs
index 0305dee..dfc2715 100644
--- a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs
+++ b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs
@@ -50,11 +50,10 @@ namespace OpenSim.Framework.Servers.HttpServer
protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
+ string requestBody;
Encoding encoding = Encoding.UTF8;
- StreamReader streamReader = new StreamReader(request, encoding);
-
- string requestBody = streamReader.ReadToEnd();
- streamReader.Close();
+ using(StreamReader streamReader = new StreamReader(request,encoding))
+ requestBody = streamReader.ReadToEnd();
string param = GetParam(path);
string responseString = m_restMethod(requestBody, path, param, httpRequest, httpResponse);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs
index b3e3ac3..e8387e3 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs
@@ -185,8 +185,9 @@ namespace OpenSim.Region.ClientStack.Linden
protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader reader = new StreamReader(request);
- string message = reader.ReadToEnd();
+ string message;
+ using(StreamReader reader = new StreamReader(request))
+ message = reader.ReadToEnd();
OSD osd = OSDParser.DeserializeLLSDXml(message);
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
index 81aa882..091b197 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs
@@ -65,9 +65,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override byte[] ProcessRequest(
string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
+
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs
index 7ab92d1..5eda8ab 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs
@@ -60,9 +60,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
+
body = body.Trim();
// m_log.DebugFormat("[XESTATE HANDLER]: query String: {0}", body);
diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
index c0de3d9..a5dc0ad 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
@@ -460,9 +460,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
if (resp.ContentLength > 0)
{
- StreamReader content = new StreamReader(resp.GetResponseStream());
- m_log.ErrorFormat("[Concierge] response from {0} content: {1}", bs.Uri, content.ReadToEnd());
- content.Close();
+ using(StreamReader content = new StreamReader(resp.GetResponseStream()))
+ m_log.ErrorFormat("[Concierge] response from {0} content: {1}", bs.Uri, content.ReadToEnd());
}
}
}
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
index d3ea7e2..4f03cf4 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
@@ -82,11 +82,11 @@ namespace OpenSim.Server.Handlers.Authentication
switch (p[0])
{
case "plain":
- StreamReader sr = new StreamReader(request);
- string body = sr.ReadToEnd();
- sr.Close();
-
+ string body;
+ using(StreamReader sr = new StreamReader(request))
+ body = sr.ReadToEnd();
return DoPlainMethods(body);
+
case "crypt":
byte[] buffer = new byte[request.Length];
long length = request.Length;
diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
index a6605a1..254b82f 100644
--- a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
@@ -222,7 +222,10 @@ For more information, see http://openid.net/.
try
{
- NameValueCollection postQuery = HttpUtility.ParseQueryString(new StreamReader(httpRequest.InputStream).ReadToEnd());
+ string forPost;
+ using(StreamReader sr = new StreamReader(httpRequest.InputStream))
+ forPost = sr.ReadToEnd();
+ NameValueCollection postQuery = HttpUtility.ParseQueryString(forPost);
NameValueCollection getQuery = HttpUtility.ParseQueryString(httpRequest.Url.Query);
NameValueCollection openIdQuery = (postQuery.GetValues("openid.mode") != null ? postQuery : getQuery);
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
index 69c1a89..b8fdacf 100644
--- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
@@ -60,9 +60,9 @@ namespace OpenSim.Server.Handlers.Avatar
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs b/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs
index 24f63d9..d16000d 100644
--- a/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs
+++ b/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs
@@ -65,10 +65,8 @@ namespace OpenSim.Server.Handlers.BakedTextures
return new byte[0];
}
- StreamReader sr = new StreamReader(request);
-
- m_BakesService.Store(p[0], sr.ReadToEnd());
- sr.Close();
+ using(StreamReader sr = new StreamReader(request))
+ m_BakesService.Store(p[0],sr.ReadToEnd());
return new byte[0];
}
diff --git a/OpenSim/Server/Handlers/Estate/EstateDataRobustConnector.cs b/OpenSim/Server/Handlers/Estate/EstateDataRobustConnector.cs
index e0c2810..b7558ec 100644
--- a/OpenSim/Server/Handlers/Estate/EstateDataRobustConnector.cs
+++ b/OpenSim/Server/Handlers/Estate/EstateDataRobustConnector.cs
@@ -282,9 +282,10 @@ namespace OpenSim.Server.Handlers
// /estates/estate/?eid=int®ion=uuid
if ("estate".Equals(resource))
{
- StreamReader sr = new StreamReader(request);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(request))
+ body = sr.ReadToEnd();
+
body = body.Trim();
Dictionary requestData = ServerUtils.ParseQueryString(body);
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
index 3aab30b..d6668ab 100644
--- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
@@ -61,9 +61,9 @@ namespace OpenSim.Server.Handlers.Friends
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index f51c4ee..44d4654 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -65,9 +65,9 @@ namespace OpenSim.Server.Handlers.Grid
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
index 8806c2c..1f691d6 100644
--- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
@@ -60,9 +60,9 @@ namespace OpenSim.Server.Handlers.GridUser
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
index 8116050..fc1a77d 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
@@ -71,9 +71,9 @@ namespace OpenSim.Server.Handlers.Hypergrid
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 4400395..742d1a0 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -95,9 +95,9 @@ namespace OpenSim.Server.Handlers.Inventory
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
//m_log.DebugFormat("[XXX]: query String: {0}", body);
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
index 7611f53..bfd73a2 100644
--- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
@@ -104,9 +104,9 @@ namespace OpenSim.Server.Handlers.MapImage
protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
// m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
try
diff --git a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs
index ffd8ef6..8a3875d 100644
--- a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs
@@ -102,9 +102,9 @@ namespace OpenSim.Server.Handlers.MapImage
public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
// m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
try
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
index a02255f..bc12ef9 100644
--- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
@@ -72,9 +72,9 @@ namespace OpenSim.Server.Handlers.UserAccounts
protected override byte[] ProcessRequest(string path, Stream requestData,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
- StreamReader sr = new StreamReader(requestData);
- string body = sr.ReadToEnd();
- sr.Close();
+ string body;
+ using(StreamReader sr = new StreamReader(requestData))
+ body = sr.ReadToEnd();
body = body.Trim();
// We need to check the authorization header
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
index 939059d..5f075ac 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
@@ -183,8 +183,8 @@ namespace OpenSim.Services.Connectors
{
using (StreamReader sr = new StreamReader(s))
{
+ sr.ReadToEnd(); // just try to read
//reply = sr.ReadToEnd().Trim();
- sr.ReadToEnd().Trim();
//m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply);
}
}
--
cgit v1.1
From b20778d8ec707d3cdf53494e5324bff9a59f313f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 7 May 2017 04:45:28 +0100
Subject: fix merge
---
OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
index 241a24d..bafc0b3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
config.Configs["Network"].Set("ExternalHostNameForLSL", "127.0.0.1");
m_scene = new SceneHelpers().SetupScene();
- BaseHttpServer server = new BaseHttpServer(port, false, 0, "");
+ BaseHttpServer server = new BaseHttpServer(port);
MainServer.AddHttpServer(server);
MainServer.Instance = server;
--
cgit v1.1
From 8ef43e5fb3c8596cb793a38f9b5a2611bdb80668 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 7 May 2017 22:22:28 +0100
Subject: take more heavy work out of opened dbconn sections
---
OpenSim/Data/MySQL/MySQLSimulationData.cs | 36 +++++++++++++++++++------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 4766372..e754522 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -607,6 +607,10 @@ namespace OpenSim.Data.MySQL
{
m_log.Info("[REGION DB]: Storing terrain");
+ int terrainDBRevision;
+ Array terrainDBblob;
+ terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
+
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
@@ -626,10 +630,6 @@ namespace OpenSim.Data.MySQL
"Revision, Heightfield) values (?RegionUUID, " +
"?Revision, ?Heightfield)";
- int terrainDBRevision;
- Array terrainDBblob;
- terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
-
cmd2.Parameters.AddWithValue("RegionUUID", regionID.ToString());
cmd2.Parameters.AddWithValue("Revision", terrainDBRevision);
cmd2.Parameters.AddWithValue("Heightfield", terrainDBblob);
@@ -655,6 +655,10 @@ namespace OpenSim.Data.MySQL
{
m_log.Info("[REGION DB]: Storing Baked terrain");
+ int terrainDBRevision;
+ Array terrainDBblob;
+ terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
+
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
@@ -674,10 +678,6 @@ namespace OpenSim.Data.MySQL
"Revision, Heightfield) values (?RegionUUID, " +
"?Revision, ?Heightfield)";
- int terrainDBRevision;
- Array terrainDBblob;
- terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
-
cmd2.Parameters.AddWithValue("RegionUUID", regionID.ToString());
cmd2.Parameters.AddWithValue("Revision", terrainDBRevision);
cmd2.Parameters.AddWithValue("Heightfield", terrainDBblob);
@@ -711,9 +711,12 @@ namespace OpenSim.Data.MySQL
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
{
TerrainData terrData = null;
+ byte[] blob = null;
+ int rev = 0;
lock (m_dbLock)
{
+
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
@@ -729,11 +732,10 @@ namespace OpenSim.Data.MySQL
{
while (reader.Read())
{
- int rev = Convert.ToInt32(reader["Revision"]);
+ rev = Convert.ToInt32(reader["Revision"]);
if ((reader["Heightfield"] != DBNull.Value))
{
- byte[] blob = (byte[])reader["Heightfield"];
- terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
+ blob = (byte[])reader["Heightfield"];
}
}
}
@@ -742,12 +744,17 @@ namespace OpenSim.Data.MySQL
}
}
+ if(blob != null)
+ terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
+
return terrData;
}
public TerrainData LoadBakedTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
{
TerrainData terrData = null;
+ byte[] blob = null;
+ int rev = 0;
lock (m_dbLock)
{
@@ -765,11 +772,10 @@ namespace OpenSim.Data.MySQL
{
while (reader.Read())
{
- int rev = Convert.ToInt32(reader["Revision"]);
+ rev = Convert.ToInt32(reader["Revision"]);
if ((reader["Heightfield"] != DBNull.Value))
{
- byte[] blob = (byte[])reader["Heightfield"];
- terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
+ blob = (byte[])reader["Heightfield"];
}
}
}
@@ -777,6 +783,8 @@ namespace OpenSim.Data.MySQL
dbcon.Close();
}
}
+ if(blob != null)
+ terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
return terrData;
}
--
cgit v1.1
From 604b966d8442be6f034d81c8e8d04d12413c357c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 8 May 2017 00:40:15 +0100
Subject: some conditional dispose on http requests inputstream
---
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 3 ++-
OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index c32ee28..92be3a3 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -686,7 +686,8 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
- request.InputStream.Dispose();
+ if(request.InputStream.CanRead)
+ request.InputStream.Dispose();
if (buffer != null)
{
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
index 0e4a941..fefcb20 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
@@ -82,6 +82,9 @@ namespace OpenSim.Framework.Servers.HttpServer
byte[] buffer = server.DoHTTPGruntWork(responsedata, response);
+ if(Request.Body.CanRead)
+ Request.Body.Dispose();
+
response.SendChunked = false;
response.ContentLength64 = buffer.Length;
response.ContentEncoding = Encoding.UTF8;
@@ -107,6 +110,9 @@ namespace OpenSim.Framework.Servers.HttpServer
OSHttpResponse response
= new OSHttpResponse(new HttpResponse(HttpContext, Request), HttpContext);
+ if(Request.Body.CanRead)
+ Request.Body.Dispose();
+
response.SendChunked = false;
response.ContentLength64 = 0;
response.ContentEncoding = Encoding.UTF8;
--
cgit v1.1
From 6c79cc652ba481f714ccd728fe1f062fbd69bb83 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 8 May 2017 00:54:17 +0100
Subject: some conditional dispose on http requests inputstream
---
OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 3 ++-
OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index ec3805f..da2b860 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -815,7 +815,8 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
- request.InputStream.Dispose();
+ if(request.InputStream.CanRead)
+ request.InputStream.Dispose();
if (buffer != null)
{
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
index 6537f64..eb8ca0d 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs
@@ -86,6 +86,9 @@ namespace OpenSim.Framework.Servers.HttpServer
byte[] buffer = server.DoHTTPGruntWork(responsedata, response);
+ if(Request.Body.CanRead)
+ Request.Body.Dispose();
+
response.SendChunked = false;
response.ContentLength64 = buffer.Length;
response.ContentEncoding = Encoding.UTF8;
@@ -111,6 +114,9 @@ namespace OpenSim.Framework.Servers.HttpServer
OSHttpResponse response
= new OSHttpResponse(new HttpResponse(HttpContext, Request), HttpContext);
+ if(Request.Body.CanRead)
+ Request.Body.Dispose();
+
response.SendChunked = false;
response.ContentLength64 = 0;
response.ContentEncoding = Encoding.UTF8;
--
cgit v1.1
From f358b39ef57b67dec2c894a3ae7aba2449229e2e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 8 May 2017 04:00:47 +0100
Subject: update httpserver
---
bin/HttpServer_OpenSim.dll | Bin 119808 -> 119808 bytes
bin/HttpServer_OpenSim.pdb | Bin 327168 -> 327168 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll
index 33a1211..42ef8c3 100755
Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ
diff --git a/bin/HttpServer_OpenSim.pdb b/bin/HttpServer_OpenSim.pdb
index 2ab14a1..5065532 100644
Binary files a/bin/HttpServer_OpenSim.pdb and b/bin/HttpServer_OpenSim.pdb differ
--
cgit v1.1
From 5622b174c41ee190b5a8061ece16661009d74d82 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 8 May 2017 04:18:17 +0100
Subject: update mysql connector to v6.9.9 .net4.0
---
bin/MySql.Data.dll | Bin 353792 -> 424448 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/bin/MySql.Data.dll b/bin/MySql.Data.dll
index 992aa56..c9f344a 100755
Binary files a/bin/MySql.Data.dll and b/bin/MySql.Data.dll differ
--
cgit v1.1
From 72811de98bae3ca2e9200dc9034489120c0701fa Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 8 May 2017 19:06:37 +0100
Subject: push .Net framework to 4.5, this means minimal OS is now windows
Vista (not XP), but we do need this, namely for easier SSL implementation
---
prebuild.xml | 182 +++++++++++++++++++++++++++++------------------------------
1 file changed, 91 insertions(+), 91 deletions(-)
diff --git a/prebuild.xml b/prebuild.xml
index 52fb74a..b1c8a37 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -34,7 +34,7 @@
-
+
../../bin/
@@ -77,7 +77,7 @@
-
+
../../bin/
@@ -116,7 +116,7 @@
-
+
../../../bin/
@@ -145,7 +145,7 @@
-
+
../../../bin/
@@ -172,7 +172,7 @@
-
+
../../../../bin/
@@ -213,7 +213,7 @@
-
+
../../../bin/
@@ -240,7 +240,7 @@
-
+
../../../bin/
@@ -269,7 +269,7 @@
-
+
../../bin/
@@ -300,7 +300,7 @@
-
+
../../../../bin/
@@ -325,7 +325,7 @@
-
+
../../../bin/
@@ -359,7 +359,7 @@
-
+
../../bin/
@@ -394,7 +394,7 @@
-
+
../../../../bin/
@@ -421,7 +421,7 @@
-
+
../../../bin/
@@ -470,7 +470,7 @@
-
+
../../../bin/
@@ -506,7 +506,7 @@
-
+
../../../bin/
@@ -533,7 +533,7 @@
-
+
../../../bin/
@@ -564,7 +564,7 @@
-
+
../../../bin/
@@ -595,7 +595,7 @@
-
+
../../../bin/
@@ -636,7 +636,7 @@
-
+
../../../bin/
@@ -670,7 +670,7 @@
-
+
../../../bin/
@@ -702,7 +702,7 @@
-
+
../../../bin/
@@ -736,7 +736,7 @@
-
+
../../../bin/
@@ -767,7 +767,7 @@
-
+
../../../bin/
@@ -799,7 +799,7 @@
-
+
../../../bin/
@@ -832,7 +832,7 @@
-
+
../../../bin/
@@ -866,7 +866,7 @@
-
+
../../../bin/
@@ -895,7 +895,7 @@
-
+
../../../bin/
@@ -926,7 +926,7 @@
-
+
../../../bin/
@@ -957,7 +957,7 @@
-
+
../../../bin/
@@ -992,7 +992,7 @@
-
+
../../../bin/
@@ -1025,7 +1025,7 @@
-
+
../../../bin/
@@ -1064,7 +1064,7 @@
-
+
../../../bin/
@@ -1094,7 +1094,7 @@
-
+
../../../bin/
@@ -1129,7 +1129,7 @@
-
+
../../../bin/
@@ -1169,7 +1169,7 @@
-
+
../../../bin/
@@ -1210,7 +1210,7 @@
-
+
../../bin/
@@ -1246,7 +1246,7 @@
-
+
../../bin/
@@ -1280,7 +1280,7 @@
-
+
../../../../../bin/
@@ -1325,7 +1325,7 @@
-
+
../../../../../bin/
@@ -1373,7 +1373,7 @@
-
+
../../../bin/
@@ -1440,7 +1440,7 @@
-
+
../../../bin/
@@ -1501,7 +1501,7 @@
-
+
../../../bin/
@@ -1529,7 +1529,7 @@
-
+
../../../../bin/
@@ -1556,7 +1556,7 @@
-
+
../../../../bin/
@@ -1589,7 +1589,7 @@
-
+
../../../../bin/
@@ -1614,7 +1614,7 @@
-
+
../../../../bin/
@@ -1639,7 +1639,7 @@
-
+
../../../../bin/
@@ -1670,7 +1670,7 @@
-
+
../../../../bin/
@@ -1703,7 +1703,7 @@
-
+
../../../../bin/
@@ -1736,7 +1736,7 @@
-
+
../../../../bin/
@@ -1775,7 +1775,7 @@
-
+
../../../bin/
@@ -1819,7 +1819,7 @@
-
+
../../../bin/
@@ -1852,7 +1852,7 @@
-
+
../../../bin/
@@ -1881,7 +1881,7 @@
-
+
../../../bin/
@@ -1922,7 +1922,7 @@
-
+
../../../bin/
@@ -1961,7 +1961,7 @@
-
+
../../../bin/
@@ -1997,7 +1997,7 @@
-
+
../../../bin/
@@ -2037,7 +2037,7 @@
-
+
../../../../bin/
@@ -2073,7 +2073,7 @@
-
+
../../../../../../bin/
@@ -2105,7 +2105,7 @@
-
+
../../../../../../bin/
@@ -2146,7 +2146,7 @@
-
+
../../../../../bin/
@@ -2176,7 +2176,7 @@
-
+
../../../../../bin/
@@ -2215,7 +2215,7 @@
-
+
../../../../../../bin/
@@ -2248,7 +2248,7 @@
-
+
../../../../bin/
@@ -2295,7 +2295,7 @@
-
+
../../../bin/
@@ -2342,7 +2342,7 @@
-
+
../../../bin/
@@ -2394,7 +2394,7 @@
-
+
../../../bin/
@@ -2422,7 +2422,7 @@
-
+
../../../bin/
@@ -2449,7 +2449,7 @@
-
+
../../../bin/
@@ -2474,7 +2474,7 @@
-
+
../../../../bin/
@@ -2502,7 +2502,7 @@
-
+
../../../bin/
@@ -2551,7 +2551,7 @@
-
+
../../bin/
@@ -2574,7 +2574,7 @@
-
+
../../../../bin/
@@ -2616,7 +2616,7 @@
-
+
../../../bin/
@@ -2652,7 +2652,7 @@
-
+
../../../bin/
@@ -2703,7 +2703,7 @@
-
+
../../../bin/
@@ -2744,7 +2744,7 @@
-
+
../../../bin/
@@ -2775,7 +2775,7 @@
-
+
../../../../bin/
@@ -2806,7 +2806,7 @@
-
+