Commit Graph

76 Commits

Author SHA1 Message Date
Guangcong Luo
495dcf155c /lobbychat command to block lobby chat
Usage: /lobbychat off - start blocking
/lobbychat on - stop blocking
2013-01-30 17:03:25 -08:00
Cathy J. Fitzpatrick
0ab7d87af0 Refactor requiring the client to ack requests
This refactored version checks the rqid as part of the decision
data, rather than introducing a new /ackrequest command. This
change is done in a backward-compatible way.

Most of the code does not change compared to the previous version.

The corresponding client commit is Zarel/Pokemon-Showdown-Client@3b82cf5cec
2013-01-25 12:22:34 -07:00
Cathy J. Fitzpatrick
f9a8bba681 Fix mistake in comment 2013-01-25 03:00:19 -07:00
Cathy J. Fitzpatrick
f09d287070 Require client to acknowledge requests
In certain laggy situations, the following sequence of events
was previously possible in a battle:

1) Server makes request R_1 and R_2.
2) User 1 selects decision D_1 for request R_1
3) User 2 selects decision D_2 for request R_2
4) Server receives D_1 and D_2 and runs the turn
5) Server makes request R_3 and R_4.
4) Due to lag, User 1 does not realise that the server has
   already run the turn. User 1 wants to change his or her move
   for request R_1, so User 1 cancels decision D_1 and sends in
   decision D_3, intending it to be for request R_1.
5) User 2 selects decision D_4 for R_4.
6) Server receives D_3 and considers it to be the response to R_3,
   rather than the response to R_1 (which was what User 1 intended).
7) Server receives D_4 and considers it to be the response to R_4.
8) Server runs the turn.

The result of this sequence of events is that a move that User 1
intended to be for request R_1 is instead used for R_3, which has
the effect of depriving the user of the ability to make a reasoned
choice of which move to use for R_3.

This commit attempts to solve this problem by requiring the client
to acknowledge having received a request before the server will
accept a decision for that request.

Unfortunately, there is no seamless way to implement this in a
backward-compatible way. In other words, if the client were updated
to always send acks, it would no longer be able to work with old
versions of the server. For example, if the ack were added to the
choice string, old servers would no longer be able to handle choice
strings sent from the client. Similarly, if the ack were added
in the form of a new command (say, /ackrequest), old servers would
emit an unrecognised command error on receiving the command.

This commit maintains backward-compatibility by introducing a version
field to the init data structure sent to the client when joining a
battle room. This version should be incremented for any future
backward-incompatible changes as well.

The implementation of the ack request system is that the client must
send in "/ackrequest rqid" for each request, where rqid is the ID of
the request. If the server has not received an ack for request 'rqid'
when it receives a decision for request 'rqid', it discards the
decision and asks the client for another decision.

