This commit is contained in:
25
New-project/tdv_sdk.js
Normal file
25
New-project/tdv_sdk.js
Normal file
@@ -0,0 +1,25 @@
|
||||
(function () {
|
||||
// Default game code
|
||||
var DEFAULT_GAME_CODE = 'G2510S1T30';
|
||||
|
||||
var gameCode = DEFAULT_GAME_CODE;
|
||||
|
||||
// 1️⃣ Trường hợp: ?gid=G2510S1T30
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
if (params.has('gid')) {
|
||||
gameCode = params.get('gid');
|
||||
}
|
||||
|
||||
// 2️⃣ Trường hợp: ?G2510S1T30 (không key)
|
||||
else if (window.location.search.length > 1) {
|
||||
var raw = window.location.search.substring(1);
|
||||
if (/^G\d+/.test(raw)) {
|
||||
gameCode = raw;
|
||||
}
|
||||
}
|
||||
|
||||
// Expose globally
|
||||
window.SENA_GAME_CODE = gameCode;
|
||||
|
||||
console.log('[SENA] Game code detected:', gameCode);
|
||||
})();
|
||||
Reference in New Issue
Block a user