fix: login failure on U17 (#1986)
Reviewed-on: OpenWF/SpaceNinjaServer#1986 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
							
								
									e2fe406017
								
							
						
					
					
						commit
						4e57bcd1ae
					
				@ -23,7 +23,8 @@ app.use((req, _res, next) => {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // U18 uses application/x-www-form-urlencoded even tho the data is JSON which Express doesn't like.
 | 
					    // U18 uses application/x-www-form-urlencoded even tho the data is JSON which Express doesn't like.
 | 
				
			||||||
    if (req.headers["content-type"] == "application/x-www-form-urlencoded") {
 | 
					    // U17 sets no Content-Type at all, which Express also doesn't like.
 | 
				
			||||||
 | 
					    if (!req.headers["content-type"] || req.headers["content-type"] == "application/x-www-form-urlencoded") {
 | 
				
			||||||
        req.headers["content-type"] = "application/octet-stream";
 | 
					        req.headers["content-type"] = "application/octet-stream";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -82,8 +82,11 @@ export const loginController: RequestHandler = async (request, response) => {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        if (account.Nonce && account.ClientType != "webui" && !account.Dropped && !loginRequest.kick) {
 | 
					        if (account.Nonce && account.ClientType != "webui" && !account.Dropped && !loginRequest.kick) {
 | 
				
			||||||
            response.status(400).json({ error: "nonce still set" });
 | 
					            // U17 seems to handle "nonce still set" like a login failure.
 | 
				
			||||||
            return;
 | 
					            if (version_compare(buildLabel, "2015.12.05.18.07") >= 0) {
 | 
				
			||||||
 | 
					                response.status(400).send({ error: "nonce still set" });
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        account.ClientType = loginRequest.ClientType;
 | 
					        account.ClientType = loginRequest.ClientType;
 | 
				
			||||||
 | 
				
			|||||||
@ -186,6 +186,7 @@ apiRouter.get("/getVendorInfo.php", getVendorInfoController);
 | 
				
			|||||||
apiRouter.get("/hub", hubController);
 | 
					apiRouter.get("/hub", hubController);
 | 
				
			||||||
apiRouter.get("/hubInstances", hubInstancesController);
 | 
					apiRouter.get("/hubInstances", hubInstancesController);
 | 
				
			||||||
apiRouter.get("/inbox.php", inboxController);
 | 
					apiRouter.get("/inbox.php", inboxController);
 | 
				
			||||||
 | 
					apiRouter.get("/getMessages.php", inboxController); // unsure if this is correct, but needed for U17
 | 
				
			||||||
apiRouter.get("/inventory.php", inventoryController);
 | 
					apiRouter.get("/inventory.php", inventoryController);
 | 
				
			||||||
apiRouter.get("/loginRewards.php", loginRewardsController);
 | 
					apiRouter.get("/loginRewards.php", loginRewardsController);
 | 
				
			||||||
apiRouter.get("/logout.php", logoutController);
 | 
					apiRouter.get("/logout.php", logoutController);
 | 
				
			||||||
@ -278,6 +279,7 @@ apiRouter.post("/playerSkills.php", playerSkillsController);
 | 
				
			|||||||
apiRouter.post("/postGuildAdvertisement.php", postGuildAdvertisementController);
 | 
					apiRouter.post("/postGuildAdvertisement.php", postGuildAdvertisementController);
 | 
				
			||||||
apiRouter.post("/projectionManager.php", projectionManagerController);
 | 
					apiRouter.post("/projectionManager.php", projectionManagerController);
 | 
				
			||||||
apiRouter.post("/purchase.php", purchaseController);
 | 
					apiRouter.post("/purchase.php", purchaseController);
 | 
				
			||||||
 | 
					apiRouter.post("/questControl.php", questControlController); // U17
 | 
				
			||||||
apiRouter.post("/redeemPromoCode.php", redeemPromoCodeController);
 | 
					apiRouter.post("/redeemPromoCode.php", redeemPromoCodeController);
 | 
				
			||||||
apiRouter.post("/releasePet.php", releasePetController);
 | 
					apiRouter.post("/releasePet.php", releasePetController);
 | 
				
			||||||
apiRouter.post("/removeFromGuild.php", removeFromGuildController);
 | 
					apiRouter.post("/removeFromGuild.php", removeFromGuildController);
 | 
				
			||||||
 | 
				
			|||||||
@ -744,6 +744,10 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
 | 
				
			|||||||
    // Omit void fissures for versions prior to Dante Unbound to avoid script errors.
 | 
					    // Omit void fissures for versions prior to Dante Unbound to avoid script errors.
 | 
				
			||||||
    if (buildLabel && version_compare(buildLabel, "2024.03.24.20.00") < 0) {
 | 
					    if (buildLabel && version_compare(buildLabel, "2024.03.24.20.00") < 0) {
 | 
				
			||||||
        worldState.ActiveMissions = [];
 | 
					        worldState.ActiveMissions = [];
 | 
				
			||||||
 | 
					        if (version_compare(buildLabel, "2017.10.12.17.04") < 0) {
 | 
				
			||||||
 | 
					            // Old versions seem to really get hung up on not being able to load these.
 | 
				
			||||||
 | 
					            worldState.PVPChallengeInstances = [];
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (config.worldState?.starDays) {
 | 
					    if (config.worldState?.starDays) {
 | 
				
			||||||
 | 
				
			|||||||
@ -12,6 +12,7 @@ export interface IWorldState {
 | 
				
			|||||||
    GlobalUpgrades: IGlobalUpgrade[];
 | 
					    GlobalUpgrades: IGlobalUpgrade[];
 | 
				
			||||||
    ActiveMissions: IFissure[];
 | 
					    ActiveMissions: IFissure[];
 | 
				
			||||||
    NodeOverrides: INodeOverride[];
 | 
					    NodeOverrides: INodeOverride[];
 | 
				
			||||||
 | 
					    PVPChallengeInstances: IPVPChallengeInstance[];
 | 
				
			||||||
    EndlessXpChoices: IEndlessXpChoice[];
 | 
					    EndlessXpChoices: IEndlessXpChoice[];
 | 
				
			||||||
    SeasonInfo: {
 | 
					    SeasonInfo: {
 | 
				
			||||||
        Activation: IMongoDate;
 | 
					        Activation: IMongoDate;
 | 
				
			||||||
@ -130,6 +131,21 @@ export interface ILiteSortie {
 | 
				
			|||||||
    }[];
 | 
					    }[];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export interface IPVPChallengeInstance {
 | 
				
			||||||
 | 
					    _id: IOid;
 | 
				
			||||||
 | 
					    challengeTypeRefID: string;
 | 
				
			||||||
 | 
					    startDate: IMongoDate;
 | 
				
			||||||
 | 
					    endDate: IMongoDate;
 | 
				
			||||||
 | 
					    params: {
 | 
				
			||||||
 | 
					        n: string; // "ScriptParamValue";
 | 
				
			||||||
 | 
					        v: number;
 | 
				
			||||||
 | 
					    }[];
 | 
				
			||||||
 | 
					    isGenerated: boolean;
 | 
				
			||||||
 | 
					    PVPMode: string;
 | 
				
			||||||
 | 
					    subChallenges: IOid[];
 | 
				
			||||||
 | 
					    Category: string; // "PVPChallengeTypeCategory_WEEKLY" | "PVPChallengeTypeCategory_WEEKLY_ROOT" | "PVPChallengeTypeCategory_DAILY";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IEndlessXpChoice {
 | 
					export interface IEndlessXpChoice {
 | 
				
			||||||
    Category: string;
 | 
					    Category: string;
 | 
				
			||||||
    Choices: string[];
 | 
					    Choices: string[];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user