Commit graph

84 commits

Author SHA1 Message Date
Sei Lisa
6cee2ac634 Initialize variable before appending to it. 2017-09-29 12:51:40 +02:00
Sei Lisa
d4359b133e Report error in settings.php when max length of 64K is exceeded.
Fixes #49.
2017-09-29 12:49:31 +02:00
Sei Lisa
032e0369bf Provisional fix for OpenSim event timeouts during dumping.
This is a provisional fix for #45. As discussed there, a proper fix will come later.
2017-09-20 10:15:15 +02:00
codeviolet
e37f991801 Update [AV]LockGuard.lsl
A minor edit so [AV]lockGuard's example pose settings match those used in the inworld examples. Should ease future updates to the examples.
2017-09-19 18:16:24 +02:00
codeviolet
ab62e75132 Merge pull request #36 from Sei-Lisa/sei-settings-php-overhaul
Overhaul of settings.php
2017-09-18 21:05:39 +10:00
Sei Lisa
27ae15b5ec Change utf8 to utf8mb4, checking if we succeed. 2017-09-16 00:02:10 +02:00
Sei Lisa
ca2714c50a Fix uninitialized variable in email_death() 2017-09-15 18:22:18 +02:00
Sei Lisa
57028e44d1 Remove parse_llHTTPRequest_headers function.
It served no practical purpose and used undefined variables to define values that weren't used anyway.

Also, comment out the variables that aren't used after parsing the X-SecondLife headers.
2017-09-15 18:22:18 +02:00
Sei Lisa
a8ec1d4747 Change the string escaping strategy
All variable values in SQL statements should use IntSQL or StrSQL as appropriate, rather than variables directly, with the exception of the table name.

This is akin to using htmlspecialchars to include text in HTML, or urlencode to include text in a URL. Normally you have the text in raw form and convert it as appropriate depending on where you're inserting it.
2017-09-15 18:22:18 +02:00
Sei Lisa
ae6745f26a Fix table issues
- Get rid of Y2K38 problems https://xkcd.com/607/
  - This also removes default value and on-update value for the timestamp, but these were being set explicitly so no harm done.
- Set the text field's character set to UTF-8.
- Set the link's character set to UTF-8.
2017-09-15 18:22:18 +02:00
Sei Lisa
a1b4e36cf4 Simplify regular expression for UUID 2017-09-15 18:22:18 +02:00
Sei Lisa
debd083735 Report bad request if no valid action was specified. 2017-09-15 18:22:18 +02:00
Sei Lisa
3b8453806e Move configuration to a separate file.
This will allow replacing the main file without needing to re-add the settings.

For example, settings.php can be always kept up-to-date locally via a symbolic link, without altering the configuration.
2017-09-15 18:22:18 +02:00
Sei Lisa
2d10bf9cc5 Omit the ending tag.
As recommended in http://php.net/manual/en/language.basic-syntax.phptags.php
2017-09-15 18:22:18 +02:00
Sei Lisa
4b009323f3 Fix typo in table creation statement. 2017-09-15 17:51:28 +02:00
Sei Lisa
d23699fbe6 Change the strategy for the U+FFFD separator handling.
Use a global variable instead. In SL, the optimizer does the replacement automatically, therefore no memory penalty is incurred. In OpenSim, the variable is assigned at run time with llUnescapeURL. The OpenSim separator is also changed from U+001F to U+007F, because most control characters under U+0020 cause problems with exporting when present in script memory.

