Commit Graph

3416 Commits

Author SHA1 Message Date
Joim
7dd40a7d3b Adding highlighting words
Added highlighting words:
Users may now use the new highlight commands:
-Use /highlight add, word to add a highlighting word.
You might add several words separated with commands.
-In a likewise fashion, /highlight delete, word deletes words.
-Using /highlight delete with no words will delete all.
-/highlight show or list will show all current highlight words.
-By default no word is added to highlights.
-Words are escaped
2013-01-31 21:21:15 +01:00
Cathy J. Fitzpatrick
1208dee10f Verify that source IP is valid for server requests
Currently, server authentication for updating the ladder and for
uploading replays is done by comparing the hash of the token provided
by the server to the hash on record. This commit adds a second layer
of authentication by also verifying that the request actually
originates from the Pokemon Showdown server in question.

For now, I have also maintained the server token check as a form of
two-factor authentication.
2013-01-31 11:31:35 -07:00
Cathy J. Fitzpatrick
e3be0b3ea3 Remove unused code 2013-01-31 05:41:32 -07:00
Cathy J. Fitzpatrick
b696d366bb Add missing file: jquery-1.9.0.min.js 2013-01-31 02:58:25 -08:00
Cathy J. Fitzpatrick
12b3b59ed0 Break long words in chat 2013-01-31 02:57:27 -08:00
Cathy J. Fitzpatrick
b8daba264f Fix theoretical IE6 XSS 2013-01-31 01:38:21 -07:00
Cathy J. Fitzpatrick
5a26bc4fdb Fix XSS in getassertion 2013-01-30 22:49:51 -07:00
Marty-D
76ddd847cf Add After You and Quash messages. 2013-01-30 14:46:21 -05:00
Cathy J. Fitzpatrick
676df137c5 Update link in README.md 2013-01-30 07:06:34 -07:00
Cathy J. Fitzpatrick
9e28dc7e7d Include hostname in assertion to avoid vulnerability 2013-01-30 06:25:32 -07:00
Cathy J. Fitzpatrick
5c2160d875 Remove glickotest and laddertest features 2013-01-30 04:16:48 -07:00
Cathy J. Fitzpatrick
b630ff5c49 Remove sekrit2q53mkuser feature 2013-01-30 04:11:14 -07:00
Guangcong Luo
b5f7479ab4 Upgrade jQuery to 1.9.0 2013-01-29 20:01:48 -08:00
Cathy J. Fitzpatrick
a672294ea0 Fix bug in prefs 2013-01-29 16:27:42 -07:00
Guangcong Luo
6712b24913 Fix error when a spread move is marked missed 2013-01-29 14:52:37 -08:00
Cathy J. Fitzpatrick
560d71cecd Introduce self rather than using this in prefs
This doesn't actually matter here, but it provides greater
consistency with the style used in the codebase.
2013-01-29 15:40:27 -07:00
Cathy J. Fitzpatrick
f36d8db188 Refactor timestamps and prefs
- battle logs no longer have timestamps
- getTimestamp is moved to a property of the Lobby function
- the prefs global variable is replaced by a prefs API
2013-01-29 15:31:59 -07:00
Guangcong Luo
e4c3c621fa Stopgap fix to prevent replay crashing 2013-01-29 13:44:16 -08:00
Cathy J. Fitzpatrick
0890dae6c6 Set timestamps off by default
In order to preserve the previous status quo for now, this
commit turns timestamps off by default. They can be turned on
using /timestamps minutes or /timestamps seconds.
2013-01-29 05:39:19 -07:00
Cathy J. Fitzpatrick
310d8a806b Disable timestamps for past log sent from server
The past log sent from the server when joining a room does not
contain information about when the messages were sent, so we
do not show a timestamp for those messages.
2013-01-29 00:41:22 -07:00
Cathy J. Fitzpatrick
b6a9c9d3d0 Implement timestamps; save prefs in localStorage
This commit implements timestamp functionality in the lobby chat,
in private messages, and in battle chats. Timestamps are controlled
by a /timestamps command, which has three legal invocations:

    /timestamps off
        turns off timestamps

    /timestamps minutes
        show timestamps of the form [hh:mm]

    /timestamps seconds
        show timestamps of the form [hh:mm:ss]

