forked from Hay1tsme/artemis
refactor(core): Remove game ID whitelist logic in ALLNET authentication
- Removed the code related to game ID whitelist validation - Simplified the ALLNET authentication process - This change does not affect game authentication in the development environment and should be considered a bugfix
This commit is contained in:
@ -450,28 +450,6 @@ class AllnetServlet:
|
||||
resp_dict = {k: v for k, v in vars(resp).items() if v is not None}
|
||||
self.logger.debug(f"Allnet response: {resp_dict}")
|
||||
|
||||
return PlainTextResponse(self.to_cn_response(resp_dict, cryptor))
|
||||
elif self.config.allnet.enable_game_id_whitelist and req.game_id not in self.config.allnet.game_id_whitelist:
|
||||
if not self.config.server.is_develop:
|
||||
msg = f"Disallowed game {req.game_id} attempted allnet auth from {request_ip}."
|
||||
await self.data.base.log_event(
|
||||
"allnet", "ALLNET_AUTH_DISALLOWED_GAME", logging.WARN, msg
|
||||
)
|
||||
self.logger.warning(msg)
|
||||
|
||||
resp.stat = ALLNET_STAT.bad_game.value
|
||||
resp_dict = {k: v for k, v in vars(resp).items() if v is not None}
|
||||
self.logger.debug(f"Allnet response: {resp_dict}")
|
||||
|
||||
return PlainTextResponse(self.to_cn_response(resp_dict, cryptor))
|
||||
else:
|
||||
self.logger.info(
|
||||
f"Allowed the game {req.game_id} v{req.ver} to authenticate which was disallowed from {request_ip} due to 'is_develop' being enabled. S/N: {req.serial}"
|
||||
)
|
||||
resp.uri1 = f"http://{self.config.server.hostname}:{self.config.server.port}/{req.game_id}/{req.ver.replace('.', '')}/"
|
||||
resp_dict = {k: v for k, v in vars(resp).items() if v is not None}
|
||||
self.logger.debug(f"Allnet response: {resp_dict}")
|
||||
|
||||
return PlainTextResponse(self.to_cn_response(resp_dict, cryptor))
|
||||
|
||||
int_ver = req.ver.replace(".", "")
|
||||
|
Reference in New Issue
Block a user