@jetthai/cuora 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.0.17](https://github.com/jetthai/cuora-module/compare/v1.0.16...v1.0.17) (2021-08-19)
6
+
5
7
  ### [1.0.16](https://github.com/jetthai/cuora-module/compare/v1.0.15...v1.0.16) (2021-08-17)
6
8
 
7
9
  ### [1.0.15](https://github.com/jetthai/cuora-module/compare/v1.0.14...v1.0.15) (2021-08-17)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin/game.js CHANGED
@@ -367,6 +367,32 @@ function createStore({ $request }) {
367
367
  commit('setCurrentProvider', null)
368
368
  commit('setCurrentGameId', null)
369
369
  },
370
+ // fnc
371
+ async disconnectGame({rootGetters}, provider) {
372
+ const uid_site = rootGetters['user/userInfo'].uid_site
373
+ return $request.send(api.logoutGame({ uid_site, provider_id: provider }))
374
+ },
375
+ // fnc
376
+ async connectGame({}, game) {
377
+ const {provider, game_id, game_type, mapping_id} = game
378
+ const params = {
379
+ provider_id: provider,
380
+ game_id: game_id,
381
+ gametype_id: game_type,
382
+ mapping_id: mapping_id,
383
+ is_demo: false,
384
+ // todo - set false temporarily
385
+ // is_mobile: rootGetters['core/isMobileDevice'],
386
+ is_mobile: false,
387
+ // todo - set en_US temporarily
388
+ lang: 'en_US',
389
+ // todo - set temporarily
390
+ // return_url: returnProviders.includes(game.provider) ? `${window.location.origin}/return` : window.location.href, // For providers to return.
391
+ return_url: window.location.href
392
+ }
393
+ const { redirect_url } = await $request.send(api.playGame(params))
394
+ return redirect_url
395
+ },
370
396
  async play({ getters, rootGetters, commit, dispatch }, { game, isDemo = false }) {
371
397
  try {
372
398
  if (
@@ -375,7 +401,9 @@ function createStore({ $request }) {
375
401
  game.system_enable !== 0 &&
376
402
  (await dispatch('core/checkVerification', null, { root: true })) === true
377
403
  ) {
404
+ // 和遊戲商連線時畫面
378
405
  commit('gameMatching', true)
406
+
379
407
  const returnProviders = ['RSG', 'KP', 'EPICWIN', 'KA']
380
408
  const lang = rootGetters['core/getLocale'](
381
409
  { shorthand: getters.getLocale, isUnderline: true },