@jetthai/cuora 1.0.16 → 1.0.18

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,10 @@
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.18](https://github.com/jetthai/cuora-module/compare/v1.0.17...v1.0.18) (2021-08-20)
6
+
7
+ ### [1.0.17](https://github.com/jetthai/cuora-module/compare/v1.0.16...v1.0.17) (2021-08-19)
8
+
5
9
  ### [1.0.16](https://github.com/jetthai/cuora-module/compare/v1.0.15...v1.0.16) (2021-08-17)
6
10
 
7
11
  ### [1.0.15](https://github.com/jetthai/cuora-module/compare/v1.0.14...v1.0.15) (2021-08-17)
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1",
8
- "release": "standard-version",
9
- "push": "git push --follow-tags origin master && npm publish"
8
+ "release": "standard-version && git push --follow-tags origin master && npm publish"
10
9
  },
11
10
  "repository": {
12
11
  "type": "git",
package/plugin/game.js CHANGED
@@ -367,6 +367,31 @@ 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, lang = 'en_US'}) {
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
+ lang: lang.replace('-', '_'),
388
+ // todo - set temporarily
389
+ // return_url: returnProviders.includes(game.provider) ? `${window.location.origin}/return` : window.location.href, // For providers to return.
390
+ return_url: window.location.href
391
+ }
392
+ const { redirect_url } = await $request.send(api.playGame(params))
393
+ return redirect_url
394
+ },
370
395
  async play({ getters, rootGetters, commit, dispatch }, { game, isDemo = false }) {
371
396
  try {
372
397
  if (
@@ -375,7 +400,9 @@ function createStore({ $request }) {
375
400
  game.system_enable !== 0 &&
376
401
  (await dispatch('core/checkVerification', null, { root: true })) === true
377
402
  ) {
403
+ // 和遊戲商連線時畫面
378
404
  commit('gameMatching', true)
405
+
379
406
  const returnProviders = ['RSG', 'KP', 'EPICWIN', 'KA']
380
407
  const lang = rootGetters['core/getLocale'](
381
408
  { shorthand: getters.getLocale, isUnderline: true },