fixed trackme not working correctly

This commit is contained in:
cnachtigall1991
2021-10-13 18:37:37 +02:00
parent 66c18ffe02
commit 38289b4091
2 changed files with 14 additions and 14 deletions

View File

@@ -17,12 +17,12 @@ export const TrackMe = async (id64, authcode, sharecode) => {
const shareCodeRegex = /^CSGO(?:-?[ABCDEFGHJKLMNOPQRSTUVWXYZabcdefhijkmnopqrstuvwxyz23456789]{5}){5}$/ const shareCodeRegex = /^CSGO(?:-?[ABCDEFGHJKLMNOPQRSTUVWXYZabcdefhijkmnopqrstuvwxyz23456789]{5}){5}$/
const authCodeRegex = /^[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{4}-[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{5}-[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{4}$/ const authCodeRegex = /^[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{4}-[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{5}-[ABCDEFGHJKLMNOPQRSTUVWXYZ23456789]{4}$/
if (!shareCodeRegex.test(sharecode)) { if (sharecode && !shareCodeRegex.test(sharecode)) {
statusError = 'Is not a valid sharecode' statusError = 'Is not a valid sharecode'
status = 418 status = 418
return [status, statusError] return [status, statusError]
} }
if (!authCodeRegex.test(authcode)) { if (authcode === '' || !authCodeRegex.test(authcode)) {
statusError = 'Is not a valid authcode' statusError = 'Is not a valid authcode'
status = 418 status = 418
return [status, statusError] return [status, statusError]

View File

@@ -44,13 +44,13 @@
</td> </td>
</tr> </tr>
</table> </table>
<div v-if="data.statusErrorCode === 200" class="alert alert-success" role="alert"> <div v-if="data.statusErrorCode === 202" class="alert alert-success" role="alert">
{{ data.statusError }} {{ data.statusError }}
</div> </div>
<div v-if="data.statusErrorCode === 418" class="alert alert-warning" role="alert"> <div v-if="data.statusErrorCode === 418" class="alert alert-warning" role="alert">
{{ data.statusError }} {{ data.statusError }}
</div> </div>
<div v-if="data.statusErrorCode !== 0 && data.statusErrorCode !== 200 && data.statusErrorCode !== 418" <div v-if="data.statusErrorCode !== 0 && data.statusErrorCode !== 202 && data.statusErrorCode !== 418"
class="alert alert-danger" class="alert alert-danger"
role="alert"> role="alert">
{{ data.statusError }} {{ data.statusError }}
@@ -279,6 +279,7 @@ export default {
} }
const TrackPlayer = async () => { const TrackPlayer = async () => {
if (data.userData.authcode !== '') {
[data.statusErrorCode, data.statusError] = await TrackMe(data.playerDetails.steamid64, data.userData.authcode, data.userData.sharecode) [data.statusErrorCode, data.statusError] = await TrackMe(data.playerDetails.steamid64, data.userData.authcode, data.userData.sharecode)
setTimeout(() => { setTimeout(() => {
@@ -287,9 +288,8 @@ export default {
data.statusError = '' data.statusError = ''
data.tracked = true data.tracked = true
} }
}, 5000)
window.location.reload() }
}, 2000)
} }
onMounted(() => { onMounted(() => {