Fix a problem where the players initials were not going to the correct place in the global high score request. Make the set high score request message a multiple of 2. It seems that the hash functions do not agree between the GS and the server when the request is an odd number of bytes.

This commit is contained in:
Jeremy Rand 2021-06-02 00:33:53 -04:00
parent 35930c72e2
commit 14cbdbac2b
2 changed files with 6 additions and 2 deletions

View File

@ -53,7 +53,7 @@ typedef struct tSetHighScoreRequest {
uint16_t requestType;
char who[4];
uint32_t score;
Boolean is60Hz;
Word is60Hz;
} tSetHighScoreRequest;
@ -421,6 +421,7 @@ void pollNetwork(void)
TCPIPLogout(ipid);
gameNetworkState = GAME_NETWORK_PROTOCOL_FAILED;
}
// TODO - I don't think we are getting out of this state successfully...
globalScoreAge = 0;
gameNetworkState = GAME_NETWORK_REQUEST_SCORES;

View File

@ -738,7 +738,6 @@ checkHighScore_isValid anop
cpx #GAME_NUM_TILES_WIDE*18+26
bge checkHighScore_isInvalid
sta settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_WHO_OFFSET,y
sta setHighScoreRequest+2,y
iny
jsl asciiToTileType
jsr overwriteGameTile
@ -769,6 +768,10 @@ checkHighScore_isInvalid anop
bra checkHighScore_nextKey
checkHighScore_doneInitials anop
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_WHO_OFFSET-3,y
sta setHighScoreRequest+2
lda settings+SETTINGS_HIGH_SCORE_OFFSET+HIGH_SCORE_WHO_OFFSET-1,y
sta setHighScoreRequest+4
jsl saveSettings
jsl sendHighScore
jsl updateHighScore