summaryrefslogtreecommitdiff
path: root/server.py
AgeCommit message (Collapse)AuthorFilesLines
2022-01-02Implement a short-lived packet cache when client request is the same as ↵Jesusaves1-1/+26
previous. This allows the client to re-send packets safely in case of network issues, without the server duplicating the action. Note that server-initiated requests are never cached. ...Which are only AP or Broadcast, so makes no difference, I guess.
2021-08-21Set a default syslog priority for failures (INFO -> NOTICE)Jesusaves1-1/+2
2021-08-18Sanitize packet (so it can send numbers) and send special code for outdated ↵v2.1.8.18Jesusaves1-1/+1
clients
2021-08-16Add command `list` (aka. `all`) which lists everyone connected.Jesusaves1-0/+4
Also lists their tokens and IPs so the other commands (ban, ddos, etc.) can be used
2021-08-16Fix the `debug` command from server consoleJesusaves1-2/+4
2021-08-04Add another verbosity level, otherwise debug.txt will be a monsterJesusaves1-8/+11
2020-12-31In case of a successful DDoS, prevent wasting resources evaluating blacklistJesusaves1-9/+9
and other stuff as the server is full. This is done this way, not to save the game server from the DDoS, but to save the remainder of the VM.
2020-12-31Fail silently if when closing a socket the client is not in the list.Jesusaves1-1/+8
(Usually, connection dropped before registration)
2020-12-31Fix typos and a bug of a swapped max and min functionJesusaves1-2/+2
2020-12-31Add support for custom battle backgrounds.Jesusaves1-0/+1
Fix typos and minor bugs.
2020-12-31Registration failure now only gives 2 lame points.Jesusaves1-2/+1
This means each connection can attempt up to three registrations. Raise to 3 in case of attack :p
2020-12-31Relicense the game to GPLv3.Jesusaves1-0/+17
utils.py can still be used under the LGPL. The LGPL license present in git history is no longer valid, but already issued copies still are. Needless to say, there are no "already issued copies"...
2020-12-27Add command to kick users (no ban)Jesusaves1-4/+6
2020-12-27Manually casting ban or kline will now disconnect sessions as wellJesusaves1-0/+16
2020-12-27Disclose about automatic bans, and make score rule read from consts.pyJesusaves1-1/+0
Move the TODO about dropping already established connections from server.py to security.py
2020-12-27Update instructions, attempt to generate a Z-Line file at make time.Jesusaves1-2/+3
2020-12-23Update README with the command list, add aliases, add unban, and cleanup.Jesusaves1-2/+11
2020-12-23Explain in README the difference between K-Line and the other lines.Jesusaves1-1/+1
TL;DR The G and Z lines were meant to be auto-deployed, while K line is local.
2020-12-23Add a command to perma-ban (or block) an IP.Jesusaves1-2/+7
2020-12-23Update notesJesusaves1-2/+1
2020-12-23Add status commands so you can see how many connections are openJesusaves1-0/+2
2020-12-23Commands to DC or DC-and-Ban all unauthed clients.Jesusaves1-1/+19
These may be used in DDoS scenarios.
2020-12-21Allow arbitrary command execution as well.Jesusaves1-1/+7
Please do not abuse this.
2020-12-21Fix the bug on duplicate login detectionJesusaves1-2/+0
2020-12-21Abrupt loss of connection will now save the player data and destroy the old ↵Jesusaves1-2/+7
token. Or at least, it will try to.
2020-12-21Allow high and totally unsafe wizardry if debug mode is ON.Jesusaves1-1/+10
Allow debug mode to be toggled on and off on server console.
2020-12-21Anti-dupe is not working...Jesusaves1-0/+1
2020-12-21Improve token logic internally.Jesusaves1-0/+1
Hopefully this will detect when same userid is logged in twice and dc the older login. May suffer of race condition.
2020-12-21Make clients a global arrayJesusaves1-2/+1
2020-12-19Add token field to connection. Send connection to protocol parser.Jesusaves1-3/+4
Add new constants for the results (non-boolean) so later™ score can be smart.
2020-12-19Send max_exp to clients so they can render the exp bar without needing to ↵Jesusaves1-0/+1
download the whole experience table.
2020-12-18Make experience table to rank up steeper.Jesusaves1-1/+6
We really should read a table instead of using a formula...
2020-12-18Limit maximum clients connected at once to 2500.Jesusaves1-3/+9
In theory, it could handle 10k or so, but ML has total priority. So even if this interfers with Mana Spheres operation, it is preferable.
2020-12-18Try to improve how script looks for lintingJesusaves1-2/+2
2020-12-18Registrations should be working again.Jesusaves1-1/+1
Bump client version so it is now authorized! \o/
2020-12-18Allow empty commands, and start printing tracebacks if something goes wrongJesusaves1-12/+20
2020-12-18Shutting down the server normally now notifies all clients about shutdownJesusaves1-2/+4
2020-12-17Fix a few typos, try to cleanupJesusaves1-3/+6
2020-12-17Add formating rules for SERVNOTICEJesusaves1-1/+1
2020-12-17Add a rudimentary command parser for server.Jesusaves1-2/+13
Right now, it can safely exit the program (w/o ctrl+c), broadcast to all clients, and ban an IP.
2020-12-17New function: security.score()Jesusaves1-0/+5
Whenever a bad packet is received or something, it adds a "score" to the conn. If it exceeds a certain threshold (5 for unauthed, 30 for authed users), the connection is killed and IP is blacklisted for BAN_TIME (default: 3 mins)
2020-12-17Move blacklist functions to security.pyJesusaves1-41/+3
2020-12-17Fix a few bugs and ignore the ban files.Jesusaves1-6/+15
2020-12-17Update README instructions, and fix the blacklist system to use dl_searchJesusaves1-1/+1
instead.
2020-12-17Add support for three blacklist filesJesusaves1-4/+37
But technicially, Z-Line and G-Line should be processed before
2020-12-16Initial protocol processing systemJesusaves1-9/+21
2020-12-16Import the good ol' SQL module.Jesusaves1-0/+7
2020-12-16Add utils for improved logging.Jesusaves1-11/+16
Add the placeholder JSONs from earlier.
2020-12-15Allow server to be run with SSL encryptationJesusaves1-4/+8
It is a hurdle in both Google Play Console as in Python-For-Android
2020-12-15Messages should always be a reply, never a global noticeJesusaves1-5/+1