Fixes #41.
2017-09-15 17:43:48 +02:00
Sei Lisa
8bd8b19e2f Add caveat on the use of -1 for all sitters. 2017-09-10 19:45:55 +02:00
Sei Lisa
997ea85236 Allow -1 to mean all sitters.
Suggested by Natsagan in the Unofficial AVsitter group.
2017-09-10 19:45:55 +02:00
Sei Lisa
70b737145e Allow "*" as pose name to mean all poses.
Suggested by Natsagan in the Unofficial AVsitter group.
2017-09-10 19:45:55 +02:00
Sei Lisa
da833a59a0 Revert last squashed commit, to push it as separate commits. 2017-09-10 19:42:31 +02:00
Sei-Lisa
0ed4903ada Allow * to mean all poses, and -1 to mean all sitters (#34)
* Allow "*" as pose name to mean all poses.

Suggested by Natsagan in the Unofficial AVsitter group.

* Allow -1 to mean all sitters.

Suggested by Natsagan in the Unofficial AVsitter group.

* Add caveat on the use of -1 for all sitters.
2017-09-09 23:55:23 +10:00
codeviolet
dc8b6c8386 use timer to avoid event timeout in OpenSim (#40) 2017-09-09 18:56:10 +10:00
codeviolet
bfb8ba8443 changed main author to initial author 2017-09-09 09:57:13 +02:00
Sei Lisa
96b4c44bc8 Fix markdown issues 2017-09-09 09:57:13 +02:00
Sei Lisa
00d7504ad5 Add AUTHORS.md 2017-09-09 09:57:13 +02:00
Sei-Lisa
2e7202e8a1 Fix bug where chains didn't detach on standup. (#33)
This was introduced in commit 5c4f5b3.
2017-09-08 00:33:16 +10:00
codeviolet
c2e2d63f70 Amend copyright notice 2017-09-02 10:03:01 +02:00
Sei Lisa
7d1afc7823 Makefile: Use a configurable variable for the zip program. 2017-09-02 09:45:52 +02:00
Sei Lisa
1f92469556 Add release building guide to README.md 2017-09-02 09:45:52 +02:00
Sei Lisa
e57b703964 Add Noob-detector to the optimized scripts list in Makefile. 2017-09-02 09:45:52 +02:00
Sei Lisa
19b025f7c3 Fix Windows file deletion.
Under Windows, 'del' was causing problems with the forward slashes used for directories, as these are not accepted by the shell commands, even if they are accepted as paths in general. Fix it by adding 'rm' capabilities to build-aux.py and using it in Makefile instead of the $(RM) macro.
2017-09-02 09:45:52 +02:00
Sei Lisa
242a5e0017 Rename RELEASE to BUILD_GUIDE and prepare-for-oss to build-aux
BUILD_GUIDE is more future-proof, especially if we end up using the preprocessor.

The build-aux rename is preparatory work for the next changes.
2017-09-02 09:45:52 +02:00
Sei Lisa
4ed043d823 Fix precedence of the "!" logical NOT operator.
We knew that in OpenSim, the bitwise NOT "~" operator's precedence was broken (see <http://opensimulator.org/mantis/view.php?id=3268>), but it appears that the same bug affects the logical NOT operator "!" as well, so it needs parentheses when followed by more expressions.
2017-09-02 09:45:52 +02:00
Sei Lisa
d8069cd1a9 Fix embedded assignments for OpenSim in AVselect/root-security 2017-09-02 09:45:52 +02:00
Sei Lisa
29ec5d7dd1 Add the rest of core files to the OpenSim version 2017-09-02 09:45:52 +02:00
Sei Lisa
b7b329847f Port UUIDs to OpenSim 2017-09-02 09:45:52 +02:00
Sei Lisa
7bf262c61e Fix llDialog with empty buttons list for OpenSim.
The optimizer removes the extra "OK" for SL.
2017-09-02 09:45:52 +02:00
Sei Lisa
b71c5e4287 Allow the separating space between // and OSS to be omitted. 2017-09-02 09:45:52 +02:00
Sei Lisa
1d9717b16b Revert osReplaceString change.
osReplaceString requires a regular expression, causing problems with regex-reserved characters.
2017-09-02 09:45:52 +02:00
Sei Lisa
cbb82150db More optimizations. 2017-09-02 09:45:52 +02:00
Sei Lisa
90bd72e1ff Further fixes for OpenSim.
In OpenSim, llGetLinkNumber() returns 0 for single prims with a sitting avatar. On top of that, in older versions llGetLinkKey returns NULL_KEY for link number 0, and in newer ones it does so for link number 1.

The present changes try to make sure that under either situation, the code behaves correctly for the core scripts.
2017-09-02 09:45:52 +02:00
Sei Lisa
e77bddec30 Unindent blocks that were left indented for clarity in the previous commit.
Only space changes, no code changes.
2017-09-02 09:45:52 +02:00
Sei Lisa
7482550bef Some micro-optimizations.
- [AV]sitA: Compute loading progress percentage without converting to float. Remove some 'else' clauses, adding 'return' where appropriate. That required moving the retrieval of the next notecard line near the top. A block has been left indented for clarity, and will be unindented in the next commit.
- [AV]prop: Remove some 'else' clauses, adding 'return' where appropriate. A block has been left indented for clarity, and will be unindented in the next commit.
- [AV]Xcite!: Change (string)llList2Integer to llList2String, after verifying that the elements in the list are always integers, and therefore this can't cause problems.
- [AV]root-RLV-extra: Remove unused event.
- [AV]faces: Change llListReplaceList with a replacement of [] to llDeleteSubList, to save one argument. Remove unnecessary 'else'.
- [AV]sequence: Comment out unused condition. It would be removed by the optimizer anyway, but this will hopefully help with clarity.
- AVpos-shifter: Change var++ to ++var (the optimizer would also do this anyway).
2017-09-02 09:45:52 +02:00
Sei Lisa
65c067cc30 Prepare the core scripts for OpenSim.
- Add Makefile and release creation instructions.
- Add a simple Python program to automate the OpenSim conversion based on markings in the code.
- Add .gitignore entries for the generated files.
- Add parentheses around assignments as required by OpenSim. This is done only to the core scripts.
- OpenSim isn't compatible with SL when there are conditions of type key. Those are all converted. Conditions of other types, except integer, are expanded for clarity and optimization, as they generate the same or better code that way, and currently the optimizer can do a better job when they are expanded.
- Floats in scientific notation need a dot.
- llParseStringXXXX doesn't work the same in OpenSim as in SL, when the separator is an Unicode codepoint that doesn't represent a character. For that reason, the internal separator, which is U+FFFD ("Replacement Character") is changed automatically by the Python program to U+001F (Unit Separator control character). For further safety, function strReplace is altered to use osReplaceString instead of llParseStringKeepNulls/llDumpList2String.

Furthermore, the ~ operator has the wrong precedence in OpenSim, but that was handled by a previous commit. Note that appearances of the ~ operator that were not preceded by a ! have only been replaced in the core scripts.
2017-09-02 09:45:52 +02:00
Sei Lisa
4278710ce8 Fix some marginal bugs, and the version of [AV]faces.
- Bump version of [AV]faces to 2.2.
- With very bad luck, some channel numbers could overflow the range of an integer due to float rounding, and produce DEBUG_CHANNEL or PUBLIC_CHANNEL as output.
- If both CHANGED_INVENTORY and CHANGED_LINK came at the same time, [AV]prop would fail to handle both.
- There was code that did nothing in [AV]faces. While it caused no bug per se, if it was reused in future then it could be affected by the same problem as that in [AV]prop.
2017-09-02 09:45:52 +02:00
Sei Lisa
610890951d Undo some hand optimizations.
Many of them cause problems with OpenSim.

All of them are applied by the optimizer, except (str="")+str, which produces gains only in LSO, not in Mono, and doesn't work in OpenSim.

A few are undone only for clarity, relying on the fact that the optimizer will apply them again.
2017-09-02 09:45:52 +02:00
Sei Lisa
202b4503d1 Remove or add parentheses as necessary to improve clarity.
There should be no changes in the code compiled from source directly.
2017-09-02 09:45:52 +02:00
Sei Lisa
2488349a1b Comment and formatting changes; no actual code changes.
- Add spaces between functions.
- Add comments on numeric codes and a few others.
- Reformat lists and one function.
- Remove spaces at EOL.
- Use actual copyright symbol.
2017-09-02 09:45:52 +02:00
codeviolet
ef3adcce5e formatting fixes 2017-09-01 17:52:39 +02:00
codeviolet
199aec0ef5 Add IMPORT_GUIDE and edit README 2017-09-01 17:52:39 +02:00