Commit Graph

149 Commits

Author SHA1 Message Date
Cathy J. Fitzpatrick
b5f144a9aa Remove unnecessary code from app.js 2013-02-01 22:07:37 -07:00
Cathy J. Fitzpatrick
9a1c2679e1 Add feature to watch config file for changes 2013-02-01 22:01:20 -07:00
Cathy J. Fitzpatrick
0d67aa1f35 Display helpful message for missing module
This should help users understand that they need to run npm install.
2013-01-21 21:15:20 -07:00
Guangcong Luo
d361c0cbf1 Increase login server timeout, might decrease ladder strain 2013-01-02 17:10:08 -08:00
Guangcong Luo
45b5dc0043 Configurable batch time for ladder queries 2013-01-02 16:39:41 -08:00
Guangcong Luo
82fc0142dd Emergency ladder enabling/disabling functions 2013-01-02 07:59:38 -08:00
Guangcong Luo
578550908f Better error messages for ladder server issues 2012-12-16 16:57:25 -08:00
Guangcong Luo
fd512f4fc4 More efficient toId implementation 2012-12-14 19:05:30 -08:00
Guangcong Luo
cae58c2fde More consistent name validation 2012-12-14 18:58:18 -08:00
Guangcong Luo
c9045cb538 Update link for hosting a server 2012-12-07 02:44:51 -08:00
Guangcong Luo
95a195b83b Handle the X-Forwarded-For header securely
Namely, don't trust it unless it's on a list of secure IPs
and trust nothing by default.
2012-11-25 16:47:05 -08:00
小太
a80a77cac1 Fix whitespace issues 2012-10-21 19:30:50 +11:00
Guangcong Luo
52d57a52c1 Remove a lot of code from the old protocol 2012-10-02 22:45:09 -07:00
Bill Meltsner
4d2907d2ce Check the user token's type to ensure it's a string, and thus won't break anything that assumes it is. 2012-09-13 00:22:59 -07:00
Guangcong Luo
955fe3948e Reduce the login server timeout to 10 seconds
(this is on the off chance that a login server stall is causing our lag spikes)
2012-08-17 21:43:08 -07:00
Guangcong Luo
c2d09f55b2 New protocol - significantly reduced network usage 2012-08-14 20:02:56 -07:00
Guangcong Luo
ea746cf2ca Don't crash on malformed JSON 2012-08-14 16:59:34 -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
641f4c153c Support engine.io 2012-08-10 18:55:12 -07:00
Guangcong Luo
91f3f20364 Comment out some unnecessary logging 2012-08-10 09:54:05 -07:00
Guangcong Luo
1d31929db8 Time out requests and responses after 2 seconds each 2012-08-08 23:50:40 -07:00
Guangcong Luo
efc9d77f58 Time out requests after 3 minutes 2012-08-08 22:37:33 -07:00
Guangcong Luo
1b5d406fa3 Some improvements to login/ladder server connection 2012-08-08 13:20:11 -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
445b840411 Disconnect is now handled separately 2012-08-04 00:56:44 -07:00
Guangcong Luo
878a3f9b11 Implement the disconnect event correctly 2012-08-04 00:51:45 -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
31e642c5a2 Rename simulator.js to battles.js 2012-07-31 19:48:09 -07:00
Guangcong Luo
a230425dcd Fixes to verifier 2012-07-29 14:23:05 -07:00
Patrick Roberts
2325ed9c9a connection grabs IP from behind proxy and fs stream doesn't throw exception now 2012-07-28 23:22:36 -05:00
Guangcong Luo
b801be60c0 Normalize set variables 2012-07-28 17:28:42 -07:00
Guangcong Luo
8b0ee28f21 Hopefully this will make request limiting work properly 2012-07-23 23:30:15 -07:00
Guangcong Luo
8c7449d441 Try to limit the number of open requests 2012-07-23 23:25:49 -07:00
Guangcong Luo
1dc63e446f Even fewer console messages 2012-07-23 23:25:49 -07:00
Guangcong Luo
ba78f59052 Continue cutting down on what we print to console 2012-07-23 13:36:11 -07:00
Guangcong Luo
5df400c39e Support Node 0.6 and 0.8 2012-07-20 23:53:57 -07:00
Guangcong Luo
b654c5f5b6 path.existsSync is now fs.existsSync in Node 0.8 2012-07-20 14:33:53 -07:00
Guangcong Luo
12dac23bb1 setuid support 2012-07-20 13:43:24 -07:00
Guangcong Luo
0db9ffc394 Severely cut down on the number of debug messages 2012-07-17 12:45:25 -07:00
Guangcong Luo
6a4f08f26b New request code - maybe it'll be better on the server? 2012-07-16 17:09:32 -07:00
Bill Meltsner
22cd7cab27 Guard against the mysterious and seemingly impossible situation where someone successfully connects with a null socket. 2012-07-08 20:38:06 -05:00
Bill Meltsner
c31ee2a428 Add SockJS as the default networking library.
You can still use Socket.IO by setting config.protocol in config.js.
2012-07-06 22:56:28 -05:00
Guangcong Luo
b3054fefdf Load all data using tools.js
- the original names BattleItems etc have been deprecated; please use:
  - Tools.getItem() accessor method if possible
  - Tools.data.Items for lower-level access (e.g. iteration)
- app.js was also rearranged a bit
2012-06-13 22:51:37 -07:00
Guangcong Luo
12e9b5458b Make tools.js support mods (past gens)
- replace Tools.foo with Tools.mod('gen4').foo for gen 4 tools
- mods are stored in mods/modname/ in the same directory structure as data/
- mods modify base data
- further documentation coming soon in mods/modding.md
2012-06-13 08:27:32 -07:00
Bill Meltsner
651881e2f1 Temporarily disable JSONP in Socket.io until https://github.com/LearnBoost/socket.io/issues/609 is fixed. 2012-06-09 01:18:33 -05:00
Guangcong Luo
7009b3a4bb Revert bmelts's hasty porting of Id etc to Sugar.js extensions
- The reverted utility functions, toId/toUserid/sanitize/clampIntRange, were designed to handle unsanitized data gracefully
2012-06-08 15:44:49 -07:00
Guangcong Luo
37c8fca226 Even fewer globals:- getRoom -> Rooms.get, newRoom -> Rooms.create
- getUser -> Users.get
- getTime has been entirely removed; new Date().getTime() isn't that long
2012-06-08 14:51:40 -07:00
Guangcong Luo
e4f5686dc2 Fewer globals:
- serverid and servertoken are now only available as config.serverid and config.servertoken
- lobby is now only available as rooms.lobby
2012-06-08 14:38:13 -07:00
Guangcong Luo
ce506d3b3e Rooms cleanup:
- Renamed: Room -> BattleRoom, Lobby -> LobbyRoom
- rooms.js is now its own file; app.js is now no longer huge
2012-06-08 14:32:48 -07:00