Commit Graph

4715 Commits

Author SHA1 Message Date
Guangcong Luo
6d415e2cd7 Fix trainercard alignment
Clicking on a user with a very large trainercard (generally, a bot in
a lot of rooms) would often push the trainercard offscreen even if it
fit, or push the trainercard to unscrollable areas.

With this change, the trainercard will no longer go offscreen unless
it doesn't fit, and if it doesn't fit, it will always be scrollable.
2019-09-06 00:42:26 -05:00
Guangcong Luo
10833a6c28 Support more xydex sprites in teambuilder 2019-09-04 18:47:11 -05:00
Guangcong Luo
52973f240a Prefer <button name="cmd"> buttons
This adds a new global button type (`cmd`). It works like `send`,
except it's processed for client commands, as if a user had typed it
into the commandline and pressed Enter.

This should make passing event handlers into Preact significantly less
common, and save a lot of duplicate code, and also save needing
`preventDefault` and `stopImmediatePropagation` everywhere.

`cmd`, `send`, and `joinRoom` combined should also allow buttons sent
from the server even more flexibility in what they can do.

Maybe at some point we'd even want a client `chat-commands` file.
2019-09-04 18:47:11 -05:00
Ben Davies
29bab1bfdf Fix SockJS when using the desktop client (#1360)
* Patch SockJS v1.4.0 to work with nw.js

* Document how to upgrade SockJS in UPGRADING-SOCKJS.md
2019-09-04 14:54:03 -05:00
Guangcong Luo
6b66a0322e Support making and receiving challenges
Actually playing the game that opens when you accept a challenge is,
of course, yet to be implemented.
2019-09-04 02:02:32 -05:00
Guangcong Luo
64b95e23cc Support text entry history 2019-09-04 02:02:32 -05:00
Guangcong Luo
e4f11da6ee Support |noinit|namerequired
Also:

- Support `/challenge [username]`

- Show an error when trying to challenge a chatroom

- Make the Main Menu scrollable

- Improve comment-documentation of PS.leftRoom etc
2019-09-04 02:02:32 -05:00
Guangcong Luo
548911b0c3 Fix obscure crash 2019-09-04 01:03:30 -04:00
Guangcong Luo
5100732a79 Fix LGPE sprites 2019-09-04 01:02:52 -04:00
Ben Davies
02eaeecf46 Implement connection timeouts (#1358)
* Use SockJS' timeout config option

This sets timeouts on connections to 5 minutes, matching the server's
heartbeat interval to close sockets that shouldn't be open anymore.

* Update SockJS client to v1.4.0

This fixes an issue where SockJS would parse the entire HTTP response
received as JSON, not the response's body alone.
2019-09-03 21:31:24 -05:00
LegoFigure11
f168f512e8 Add Teambuilder support for Battle Spot Special 17 (#1359) 2019-09-03 21:29:13 -05:00
Kirk Scheibelhut
3e1e76ac4d Change away usernames to be colorblind-friendly
'#888' still is light enough to work in dark mode, and apparently
the darker grey improves the contrast.
2019-09-03 16:54:01 -07:00
Guangcong Luo
6a3b62cdc9 Support Challenge menu
This adds support for a Challenge menu to the new Preact client.

- New: Support for "Controls", allowing Preact to render JSX at the
  bottom of chat scrollback - intended for challenge menus and battle
  controls in PS Mobile.

- New: <<pm-[userid]>> and <<challenge-[userid]>> links

- New: Support for client-side commands: /j, /chall, etc

- New: PMs have a user list

Actually challenging people isn't supported yet.
2019-08-31 00:04:45 -05:00
HoeenHero
849bc15834 Support custom weathers appearing on client (#1356) 2019-08-27 17:00:03 -07:00
Alexander B
b17bc0743f Runner-ups -> Runners-up (#1355) 2019-08-26 10:30:50 -07:00
Guangcong Luo
56490e3e84 Fix bgm not working 2019-08-25 16:22:38 -04:00
Guangcong Luo
260dcb0f2f Add better error message for spread move crash 2019-08-25 05:37:14 -04:00
Guangcong Luo
f1a560f90a Refactor background music
- Fixes bugs relating to multiple battles with background music going
  simultaneously

- Battles now instantly progress to Team Preview; no need for
  `.fastForwardTo(0)`

- Battles no longer play music before `|start|` or `|teampreview|`. This
  makes it possible for roomgames not to have music.

We now use a modern technique of "figure out what the music state should
be from battle state, then move toward it", instead of "directly figure
out what music state changes result from what battle state changes".

This is the trick I learned from React, and it makes the code
significantly simpler and more maintainable.
2019-08-24 15:12:52 -04:00
Guangcong Luo
898280c5e5 Improve format/team selector
This introduces a new TeamForm component, which can be used to choose
formats and teams.
2019-08-22 11:08:43 -07:00
Guangcong Luo
a736a4fa50 Fix replay URLs again 2019-08-21 11:17:16 -04:00
TheJetOU
586e8585bf Fix replays ordering (#1353) 2019-08-17 16:16:51 +02:00
Kirk Scheibelhut
bc72f40841 Fix missing sigils in replays.lib.php 2019-08-17 11:03:02 +02:00
kanmingxu00
9863615c69 Support folders in the battle team selector (#1343) 2019-08-14 00:56:26 -07:00
whales
dea589abb7 Show timestamp in nonotify PMs (#1351) 2019-08-13 17:09:09 +02:00
Kirk Scheibelhut
db3d655648 Unify username and format replay search internals (#1346) 2019-08-12 04:26:48 -07:00
Guangcong Luo
5e2f1be9a4 Clarify /hidejoins message
The settings used to be called "ON" and "OFF"; they're now called
"ALWAYS ON" and "AUTOMATIC", which should make it clearer why
join/leave messages still appear in battles/groupchats when it's set
to off.
2019-08-07 13:31:59 -07:00
Guangcong Luo
3afbeb8402 Fix unguessable replay URLs 2019-08-07 16:31:12 -04:00
Guangcong Luo
ff1cde5484 Stop caching privileged replay data
(Thanks Slayer95 for the tip)
2019-08-07 16:30:44 -04:00
Guangcong Luo
27038e2721 Add <<forgotpassword>> shortlink 2019-08-07 16:28:54 -04:00
Kirk Scheibelhut
f3a2440067 Change packed encoding of ability and gender 2019-08-06 09:53:16 +02:00
whales
afe4e47399 Don't mark afk from rename messages (#1345)
(only mark it from updateuser messages)
2019-08-05 09:45:29 +02:00
Kirk Scheibelhut
665e55e8cf Make saved replays default to https (#1344) 2019-08-04 12:49:48 -05:00
Guangcong Luo
1aac108356 Update build script
We now use `chdir` instead of `path.resolve` to get file-relative
paths.
2019-08-03 16:49:51 -05:00
Guangcong Luo
91573af30e Fix style error 2019-08-03 16:16:53 -05:00
Guangcong Luo
7b4adde51f Fix |uhtmlchange|
It will no longer drag down uhtml boxes that are unavailable. (They'll
instead be added to the top, which should be pretty unobtrusive while
still being available.)
2019-08-01 17:22:46 -05:00
Kirk Scheibelhut
b582b3eac6 Make battle search filter case insensitive fire on submit 2019-08-01 12:09:48 +02:00
TheJetOU
62ee23abe4 Allow filtering by userid prefix in battle search (#1342) 2019-08-01 10:10:27 +02:00
urkerab
ab44cc18f4 Use fervent wish message for Rayquaza (#1341) 2019-07-31 17:11:24 -05:00
Guangcong Luo
5da579f508 Update teambuilder Pokeball/HPtype selectors
- Pokeball selector is now hidden (to be shown after the server-side
  implementation is done)
- HP type default setting is now "(automatic type)" to make it clearer
  that you don't normally need to change it.
2019-07-31 02:23:34 -05:00
Kirk Scheibelhut
62d1b70ef6 Support importing/exporting Pokeballs/Hidden Power (#1340) 2019-07-31 00:21:07 +02:00
Kirk Scheibelhut
7951e4ac90 HP Type -> Hidden Power 2019-07-27 14:14:18 +02:00
Kirk Scheibelhut
fde4595b3b Clean up Pokeball and HP Type selectors
- Add title to HP Type for clarity
  - Filter out impossible Normal/Fairy Hidden Powers
  - Add missing ':' to Pokeball label
2019-07-27 14:00:58 +02:00
Timo
e917aa0a42 Update button phrasing in replay 404 page (#1339) 2019-07-26 15:00:40 -05:00
Guangcong Luo
9a70ec6a48 Give private replays unguessable URLs
Future private replays will be saved under URLs that can't be guessed.
Old private replays should be unaffected.

Replays saved for locks will never have an unguessable URL, but they
can still be considered private (and not show up in searches).
2019-07-25 20:43:59 -04:00
TheJetOU
972ef67a66 Fix /hl (list/roomlist) not returning response (#1338) 2019-07-25 18:55:51 -05:00
Kirk Scheibelhut
d564debfb3 Implement HP Type and Pokeball selector in Teambuilder UI (#1335) 2019-07-25 14:16:08 -05:00
Guangcong Luo
635c09d7ea Add temporary fix for Smogtours's lack of HTTPS cert
(A full fix would require PS to support running HTTPS on ports other
than 443.)
2019-07-24 22:40:22 -04:00
Guangcong Luo
e0fd3a44b9 Fix mass highlight bug
(Bug is from 259dd6dab3)
2019-07-24 22:37:08 -04:00
TheJetOU
259dd6dab3 Support room highlights (#1334) 2019-07-22 12:00:52 -05:00
Jacob McLemore
212bffd87f Fix messages for Queenly Majesty, Dazzling, and Damp (#1332) 2019-07-21 13:30:31 +02:00