Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f1c0800544 | |||
| 0029d82b19 | |||
| a45298708d |
@ -19,7 +19,9 @@ jobs:
|
|||||||
echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
|
echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
|
||||||
- name: npm i
|
- name: npm i
|
||||||
run: |
|
run: |
|
||||||
|
echo 'npm i'
|
||||||
npm i
|
npm i
|
||||||
|
echo "✅ npm i done"
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
echo 'build'
|
echo 'build'
|
||||||
|
|||||||
@ -1160,7 +1160,7 @@
|
|||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": -70,
|
"y": -83.523,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"_lrot": {
|
"_lrot": {
|
||||||
@ -1201,7 +1201,7 @@
|
|||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 167.19189453125,
|
"width": 167.19189453125,
|
||||||
"height": 54.18
|
"height": 80
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
@ -1243,7 +1243,7 @@
|
|||||||
"_fontSize": 43,
|
"_fontSize": 43,
|
||||||
"_fontFamily": "Arial",
|
"_fontFamily": "Arial",
|
||||||
"_lineHeight": 43,
|
"_lineHeight": 43,
|
||||||
"_overflow": 0,
|
"_overflow": 2,
|
||||||
"_enableWrapText": true,
|
"_enableWrapText": true,
|
||||||
"_font": null,
|
"_font": null,
|
||||||
"_isSystemFontUsed": true,
|
"_isSystemFontUsed": true,
|
||||||
|
|||||||
@ -416,25 +416,25 @@ export class SlotBar extends Component {
|
|||||||
if (this.isGetBalance) return
|
if (this.isGetBalance) return
|
||||||
this.isGetBalance = true;
|
this.isGetBalance = true;
|
||||||
try {
|
try {
|
||||||
let balacneData = await callGameBalanceApi({ GameId: getGameId() });
|
let balacneData = await this.refreshBalanceFromServer();
|
||||||
this.setBalance(balacneData.Balance)
|
this.setBalance(balacneData)
|
||||||
return balacneData.Balance;
|
return balacneData;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('获取余额失败')
|
console.log('获取余额失败')
|
||||||
return null;
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
this.scheduleOnce(() => {
|
this.scheduleOnce(() => {
|
||||||
this.isGetBalance = false;
|
this.isGetBalance = false;
|
||||||
}, 1)
|
}, 0.5)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async onConfirmErr2(): Promise<number | null> {
|
async onConfirmErr2(): Promise<number | null> {
|
||||||
try {
|
try {
|
||||||
let balacneData = await callGameBalanceApi({ GameId: getGameId() });
|
let balacneData = await this.refreshBalanceFromServer();
|
||||||
this.setBalance(balacneData.Balance)
|
this.setBalance(balacneData)
|
||||||
return balacneData.Balance;
|
return balacneData;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('获取余额失败')
|
console.log('获取余额失败')
|
||||||
return null;
|
return null;
|
||||||
@ -809,5 +809,27 @@ export class SlotBar extends Component {
|
|||||||
this.setBet(this.betGrade[this.betIndex], true);
|
this.setBet(this.betGrade[this.betIndex], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// private _refreshingBalance: boolean = false;
|
||||||
|
async refreshBalanceFromServer(): Promise<number | null> {
|
||||||
|
// if (this._refreshingBalance) return this.getBalance();
|
||||||
|
// this._refreshingBalance = true;
|
||||||
|
try {
|
||||||
|
const res = await callGameBalanceApi({});
|
||||||
|
const balance = Number(res.Balance);
|
||||||
|
if (!Number.isFinite(balance)) {
|
||||||
|
console.warn("[SlotBar] invalid balance response:", res);
|
||||||
|
return this.getBalance();
|
||||||
|
}
|
||||||
|
this.setBalance(balance);
|
||||||
|
return balance;
|
||||||
|
} catch (err) {
|
||||||
|
console.error("[SlotBar] refresh balance failed:", err);
|
||||||
|
return this.getBalance();
|
||||||
|
} finally {
|
||||||
|
// this.scheduleOnce(() => {
|
||||||
|
// this._refreshingBalance = false;
|
||||||
|
// }, 1)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -239,12 +239,11 @@ export class SlotScene extends Component {
|
|||||||
this.slotBar.setWin(0);
|
this.slotBar.setWin(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let curBalanceData = await callGameBalanceApi({ GameId: getGameId() })
|
let curBalanceData = await this.slotBar.refreshBalanceFromServer()
|
||||||
let curBalance = curBalanceData.Balance
|
if (!curBalanceData) {
|
||||||
if (!curBalance) {
|
curBalanceData = this.slotBar.getBalance()
|
||||||
curBalance = this.slotBar.getBalance()
|
|
||||||
}
|
}
|
||||||
if (curBalance < (isFeatureBuy ? this.slotBar.getBet() * this.gameInfo.BuyMul : this.slotBar.getBet()) && !isFreeSpin && !GameDataManager.instance.frb.Ongoing) {
|
if (curBalanceData < (isFeatureBuy ? this.slotBar.getBet() * this.gameInfo.BuyMul : this.slotBar.getBet()) && !isFreeSpin && !GameDataManager.instance.frb.Ongoing) {
|
||||||
//余额不足不经过服务器,在客户端拦截
|
//余额不足不经过服务器,在客户端拦截
|
||||||
this.showErrorTip(2, () => { this.slotBar.onConfirmErr2() });
|
this.showErrorTip(2, () => { this.slotBar.onConfirmErr2() });
|
||||||
this.handleErrSpin(true);
|
this.handleErrSpin(true);
|
||||||
|
|||||||
@ -187,7 +187,7 @@
|
|||||||
"_priority": 0,
|
"_priority": 0,
|
||||||
"_fov": 45,
|
"_fov": 45,
|
||||||
"_fovAxis": 0,
|
"_fovAxis": 0,
|
||||||
"_orthoHeight": 959.9999999999999,
|
"_orthoHeight": 960,
|
||||||
"_near": 0,
|
"_near": 0,
|
||||||
"_far": 2000,
|
"_far": 2000,
|
||||||
"_color": {
|
"_color": {
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import { _decorator, Node, Component, screen, view, ResolutionPolicy, Sprite, sys, Label, Widget, Vec3, UITransform } from 'cc';
|
import { _decorator, Node, Component, screen, view, ResolutionPolicy, Sprite, sys, Label, Widget, Vec3, UITransform } from 'cc';
|
||||||
import { LocalizedLabel } from './i18n/LocalizedLabel';
|
import { LocalizedLabel } from './i18n/LocalizedLabel';
|
||||||
import { getLanguage } from './comm';
|
import { getLanguage } from './comm';
|
||||||
|
import { installLabelAlignmentCenterFix } from 'common_tools';
|
||||||
|
|
||||||
|
installLabelAlignmentCenterFix();
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
export let SWITCH_PROTRAIT_MODE = {
|
export let SWITCH_PROTRAIT_MODE = {
|
||||||
"da": "Skift venligst til portrættilstand",
|
"da": "Skift venligst til portrættilstand",
|
||||||
|
|||||||
@ -9,7 +9,7 @@ const qs = new URLSearchParams(location.search)
|
|||||||
|
|
||||||
// let apiaddr = "https://rpgames-api.rpfafafahkdev.com";
|
// let apiaddr = "https://rpgames-api.rpfafafahkdev.com";
|
||||||
let apiaddr = "";
|
let apiaddr = "";
|
||||||
let token = "eyJQIjoxMDA5NDksIkUiOjE3ODExODc3NjIsIlMiOjEwMDAsIkQiOiJycF8xMDAxMiJ9.5v087Lt--ozENIV6Rdvga9nZVc2bzxf11iJAbG5x8gM";
|
let token = "eyJQIjoxMDA5NDksIkUiOjE3ODI3NjA2MTIsIlMiOjEwMDQsIkQiOiJycF8xMDAxMiJ9.f8r8mMsNIh9XSXq-Ni_h2KRw4EBDu9pTWIfwAQw7O7U";
|
||||||
let language = "en"
|
let language = "en"
|
||||||
let currency = "THB"
|
let currency = "THB"
|
||||||
let isfrom = null
|
let isfrom = null
|
||||||
|
|||||||
6
package-lock.json
generated
6
package-lock.json
generated
@ -9,9 +9,15 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"common_tools": "git+ssh://git@gitea.rpfafafahkdev.com:taotao/common_tools.git",
|
||||||
"nosleep.js": "^0.12.0"
|
"nosleep.js": "^0.12.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/common_tools": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "git+ssh://git@gitea.rpfafafahkdev.com:taotao/common_tools.git#c49bf2990a6f348489505ac4998683c814b58dde",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/nosleep.js": {
|
"node_modules/nosleep.js": {
|
||||||
"version": "0.12.0",
|
"version": "0.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz",
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"common_tools": "git+ssh://git@gitea.rpfafafahkdev.com:taotao/common_tools.git",
|
||||||
"nosleep.js": "^0.12.0"
|
"nosleep.js": "^0.12.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user