pushing news support customization for chunithm
This commit is contained in:
		| @ -65,6 +65,7 @@ Config file is located in `config/chuni.yaml`. | |||||||
|  |  | ||||||
| | Option           | Info                                                                                                           | | | Option           | Info                                                                                                           | | ||||||
| |------------------|----------------------------------------------------------------------------------------------------------------| | |------------------|----------------------------------------------------------------------------------------------------------------| | ||||||
|  | | `news_msg`       | If this is set, the news at the top of the main screen will be displayed (up to Chunithm Paradise Lost)        | | ||||||
| | `name`           | If this is set, all players that are not on a team will use this one by default.                               | | | `name`           | If this is set, all players that are not on a team will use this one by default.                               | | ||||||
| | `rank_scale`     | Scales the in-game ranking based on the number of teams within the database                                    | | | `rank_scale`     | Scales the in-game ranking based on the number of teams within the database                                    | | ||||||
| | `use_login_bonus`| This is used to enable the login bonuses                                                                       | | | `use_login_bonus`| This is used to enable the login bonuses                                                                       | | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| server: | server: | ||||||
|   enable: True |   enable: True | ||||||
|   loglevel: "info" |   loglevel: "info" | ||||||
|  |   news_msg: "" | ||||||
|  |  | ||||||
| team: | team: | ||||||
|   name: ARTEMiS # If this is set, all players that are not on a team will use this one by default. |   name: ARTEMiS # If this is set, all players that are not on a team will use this one by default. | ||||||
|  | |||||||
| @ -181,7 +181,17 @@ class ChuniBase: | |||||||
|         return {"type": data["type"], "length": 0, "gameIdlistList": []} |         return {"type": data["type"], "length": 0, "gameIdlistList": []} | ||||||
|  |  | ||||||
|     def handle_get_game_message_api_request(self, data: Dict) -> Dict: |     def handle_get_game_message_api_request(self, data: Dict) -> Dict: | ||||||
|         return {"type": data["type"], "length": "0", "gameMessageList": []} |         return { | ||||||
|  |             "type": data["type"],  | ||||||
|  |             "length": 1,  | ||||||
|  |             "gameMessageList": [{  | ||||||
|  |                 "id": 1,  | ||||||
|  |                 "type": 1, | ||||||
|  |                 "message": f"Welcome to {self.core_cfg.server.name} network!" if not self.game_config.server.news_msg else self.game_config.server.news_msg, | ||||||
|  |                 "startDate": "2017-12-05 07:00:00.0", | ||||||
|  |                 "endDate": "2099-12-31 00:00:00.0" | ||||||
|  |             }] | ||||||
|  |         } | ||||||
|  |  | ||||||
|     def handle_get_game_ranking_api_request(self, data: Dict) -> Dict: |     def handle_get_game_ranking_api_request(self, data: Dict) -> Dict: | ||||||
|         return {"type": data["type"], "gameRankingList": []} |         return {"type": data["type"], "gameRankingList": []} | ||||||
|  | |||||||
| @ -19,6 +19,12 @@ class ChuniServerConfig: | |||||||
|                 self.__config, "chuni", "server", "loglevel", default="info" |                 self.__config, "chuni", "server", "loglevel", default="info" | ||||||
|             ) |             ) | ||||||
|         ) |         ) | ||||||
|  |          | ||||||
|  |     @property | ||||||
|  |     def news_msg(self) -> str: | ||||||
|  |         CoreConfig.get_config_field( | ||||||
|  |             self.__config, "chuni", "server", "news_msg", default="" | ||||||
|  |         ) | ||||||
|  |  | ||||||
|  |  | ||||||
| class ChuniTeamConfig: | class ChuniTeamConfig: | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user