diff --git a/src/app/modules/beteran/component/home.component.ts b/src/app/modules/beteran/component/home.component.ts index afed1e6..5270938 100644 --- a/src/app/modules/beteran/component/home.component.ts +++ b/src/app/modules/beteran/component/home.component.ts @@ -25,6 +25,7 @@ import { VendorService } from 'app/modules/polyglot/api/services/vendor.service' import { ListGamesResponse } from 'app/modules/proto/c2se/api/game_pb'; import { Game } from 'app/modules/proto/models/api/game_pb'; import { Vendor } from 'app/modules/proto/models/api/vendor_pb'; +import { environment } from 'environments/environment'; import { ModifyMemberComposeComponent } from '../compose/compose/modify-member-compose.component'; import { SlotGameComposeComponent } from '../compose/compose/slot-game-compose.component'; @@ -263,28 +264,52 @@ export class HomeComponent implements OnInit { return; } - const game = gameList[0]; + let gameKey = ''; + const constKey = environment.constants.casinoGameKey; + + switch (vendor.getKey()) { + case 'evolution_casino': + gameKey = constKey.evolution; + break; + case 'pragmatic_casino': + gameKey = constKey.pragmatic; + break; + case 'cq9_casino': + gameKey = constKey.cq9; + break; + case 'skywind_casino': + gameKey = constKey.skywind; + break; + case 'wm_casino': + gameKey = constKey.wm; + break; + case 'duwon_casino': + gameKey = constKey.duwon; + break; + case 'bg_casino': + gameKey = constKey.bg; + break; + case 'oriental_casino': + gameKey = constKey.oriental; + break; + default: + break; + } + + if (gameKey === '') { + gameKey = gameList[0].getKey(); + } let r = this.__gameService - .getGameUrl(vendor.getKey(), game.getKey()) + .getGameUrl(vendor.getKey(), gameKey) .then((r) => { console.log('success', r.getUrl()); this.openGameWindow(r.getUrl()); - // window.open( - // r.getUrl(), - // 'gamepopup', - // 'width=1400, height=900, toolbar=no, menubar=no, scrollbars=no, resizable=yes' - // ); }) .catch((e) => { console.log('fail', e); }); }); - // window.open( - // '/game/?vendor_key=pragmatic_casino&game_key=101', - // 'gamepopup', - // 'width=1400, height=900, toolbar=no, menubar=no, scrollbars=no, resizable=yes' - // ); } } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 5a2a8b7..10e77b0 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -11,4 +11,16 @@ export const environment: Environment = { // servers: ['ws://30.20.0.149:8088'], }, }, + constants: { + casinoGameKey: { + evolution: 'top_games', + pragmatic: '101', + cq9: 'ca01', + skywind: '', + wm: '', + duwon: '', + bg: '', + oriental: '', + }, + }, }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index c8cd57b..6a1d1dc 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -15,6 +15,18 @@ export const environment: Environment = { // servers: ['ws://30.20.0.149:8088'], }, }, + constants: { + casinoGameKey: { + evolution: 'top_games', + pragmatic: '101', + cq9: 'ca01', + skywind: '', + wm: '', + duwon: '', + bg: '', + oriental: '', + }, + }, }; /* diff --git a/src/environments/environment.type.ts b/src/environments/environment.type.ts index fc344ad..c8a9ea8 100644 --- a/src/environments/environment.type.ts +++ b/src/environments/environment.type.ts @@ -5,4 +5,16 @@ export interface Environment { nats: { connectionOptions: nats.ConnectionOptions; }; + constants: { + casinoGameKey: { + evolution: string; + pragmatic: string; + cq9: string; + skywind: string; + wm: string; + duwon: string; + bg: string; + oriental: string; + }; + }; }