mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-11 10:27:27 +08:00
[Enhance] Restrict download by user's purchase
- An option `DOWNLOAD_FORBID_WHEN_NO_ITEM` has been added to the config file to make that users cannot download the songs' files if they has not bought them when the `songlist` file exists. (Experimental) #128
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import binascii
|
||||
# import binascii
|
||||
import logging
|
||||
import socketserver
|
||||
import threading
|
||||
@@ -56,9 +56,13 @@ class UDP_handler(socketserver.BaseRequestHandler):
|
||||
|
||||
class TCP_handler(socketserver.StreamRequestHandler):
|
||||
def handle(self):
|
||||
self.data = self.rfile.readline().strip()
|
||||
try:
|
||||
self.data = self.rfile.readline().strip()
|
||||
message = self.data.decode('utf-8')
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
return None
|
||||
|
||||
message = self.data.decode('utf-8')
|
||||
if Config.DEBUG:
|
||||
logging.info(f'TCP-From-{self.client_address[0]}-{message}')
|
||||
data = message.split('|')
|
||||
|
||||
Reference in New Issue
Block a user