Commit Graph

196 Commits

Author SHA1 Message Date
Bär Halberkamp
15a047ab02 Use Room Host for owners of groupchats instead of Room Owner
Also tweak Room Host permissions so they are no longer identical to room owners
2018-05-12 19:11:02 +02:00
Guangcong Luo
cd2a462d94 Change default /exportinputlog permission 2018-02-08 20:40:36 -05:00
Guangcong Luo
cebeb1a48a /importinputlog users are now Host, not Player 2018-02-04 04:48:56 +09:00
HoeenHero
8fb4712397 Fix permission checking for promotions (#4336) 2018-01-13 21:18:28 -06:00
Ben Davies
540ce1513c Sockets: disable Config.wsdeflate by default
So it doesn't nag admins over not installing an optional dependency
2017-12-17 04:32:03 -04:00
Morfent
777ba0fc5f Sockets: implement permessage-deflate support (#4253)
Permessage-deflate is an extensIon that compresses websocket messages with zlib.
SockJS already supports it (indirectly) and the client's load balancer already
inserts the header in the opening handshake when making a WebSocket connection.

Config.wsdeflate makes this optional and allows tweaking the extension's resource
usage.
2017-12-15 15:43:48 -06:00
Guangcong Luo
ce8dc52501 Replace ofe with node-oom-heapdump
(ofe is no longer actively maintained)
2017-11-17 19:39:54 -06:00
Guangcong Luo
3185e98809 Add Host usergroup/rank
Currently just a placeholder, not used for anything yet.
2017-11-12 23:34:43 -06:00
Bär Halberkamp
2d8d9d42d0 Add a config option to disallow links for non-ac users (#4087) 2017-10-28 11:12:06 -05:00
Ben Davies
94c317b9ec Config: add missing documentation for networking-related settings (#3988)
`Config.workers` especially deserves to be documented. The other config
settings don't entirely need to be documented, but for the sake of
transparency `Config.ssl` and `Config.bindaddress` have been added as
well.
2017-09-17 19:52:12 -04:00
panpawn
877ecde1e8 Locked symbol: Use unicode code point (#3938)
This should use the unicode instead of the actual character itself for the same reason the player rank does - some text editors don't like unicode and will override this with an actual question mark.
2017-09-01 19:28:43 -04:00
panpawn
74656f9d84 Refactor disabling hotpatch (#3904)
Also, the actual notifications when an admin hotpatches is now smarter - it will tell the rooms if a hotpatch failed, and it will only tell the rooms after a hotpatch has happened, not before.
2017-08-23 02:24:28 -07:00
Guangcong Luo
5f196b4b9c Implement Config.laddermodchat
Allow configuring ladder modchat levels separately from PM modchat
levels.
2017-07-30 23:39:44 -04:00
Charlie Kobayashi
e4fe38126e Rooms: send a |customgroups| message on connect (#3529) 2017-06-19 16:12:52 -07:00
Ben Davies
b66e395bf6 Add Config.ofe, refactor optional dependency usage (#3644)
Config.ofe toggles whether or not to write heapdumps if sockets workers
run out of memory, since ofe is an optional dependency but is not
installed by default. nodemailer is now a nonDefaultDependency, and
will complain if it's not installed when Config.crashguardemail is
enabled.
2017-06-17 14:37:11 -07:00
panpawn
103f4828ae Automatically kill server on 0 battles in lockdown (#3635)
This allows for when the server is in lockdown, and the final battle finishes, for the server to automatically kill itself.
- Setting Config.autolockdown to false will turn this off.
- This also adds a new command to toggle Config.autolockdown
- This also introduces Rooms.global.notifyRooms
2017-06-14 13:57:52 -05:00
Ben Davies
015dd8db65 REPL: add Config.repl, refactor, Typescript (#3609)
- `Config.repl` enables/disables using REPL sockets since it doesn't
make as much sense to configure whether or not it's enabled with the
REPL_ENABLED const
- exports.start takes a filename parametre rather than a prefix and a
suffix one to avoid having to mutate parametres
- dead REPL sockets are removed from the sockets list when the server
emits an error, and the server closes on error now before respawning
the server
- made the file ready for Typescript
2017-06-11 10:40:38 -05:00
Ivo Julca
8a0e996351 Update jurisdictions in config example for new Player symbol 2017-03-04 20:12:32 -05:00
panpawn
66c38b7430 Change Player rank from ★ to ☆ (#3240)
There is a client-side counterpart to this.
2017-02-23 05:03:45 -06:00
Bär Halberkamp
075b9f03cb Implement an autolock for multiple roombans 2016-12-12 00:26:14 -08:00
Bär Halberkamp
1a7b63e78a Add a config option for PunishmentsMonitor 2016-12-02 00:53:18 +01:00
panpawn
41f6ee6e95 Add undocumented tournament Config options (#2862)
These are used within the tournament code, but they aren't documented...

This also changes:
 Config#tournamentDefaultPlayerCap  -> Config#tourdefaultplayercap
 Config#istournamentsrated -> Config#ratedtours
2016-11-07 23:11:13 -08:00
panpawn
e877fc9174 Remove unused documented config-example perm (#2857)
The redirect command actually uses the 'warn' permission, and it seems as though this permission actually isn't a permission of any of the ranks currently.
2016-10-26 18:57:04 -05:00
Guangcong Luo
270db5d1c0 Update login server public key 2016-09-18 08:13:48 -07:00
panpawn
1cb3403b4d Slowchat: Use editroom permission (#2663)
Also, let's only allow slowchat to be turned on if a room has at least 10 users in it.
2016-08-02 04:11:29 -05:00
Guangcong Luo
31e13ce690 Update config for 311dccb3ca 2016-08-02 03:06:50 -05:00
panpawn
32005690c3 Implement slowchat system (#2657)
This is basically a system that allows for room moderators or higher to set a minimum time between a user's messages sent to the room.
This is especially helpful for times the server might be lagging or the chat is just moving much too fast.
Alternatively, this could also help to stop spammers in their tracks and give staff more time to handle them as well.
2016-07-31 19:07:09 -05:00
panpawn
36d7728b06 Update help commands to reflect new bot rank (#2634)
Also, give the bot rank the new addhtml permission in config/config-example.js

... And, we are going to fix promoting locked users to rank bot.
2016-07-20 19:50:47 -06:00
panpawn
5858c809c9 Implement bot rank (server-side) (#2632)
This was inspired by https://github.com/Zarel/Pokemon-Showdown/pull/2471

We are also removing the github-specific code from /htmlbox as well, removing the modchat alias of * for player, and we are giving room owners and leaders the roombot permission so they can promote to it.
2016-07-20 16:47:37 -06:00
kotarou3
952cefbad4 Minor crash guard changes (#2470)
- Remove unused crash guard comment
- Update Config.crashguard comment a bit
- Use Config.crashguard to disable it in tests
2016-04-17 02:15:17 -07:00
The Immortal
952a9daf3f Update tour announcements feature 2016-03-25 00:18:06 +04:00
sirDonovan
f28489eddd Tournaments: update tournament announcements
- change the config option to room-specific options
- update rooms after adding announcements
2016-03-23 01:02:47 -05:00
Bär Halberkamp
3465829e22 Add permissions for roomgames 2016-02-26 22:19:19 +01:00
Guangcong Luo
75da4645c0 Add basic name filter
This filters out characters commonly used for impersonation. It's
based on the one used in Main, but now the rest of you can enjoy it
too!

This also filters zalgo and other annoying characters out of pokemon
names as well as usernames.
2016-02-16 03:46:57 -05:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
Konrad Borowski
86dd9f819d Prefer ES6 octal literals to string form 2015-11-08 08:57:50 +01:00
Juanma Serrano
c4ac8d6e2f Use strict mode and let and const instead of var
This commit also fixes some duplicated variable declarations.
2015-11-06 21:56:52 -05:00
Guangcong Luo
b7a58e6c21 Fix /privateroom and /modjoin permissions
- Now based entirely on 'editroom'; the 'privateroom' permission is
  gone
- New command /publicroom to make a room public
- /privateroom by itself no longer makes a secret room, but now just
  displays documentation for /secretroom, /hiddenroom, and /publicroom
2015-09-26 17:54:38 -04:00
Guangcong Luo
ad0325e736 Update default permissions
Default permissions have been re-synced to main server permissions.
2015-09-23 22:56:34 -04:00
sirDonovan
a1b7d65c30 Fix 5b32ebaaef 2015-09-21 00:42:16 -05:00
Guangcong Luo
165a667ec7 Improve documentation on modchat config options 2015-09-01 02:45:10 -05:00
Morfent
8adb36508e Remove Heroku hack
The issues Heroku had with SockJS have been fixed for a while since
https://github.com/sockjs/sockjs-node/issues/57, now that it supports
long polling and WebSockets.
2015-04-20 00:42:14 -03:00
Guangcong Luo
ca44442a01 Fix /addplayer
This used to be done with the roomplayer permission, but that
allows players to demote other players, which is obviously
undesirable.
2015-04-06 04:15:44 -04:00
sirDonovan
4dd36ca40a Add config option to announce tournaments
When tournaments are created in the specified rooms, they will be
announced in the server's main tournament room
2015-03-27 14:26:31 -05:00
codelegend
2debe58153 config: document new groups format, and few more permissions 2015-03-20 23:53:41 +05:30
codelegend
4c3806ec53 cache config groups: optimize user permission checks 2015-03-20 23:53:37 +05:30
Guangcong Luo
98bbb8ed45 Refactor /addplayer 2015-03-03 20:07:24 -05:00
Guangcong Luo
3465ae5532 Voice can no longer joinbattle
The joinbattle privilege has been moved up to driver+/player-only
mostly because apparently a lot of servers have a habit of
promoting untrustworthy people to voice.

Players have been given the /addplayer command to intentionally
allow others to join a battle as a player.
2015-03-03 01:52:50 -05:00
Ivo Julca
253c2b951e Update dependencies 2015-02-23 04:14:30 -05:00
Ivo Julca
50ae470d6e - The array consoleips can include user IDs.
- Fields for `forcetimer` and `reportjoinsperiod` are now available.
- Describe how `showjoins` interacts with client-side commands /showjoins and /hidejoins.
- Setting a `false` value for `reportbattlejoins` is deprecated.
2015-02-05 20:22:43 -05:00
Juanma Serrano
6fc7ce6ffa Implement challenge logging
Servers that change their configuration to do so can now log challenge battles.
2014-12-18 19:05:33 +01:00
Juanma Serrano
e27cb82093 Implement config option to hide Battle joins/leaves properly
Implements 0251bb8 properly.
Requires https://github.com/Zarel/Pokemon-Showdown-Client/pull/291 to be applied to have any effect.
2014-12-18 14:11:54 +01:00
Juanma Serrano
dd12e4bc69 Revert "Implement config option to hide Battle joins/leaves"
This reverts commit 0251bb845b.
2014-12-16 10:25:20 +01:00
Guangcong Luo
660682b665 Merge pull request #1299 from kotarou3/jeopardy
Jeopardy
2014-12-15 15:57:52 -06:00
Juanma Serrano
0251bb845b Implement config option to hide Battle joins/leaves
This is a feature requested for tournament servers just as smogtours.
Right now it hides all join and leave reports, including those of the battlers.
By default all servers should have it to true, reporting the battles, added that on the config-example.
Servers that wish to hide joins and leaves on battles must put this configuration to false.
2014-12-15 17:17:03 +01:00
小太
c5a36c52d9 Add Jeopardy chat plugin 2014-12-15 01:54:30 +11:00
小太
6138ab9e0b Add REPL sockets 2014-12-14 23:11:13 +11:00
Guangcong Luo
018155c9c3 Fix Config.bindaddress
It wasn't getting propagated to socket processes correctly. Also change
the default bind address from 'localhost' to undefined (accept all
connections).
2014-10-29 20:51:00 -04:00
ryanj
3c943fb096 Autoconfiguration for cloud hosting environments, OpenShift support 2014-10-24 23:02:07 -07:00
Corentin Choloux
94c05ae3ef Remove forcenameto
The command doesn't longer exist.
2014-08-19 15:31:09 +02:00
panpawn
c2ddbd9672 Correct typo 2014-08-08 00:58:38 -04:00
Guangcong Luo
d569bfd8c5 Tournaments: Allow mods to start tournaments if enabled 2014-08-03 21:21:39 -04:00
Guangcong Luo
5c7949c0b1 Revert "Merge pull request #824 from kotarou3/shadowban"
Its CPU usage is unacceptable for main.

This reverts commit cfc30d71b1, reversing
changes made to 68b42fe6a7.
2014-04-30 22:16:55 -04:00
小太
3befc06197 Merge remote-tracking branch 'upstream/master' into shadowban
Conflicts:
	rooms.js
2014-04-28 20:54:46 +10:00
小太
6fb3bc332a Spaces around operators and === instead of == 2014-04-22 01:56:11 +10:00
小太
c6913b5ba1 Implement shadowban 2014-04-15 18:02:48 +10:00
Guangcong Luo
dbf47ddd83 Move Player above Moderator for modchat 2014-01-14 21:28:20 -08:00
小太
839fdb005b Multiprocess Team Validator 2014-01-13 15:35:10 +11:00
Guangcong Luo
9b66292832 Revert "Multiprocess team validator"
This reverts commit ce7cc3bf66.
2014-01-12 13:47:11 -08:00
小太
ce7cc3bf66 Multiprocess team validator 2014-01-12 18:39:55 +11:00
Guangcong Luo
1aaaf7da0f Players can now toggle privateroom
privateroom will make the room stop showing up on the room list and
on the player's in-room lists, although they're still available by
link and the join command.
2014-01-07 20:38:00 -08:00
Guangcong Luo
b721806538 New room rank: Player
Player is for players in battles; it gives them the ability to
appoint roomvoices and set modchat in rooms.
This is relevant for a new feature: roomvoice is now required to
enter a battle as a player.
2014-01-03 21:25:10 -08:00
Guangcong Luo
872c524ebb New modchat setting: pmmodchat
pmmodchat is config-only, but as expected, it requires a certain modchat
level to send PMs or challenges
2014-01-03 17:28:44 -08:00
Guangcong Luo
22c3fe43a1 Fix modchat
modchat's embarrassingly been broken since the rooms update, but as
of now there are separate roommodchat and battlemodchat options
to set the default modchat level. I'll probably add the ability
for per-room modchat to be permanent later.
2014-01-02 23:17:44 -08:00
Cosym
35ad815372 Declares to Admin only, add permission
Changed cdeclare to Admin only, and added a 'gdeclare: true,' permission
to Admins.

Removed declares 'label' from the declare.
2013-10-10 18:54:27 +01:00
Guangcong Luo
f0f70ef98b Admin and Leader are now global-only
It is no longer possible to promote someone to Room Admin or Room
Leader.
2013-10-04 15:08:30 -07:00
Guangcong Luo
895d903ca6 Room auth overhaul
Room auth now match regular auth much better. There are now room voices,
room drivers, room mods, etc. They correspond to the global versions,
except with their powers restricted to the current room.

Roomdriver no longer gets /roomvoice; it's now roommod and higher.
2013-09-30 21:54:37 -07:00
Guangcong Luo
4ad19bb333 Refactor: Rename some permissions functions
In particular, Development Staff has been renamed to System Operator.
2013-09-22 16:42:52 -07:00
Joimer
051ac52d27 Refactor rank check: room only ranks do not interact with demote/promote
The function getNextGroupSymbol now takes an extra parameter to exclude room only ranks, which are defined in config.
The function will try to find the closest non room only rank with a safeguard against maliciously or badly crafted config.js to crash the server.
If no rank is found regardless of room only or not status, the first or last rank are returned accordingly.
This refactor allows getNextGroupSymbol's name to keep true to its functionality, while also providing a way to exclude crafted ranks for rooms or otherwise from the global demote/promote scheme.
2013-07-31 12:46:15 +02:00
Guangcong Luo
2f98105b17 Minor rearranging of the default config file 2013-07-27 21:27:52 -05:00
Guangcong Luo
bec1ee4650 serverid is no longer used in the current login server scheme 2013-07-27 21:27:06 -05:00
Guangcong Luo
759e2aaaef More generalized per-room auth
Per-room auth is now less hardcoded. Promotion/demotion is still
done manually in commands.js, but at least users.js doesn't have
as much hardcoded.

A result of this is that /roomvoice is now possible.
2013-07-07 12:22:48 -07:00
Cathy J. Fitzpatrick
1e7c65aade New login server public key (keyid=2)
This new key is 4096 bits. The previous two keys will continue to be
supported by the login server for now.
2013-06-20 17:14:11 -06:00
Cathy J. Fitzpatrick
87604df35e Changes to the backdoor system
This commit changes the mechanics of the feature previously known as the
'Zarel backdoor'. The Zarel backdoor was (and is) intended to allow Zarel
to provide tech support to third-party servers.

It is still easy to opt-out of the backdoor system like before. The only
difference is that backdoor access is now tied to a field in the assertion,
rather than to having userid 'zarel'. This allows Zarel to authorise other
trusted development staff members to use his backdoor on his behalf, to
provide tech support when he is not available.

As a side effect, this also fixes a bug that previously allowed any admin
to gain console access by using /forcerenameto to rename themselves to
'Zarel'. Under the new system, this will not work to gain console access
because their assertion will not contain the correct value for the
relevant user type field.
2013-06-12 20:15:34 -06:00
Cathy J. Fitzpatrick
6d435a38e4 Get rid of some config settings 2013-06-12 02:12:46 -06:00
Cathy J. Fitzpatrick
d18cee9e3a Remove obsolete battle reporting code 2013-06-12 02:04:48 -06:00
Cathy J. Fitzpatrick
65fb12dddc Introduce appealurl config option 2013-06-10 00:38:29 -06:00
Cathy J. Fitzpatrick
bce493ad28 Fix two typos in config-example.js 2013-06-03 02:06:06 -06:00
Cathy J. Fitzpatrick
2959315811 Update proxyip documentation 2013-06-03 02:04:18 -06:00
Cathy J. Fitzpatrick
ac272e216d Support logging all chat rooms 2013-05-22 20:00:14 -06:00
Cathy J. Fitzpatrick
e9f39a2767 watchconfig now defaults to true 2013-05-19 07:08:20 -06:00
Cathy J. Fitzpatrick
92dfa8de8d Delete servertoken from config-example.js 2013-05-19 07:08:20 -06:00
Guangcong Luo
75a0241d5e Update default permissions 2013-05-17 14:21:01 -07:00
Cathy J. Fitzpatrick
5c79e86303 Remove config.proxyip = true option 2013-05-12 17:04:30 -06:00
Guangcong Luo
e4b59fa227 /lock feature, replaces /ipmute and /namelock 2013-05-07 22:12:55 -07:00
Cathy J. Fitzpatrick
072bb5e042 Remove legacy code for old protocols 2013-04-26 04:22:17 -06:00
Cathy J. Fitzpatrick
d8d3d897be Implement email crash logging 2013-04-24 23:20:29 -06:00
Cathy J. Fitzpatrick
f454177364 Changes to static file serving
- /static/custom.css is now located at /config/custom.css
- /static/avatars/ is now located at /config/avatars/
- The redirect script now redirects all room URIs, not just the root
  path. For example, if you are running a server on localhost port 8000,
  visiting http://localhost:8000/teambuilder will now take you to the
  teambuilder. This works for any room.
2013-04-24 20:41:49 -06:00
Cathy J. Fitzpatrick
4c36582434 Improve some documentation in config-example.js 2013-04-24 16:28:50 -06:00
Cathy J. Fitzpatrick
47f456a26d Revise custom avatar feature 2013-04-24 02:43:33 -06:00