The corresponding client commit is Zarel/Pokemon-Showdown-Client@ccf0a97733
2013-01-25 01:19:03 -07:00
Guangcong Luo
839aecebc2 Smogon Tournament approved timer for unrated battles 2013-01-17 19:36:02 -08:00
Guangcong Luo
c6fb38f05d Increase inactive timer's default limits 2013-01-17 05:00:28 -08:00
Guangcong Luo
e7f07a53bb New function getExact (refactor ladder stuff) 2013-01-14 21:00:39 -08:00
Guangcong Luo
52e6d6d4a8 Disallow avoiding losses by switching to an alt 2013-01-14 20:16:51 -08:00
Guangcong Luo
51c8bae7d6 More lenient inactivity timer 2013-01-10 20:32:17 -08:00
Guangcong Luo
d4ab09b9f7 Fix some bugs with the reset timer 2013-01-10 00:50:20 -08:00
Guangcong Luo
15fe32fa5c Fix battle timer on/off detection 2013-01-10 00:50:20 -08:00
Guangcong Luo
13aafe2909 New battle timer 2013-01-09 00:31:07 -08:00
Guangcong Luo
6f30bc41f1 Allow kicking inactive players in non-laddeer games 2013-01-06 15:39:09 -08:00
Antar1011
59ef15ff1a Zarel does it better 2013-01-02 11:04:03 -05:00
Guangcong Luo
335de9c0d5 Log all relevant ratings instead of just ACRE 2013-01-02 07:59:38 -08:00
Antar1011
e80b6e2fd7 Log glicko2 rating, not ACRE 2012-12-31 20:06:29 -05:00
Guangcong Luo
578550908f Better error messages for ladder server issues 2012-12-16 16:57:25 -08:00
Guangcong Luo
b04b90cb63 Make sure only authorized users can /announce 2012-12-15 06:44:14 -08:00
Guangcong Luo
248446d1c2 Making an invalid choice no longer restarts the kick timer
(it could previously be abused to postpone a turn indefinitely)
2012-11-19 14:44:59 -08:00
Guangcong Luo
cf8e19789b Make sure users can always continue playing after rejoining 2012-11-06 22:31:32 -08:00
Guangcong Luo
392912f2c2 Custom formats!
- Server operators can now specify their own formats, instead of using the global list
- These formats will be sent to the client upon join
- They'll appear in lobby search/challenge, and in the ladder tab
2012-10-30 19:49:43 -07:00
小太
a80a77cac1 Fix whitespace issues 2012-10-21 19:30:50 +11:00
Guangcong Luo
0f249cfea7 Even more forgiving search algorithm 2012-10-04 03:14:20 -07:00
Guangcong Luo
5f3d3d6692 Even more forgiving search algorithm 2012-10-02 22:39:23 -07:00
Guangcong Luo
78ade4cc03 Make sure you don't play the same person twice in a row, and search wider over time 2012-09-29 02:46:00 -07:00
Guangcong Luo
c679e955a7 New system for matchmaking: ensure similar ratings 2012-09-26 22:36:03 -07:00
Guangcong Luo
00d10f8978 New ladder system no longer needs the concept of bonus pool 2012-09-26 22:36:03 -07:00
Guangcong Luo
5d1d850fc5 Make sure guests can still use non-chat commands. 2012-08-31 20:00:38 -07:00
Guangcong Luo
66860b7310 Battle rooms should have a send method
(fixes a crash when using certain commands in battle rooms)
2012-08-28 23:12:55 -07:00
Guangcong Luo
9ed85c3cdb Support !data in battle rooms 2012-08-15 01:05:05 -07:00
Guangcong Luo
c2d09f55b2 New protocol - significantly reduced network usage 2012-08-14 20:02:56 -07:00
Guangcong Luo
0c1f1b4d11 Fix the lobby room list 2012-08-14 16:59:23 -07:00
Guangcong Luo
c1bb83b55d Remove rooms from the lobby room list earlier in the deallocation process 2012-08-13 22:26:00 -07:00
Guangcong Luo
ab9fc735ed Fix a stray reference to rooms that made them un-deallocatable. 2012-08-13 22:18:34 -07:00
Guangcong Luo
caba1f2f12 Line length exemption to:
- sending teams
- sending signed rename token
2012-08-13 13:55:18 -07:00
Guangcong Luo
79207cb90a Don't allow searching of nonsearchable formats 2012-08-12 23:31:15 -07:00
Guangcong Luo
e8138debee Last command that needs to be chat-command: /trn
(tokenrename) performs a rename using a signed token
2012-08-12 22:58:43 -07:00
Guangcong Luo
68650005ea New save-team syntax 2012-08-12 21:56:01 -07:00
Guangcong Luo
59959ce24e Chat commands for most user actions
- we're moving to a new protocol! wheee!
2012-08-12 13:44:59 -07:00
Guangcong Luo
47c7e02464 Batched ladder requests 2012-08-07 19:21:53 -07:00
Guangcong Luo
2ab4f287db New request API
(preparation for batched requests)
2012-08-05 00:10:04 -07:00
Guangcong Luo
9ca5321597 Fix kickinactive 2012-08-01 23:33:31 -07:00
Guangcong Luo
8d8245b76d More reliable determination of inactive side 2012-08-01 23:02:28 -07:00
Guangcong Luo
7323aac95e Protect against crash from battle not existing 2012-08-01 19:15:26 -07:00
Guangcong Luo
3714979815 Many fixes to multi-process system:
- crashes mostly gone
- teams work
- debug console available for battle process (use >>>)
2012-08-01 16:29:49 -07:00
Guangcong Luo
9eb85e85fd Show only 6 battles on the main list 2012-08-01 13:57:33 -07:00
Guangcong Luo
4831e68a8c Multi-process battles!
Battles now occur in a separate process.
Hopefully, this results in a substantial increase in network stability.
WARNING: Battle crashes are now practically unrecoverable.
2012-08-01 13:48:58 -07:00
Guangcong Luo
64098853d2 Better way of not crashing with unexpected server response 2012-07-28 18:09:22 -07:00
Guangcong Luo
7f72fb181d Don't crash if server response is unexpected 2012-07-28 18:07:56 -07:00
Bill Meltsner
719a4eddd5 Refactor battle logging into its own function. 2012-07-28 17:45:08 -05:00