XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

chore: cleanup config (#979)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/979 Co-authored-by: Ordis <134585663+OrdisPrime@users.noreply.github.com> Co-committed-by: Ordis <134585663+OrdisPrime@users.noreply.github.com>

78548a2e
Ordis <134585663+OrdisPrime@users.noreply.github.com>
提交于

代码差异

4 个文件 +11 -33
Modified config.json.example +3 -0
@@ -5,6 +5,9 @@
5 5 "level": "trace"
6 6 },
7 7 "myAddress": "localhost",
8 "hubAddress": "https://localhost/api/",
9 "platformCDNs": ["https://localhost/"],
10 "NRS": ["localhost"],
8 11 "httpPort": 80,
9 12 "httpsPort": 443,
10 13 "administratorNames": [],
Modified src/controllers/api/loginController.ts +5 -6
@@ -6,7 +6,6 @@ import { buildConfig } from "@/src/services/buildConfigService";
6 6 import { Account } from "@/src/models/loginModel";
7 7 import { createAccount, isCorrectPassword, isNameTaken } from "@/src/services/loginService";
8 8 import { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "@/src/types/loginTypes";
9 import { DTLS, groups, HUB, platformCDNs } from "@/static/fixed_responses/login_static";
10 9 import { logger } from "@/src/utils/logger";
11 10
12 11 export const loginController: RequestHandler = async (request, response) => {
@@ -84,12 +83,12 @@ const createLoginResponse = (account: IDatabaseAccountJson, buildLabel: string):
84 83 ConsentNeeded: account.ConsentNeeded,
85 84 TrackedSettings: account.TrackedSettings,
86 85 Nonce: account.Nonce,
87 Groups: groups,
88 platformCDNs: platformCDNs,
89 NRS: [config.myAddress],
90 DTLS: DTLS,
86 Groups: [],
91 87 IRC: config.myIrcAddresses ?? [config.myAddress],
92 HUB: HUB,
88 platformCDNs: config.platformCDNs,
89 HUB: config.hubAddress,
90 NRS: config.NRS,
91 DTLS: 99,
93 92 BuildLabel: buildLabel,
94 93 MatchmakingBuildId: buildConfig.matchmakingBuildId
95 94 };
Modified src/services/configService.ts +3 -0
@@ -33,6 +33,9 @@ interface IConfig {
33 33 httpPort?: number;
34 34 httpsPort?: number;
35 35 myIrcAddresses?: string[];
36 platformCDNs: string[];
37 hubAddress: string;
38 NRS: string[];
36 39 administratorNames?: string[] | string;
37 40 autoCreateAccount?: boolean;
38 41 skipTutorial?: boolean;
Deleted static/fixed_responses/login_static.ts +0 -27
@@ -1,27 +0,0 @@
1 import { IGroup } from "@/src/types/loginTypes";
2
3 export const groups: IGroup[] = [
4 {
5 experiment: "InitiatePage",
6 experimentGroup: "initiate_page_no_video"
7 },
8 { experiment: "ChatQAChannel", experimentGroup: "control" },
9 {
10 experiment: "MarketSearchRecommendations",
11 experimentGroup: "premium_credit_purchases_14_days"
12 },
13 { experiment: "SurveyLocation", experimentGroup: "EXIT" },
14 { experiment: "GamesightAB", experimentGroup: "a" }
15 ];
16
17 export const platformCDNs = [
18 "https://content.warframe.com/",
19 "https://content-xb1.warframe.com/",
20 "https://content-ps4.warframe.com/",
21 "https://content-swi.warframe.com/",
22 "https://content-mob.warframe.com/"
23 ];
24
25 export const DTLS = 99;
26
27 export const HUB = "https://arbiter.warframe.com/api/";