For now, the default setting is /timestamps minutes. If this proves
unpopular, it can be changed. The timestamp preference is stored in
localStorage and does not have to be set every time.
2013-01-29 00:10:44 -07:00
Guangcong Luo
a1b11de299 Merged Leech Seed animation 2013-01-28 19:53:12 -08:00
Guangcong Luo
132c5627a8 Uproar messages 2013-01-28 17:22:39 -08:00
The Immortal
27d4a21d48 Typo 2013-01-29 00:04:35 +04:00
The Immortal
c4f29f6499 Update a few messages
- Add Guard Swap and Heart Swap
- Fix Spite
2013-01-29 00:01:44 +04:00
The Immortal
ca3ae00669 Add Freeze Shock -prepare message 2013-01-28 21:03:49 +04:00
Guangcong Luo
fa65b1b2d0 Fix crash in teambuilder export
(crash occurs with a set with no moves)
2013-01-28 06:06:08 -08:00
Cathy J. Fitzpatrick
f0583b1cfe Revise warning message to mention localStorage 2013-01-28 06:56:56 -07:00
Cathy J. Fitzpatrick
e4917fa448 Add warning about clearing cookies
Teams are stored in localStorage. Most browsers appear to clear
localStorage as part of clearing cookies. Very often, users
inadvertently delete their teams when they clear their cookies.
This message will not prevent all instances of this, but it
will at least decrease the chance of it happening.
2013-01-28 06:51:14 -07:00
Cathy J. Fitzpatrick
66e9e78bf1 Specify custom name colour for myself
I would have followed the pattern of specifying a hash, but my
shade of pink is not within the colour space spanned by the
normal algorithm (the proof of that claim is left as an exercise
to the reader), so it was necessary to hardcode the colour.
2013-01-28 03:58:33 -07:00
Cathy J. Fitzpatrick
fa05e003b9 Add shift+tab function for navigation
After the introduction of the tab complete feature, the tab
key can no longer be used to navigate away from the chatbox.
This commit adds a shift+tab function to navigate away from
the chatbox, rather than tab completing a name.
2013-01-27 23:03:55 -07:00
Marty-D
9b9bfaf9be Add messages for partial-trapping moves. 2013-01-27 20:18:57 -05:00
Guangcong Luo
07ec518e3e Up-to-date data files 2013-01-27 15:53:30 -08:00
Guangcong Luo
31a7c7e841 Add 'message' command
It's a major (large font) version of '-message'
2013-01-27 15:47:53 -08:00
Cathy J. Fitzpatrick
7510edbe12 Implement tab completion of user names
This commit implements a feature commonly found in IRC clients
and often referred to as "tab complete". This allows a user to
type part of a user's name in the chat box and then press tab, which
causes the program to complete the user's name in the chat box. The
user can then press tab additional times in order to cycle through
the list of possible matches.

Tab complete has been implemented for the main chat, for battles,
and for private messages.

The algorithm implemented is that when you press tab, the program
looks backward to the last space (or start of the line) and
considers the substring between the last space and the position of
the cursor to be the prefix of a name. It then builds a list of
all names that it could be, which is then sorted. The sort is
done first based on activity (i.e. users who have spoken more
recently are sorted higher), and if users are tied as to activity,
then by alphabetical order.

After a name has been tab-completed, you can then press tab
subsequent times in order to cycle through the remainder of the list.

The idea behind this algorithm is that a user will usually want
to refer to somebody who has spoken recently in the chat. This
is especially helpful for Pokemon Showdown because with 1500+
users, it would be difficult to complete the correct name if it
were based purely on alphabetical order.

Matching of names is based on userids, which are strictly
alphanumeric. Therefore, when intending to use tab complete,
a user should type only the letters and numbers from a user's
name, not any spaces or symbols. After pressing tab, the spaces
and symbols will appear in the chatbox, however.
2013-01-27 03:45:47 -07:00
Guangcong Luo
3de94d4b1a Some changes to index.php templating
- index.php is gitignored
- soundManager doesn't get a query string
2013-01-26 13:01:00 -08:00
Cathy J. Fitzpatrick
7d14f125ca Only use first 8 characters of MD5 hash in version 2013-01-26 13:56:41 -07:00
Cathy J. Fitzpatrick
d91e07dad1 Revise version query system
In order to avoid having a dirty working directory on the
live web server, this commit moves index.php to index.php.template.txt
and generates index.php in update-version-query-strings. The index.php
file is not under version control.
2013-01-26 13:46:46 -07:00
Guangcong Luo
fae82f8801 Implement Pledge messages 2013-01-26 09:20:55 -08:00
Guangcong Luo
32c4cec99d Prevent lobbychat scrollback from hitting RAM limits 2013-01-26 09:20:37 -08:00
Cathy J. Fitzpatrick
5b4031c74b Merge pull request #3 from TheImmortal/patch-1
Fix typo in yawn -start message
2013-01-26 04:10:54 -08:00
The Immortal
e87a2850d6 Fix typo in yawn -start message 2013-01-26 16:09:23 +04:00
Bill Meltsner
6668adb86f add a custom color for hearts(onfire) 2013-01-26 01:16:57 -08:00
Cathy J. Fitzpatrick
3fe5805296 Fix indentation
This is really trivial, but it might as well be fixed.
2013-01-26 00:48:54 -07:00
Cathy J. Fitzpatrick
56cc3f0de4 Change version script for PHP 5.2
The live web server runs PHP 5.2, which apparently does not
support anonymous functions, so the anonymous funciton has
been removed from update-version-query-strings.
2013-01-26 00:25:01 -07:00
Cathy J. Fitzpatrick
7dbb3330c2 New system to automatically update version strings
The index.php file specifies a version query string for each
resource which is likely to change. For example:

    <script src="/js/sim.js?v0.8.2c"></script>

Each time the file is changed, we have incremented the version
number so that browsers and/or the CDN know to download the
file from the web site, rather than using a cached version.
This works because changing the version query string changes
the file name of the resource.

This commit introduces a new program (update-version-query-strings)
which parses index.php and sets each version query string to be
the MD5 hash of the corresponding resource. On the live web
server, this program is set to run for the following git hooks:

    post-commit, post-checkout, post-merge, post-rewrite

This new system removes the need to manually update version query
strings. Instead, the version query strings will be automatically
updated when we update the live web site from now on.
2013-01-25 23:36:33 -07:00
Marty-D
01fb0bb135 Fix several -activate messages. 2013-01-25 23:47:35 -05:00
Marty-D
93b6f47035 Add Pay Day message. 2013-01-25 21:58:22 -05:00
Guangcong Luo
130f71631b Merge pull request #2 from yenatch/master
Add a button to stop the battle timer when applicable
2013-01-25 16:52:42 -08:00
yenatch
d6ad3f0031 add a button to stop the battle timer 2013-01-25 19:49:26 -05:00