forked from OpenWF/SpaceNinjaServer
		
	fix: login failure on U32 veilbreaker (#1932)
Reviewed-on: OpenWF/SpaceNinjaServer#1932 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									7d02906656
								
							
						
					
					
						commit
						2c3043f40e
					
				@ -7,6 +7,7 @@ import { Account } from "@/src/models/loginModel";
 | 
				
			|||||||
import { createAccount, isCorrectPassword, isNameTaken } from "@/src/services/loginService";
 | 
					import { createAccount, isCorrectPassword, isNameTaken } from "@/src/services/loginService";
 | 
				
			||||||
import { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "@/src/types/loginTypes";
 | 
					import { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "@/src/types/loginTypes";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					import { logger } from "@/src/utils/logger";
 | 
				
			||||||
 | 
					import { version_compare } from "@/src/services/worldStateService";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const loginController: RequestHandler = async (request, response) => {
 | 
					export const loginController: RequestHandler = async (request, response) => {
 | 
				
			||||||
    const loginRequest = JSON.parse(String(request.body)) as ILoginRequest; // parse octet stream of json data to json object
 | 
					    const loginRequest = JSON.parse(String(request.body)) as ILoginRequest; // parse octet stream of json data to json object
 | 
				
			||||||
@ -94,7 +95,7 @@ export const loginController: RequestHandler = async (request, response) => {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, buildLabel: string): ILoginResponse => {
 | 
					const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, buildLabel: string): ILoginResponse => {
 | 
				
			||||||
    return {
 | 
					    const resp: ILoginResponse = {
 | 
				
			||||||
        id: account.id,
 | 
					        id: account.id,
 | 
				
			||||||
        DisplayName: account.DisplayName,
 | 
					        DisplayName: account.DisplayName,
 | 
				
			||||||
        CountryCode: account.CountryCode,
 | 
					        CountryCode: account.CountryCode,
 | 
				
			||||||
@ -108,11 +109,14 @@ const createLoginResponse = (myAddress: string, account: IDatabaseAccountJson, b
 | 
				
			|||||||
        Nonce: account.Nonce,
 | 
					        Nonce: account.Nonce,
 | 
				
			||||||
        Groups: [],
 | 
					        Groups: [],
 | 
				
			||||||
        IRC: config.myIrcAddresses ?? [myAddress],
 | 
					        IRC: config.myIrcAddresses ?? [myAddress],
 | 
				
			||||||
        platformCDNs: [`https://${myAddress}/`],
 | 
					 | 
				
			||||||
        HUB: `https://${myAddress}/api/`,
 | 
					        HUB: `https://${myAddress}/api/`,
 | 
				
			||||||
        NRS: config.NRS,
 | 
					        NRS: config.NRS,
 | 
				
			||||||
        DTLS: 99,
 | 
					        DTLS: 99,
 | 
				
			||||||
        BuildLabel: buildLabel,
 | 
					        BuildLabel: buildLabel,
 | 
				
			||||||
        MatchmakingBuildId: buildConfig.matchmakingBuildId
 | 
					        MatchmakingBuildId: buildConfig.matchmakingBuildId
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					    if (version_compare(buildLabel, "2023.04.25.23.40") >= 0) {
 | 
				
			||||||
 | 
					        resp.platformCDNs = [`https://${myAddress}/`];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return resp;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user