mirror of
https://github.com/barronwaffles/dwc_network_server_emulator.git
synced 2026-09-26 20:07:39 -05:00
Tried to match original server's return values
The original server returns uppercase only in these areas it seems, so emulate that.
This commit is contained in:
@@ -76,7 +76,7 @@ class Gamestats(LineReceiver):
|
||||
self.log(logging.INFO, "Received connection from %s:%d" % (self.address.host, self.address.port))
|
||||
|
||||
# Generate a random challenge string
|
||||
self.challenge = utils.generate_random_str(10)
|
||||
self.challenge = utils.generate_random_str(10, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
|
||||
# The first command sent to the client is always a login challenge containing the server challenge key.
|
||||
msg_d = []
|
||||
|
||||
@@ -92,7 +92,7 @@ class PlayerSession(LineReceiver):
|
||||
self.session = ""
|
||||
|
||||
# Generate a random challenge string
|
||||
self.challenge = utils.generate_random_str(8)
|
||||
self.challenge = utils.generate_random_str(8, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
|
||||
# The first command sent to the client is always a login challenge containing the server challenge key.
|
||||
msg_d = []
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import random
|
||||
import logging
|
||||
|
||||
def generate_random_str(len):
|
||||
return ''.join(random.choice("abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890") for _ in range(len))
|
||||
def generate_random_str(len, set = "abcdefghjiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"):
|
||||
return ''.join(random.choice(set) for _ in range(len))
|
||||
|
||||
def generate_random_number_str(len):
|
||||
return ''.join(random.choice("1234567890") for _ in range(len))
|
||||
|
||||
Reference in New Issue
Block a user