<?php

use App\Game\Config\GameBasicConfig;
use Illuminate\Support\Facades\Route;

Route::any('/client_log/record', 'Game\ClientLogController@recordLog');

Route::any('/game_enter/record', 'Game\GameEnterLogController@record');



//GlobalUID date
Route::any('/agent_api/get-players', 'Game\AgentController@getAgentPlayers');
//GlobalUID return links
Route::any('/agent_api/get-links', 'Game\AgentController@getAgentLinks');
//code
Route::any('/agent_api/get-link-bycode', 'Game\AgentController@getAgentLinkCode');
//al(json str)
Route::any('/agent_api/new-link', 'Game\AgentController@newAgentLink');
// $newacc=json_decode($request->ai,true);
//        $ua=json_decode($request->ua,true);
//        $gs=json_decode($request->gs,true);
Route::any('/agent_api/user-pay', 'Game\AgentController@userPay');
Route::any('/agent_api/user-payout', 'Game\AgentController@userPayout');
Route::any('/agent_api/new-agent', 'Game\AgentController@newAgent');
Route::any('/agent_api/modi-agent-channel', 'Game\AgentController@modifyBindChannel');
Route::any('/agent_api/create-account', 'Game\AgentController@createAccount');
Route::any('/agent_api/get-account', 'Game\AgentController@getAccount');
Route::any('/agent_api/update-score', 'Game\AgentController@updateAccountScore');
Route::any('/create_guest_accs', 'Game\LoginController@createGuestAccounts');

Route::any('/checkgame', 'Game\GameController@CheckOuroGamePort');
Route::any('/modulestat', 'Game\GameController@ModuleStat');

Route::any('/hallapi/setstate', 'Game\HallApiController@SetIngameState');
Route::any('/hallapi/init', 'Game\HallApiController@ClearLocker');


Route::any('/ttt', 'Game\ActivityController@test');

// LuckyStreak API Routes
Route::post('/lucky/validate', 'Game\LuckyStreakController@validate');
Route::post('/lucky/getBalance', 'Game\LuckyStreakController@getBalance');
Route::post('/lucky/moveFunds', 'Game\LuckyStreakController@moveFunds');
Route::post('/lucky/abortMoveFunds', 'Game\LuckyStreakController@abortMoveFunds');
Route::any('/lucky/game_list', 'Game\LuckyStreakController@gameList');
Route::any('/lucky/jackpot', 'Game\LuckyStreakController@jackpot');
Route::any('/lucky/provider_games', 'Game\LuckyStreakController@providerGameList');


Route::any('/hooks/sfp', 'Game\ServiceRedirectController@sfpHook');
Route::any('/gotowhats', 'Game\ServiceRedirectController@whatsAppRedirect');
//Route::any('/redpack/config', 'Game\ActivityController@RedConfig');
//Route::any('/redpack/check', 'Game\ActivityController@RedCheck');
Route::any('/click', 'Game\AgentSystemController@ClickScore');

Route::any('/register', 'Game\LoginController@registerUserNew');

Route::any('/registerNew', 'Game\LoginController@registerUserNew');
Route::any('/login', 'Game\LoginController@Login');
Route::any('/smslogin', 'Game\LoginController@LoginByCode');
Route::any('/logout', 'Game\LoginController@Logout');

Route::any('/service', 'Game\GameController@customer_service');


Route::any('/recharge/gear', 'Game\RechargeController@gear');
Route::any('/recharge/gearAct', 'Game\RechargeController@gearAct');
Route::any('/recharge/pay_channel', 'Game\RechargeController@payChannel');

Route::any('/gear/get_channel', 'Game\RechargeController@getPayChannel');
Route::any('/recharge/vipConfig', 'Game\RechargeController@vipConfig');//vip配置信息


Route::any('/turnplate/index', 'Game\ExtensionsController@turnplate');//绑定
Route::any('/turnplate/kan', 'Game\ExtensionsController@kanOp');//zhuan
Route::any('/turnplate/help', 'Game\ExtensionsController@kanShare');//zhuan




Route::any('/agent/check', 'Game\AgentSystemController@getScore');
Route::any('/agent/stat', 'Game\AgentSystemController@statLastDayMoney');


Route::get('/aviatrix/health', 'Game\AviatrixController@healthCheck');
Route::post('/aviatrix/playerInfo', 'Game\AviatrixController@getPlayerInfo');
Route::post('/aviatrix/bet', 'Game\AviatrixController@placeBet');
Route::post('/aviatrix/win', 'Game\AviatrixController@processWin');
Route::post('/aviatrix/promo-win', 'Game\AviatrixController@promoWin');
Route::post('/aviatrix/closeMatch', 'Game\AviatrixController@closeMatch');

Route::any('/aviatrix/lunch', 'Game\AviatrixController@lunchGame');


Route::post('/atmosfera/get_balance', 'Game\AtmosferaController@getBalance');
Route::post('/atmosfera/get_account_details', 'Game\AtmosferaController@getAccountDetails');
Route::post('/atmosfera/withdraw', 'Game\AtmosferaController@withdraw');
Route::post('/atmosfera/deposit', 'Game\AtmosferaController@deposit');
Route::post('/atmosfera/rollback', 'Game\AtmosferaController@rollback');
Route::any('/atmosfera/game-list', 'Game\AtmosferaController@gameList');

Route::any('/atmosfera/token', 'Game\AtmosferaController@token');

Route::any('/atmosfera/check_user', 'Game\AtmosferaController@checkUser');

Route::get('/bb/ping', 'Game\BetbyCenterController@ping'); //Ping
Route::post('/bb/bet/make', 'Game\BetbyCenterController@betMake'); //Bet Make
Route::post('/bb/bet/commit', 'Game\BetbyCenterController@betCommit'); //Bet Commit (optional)
Route::post('/bb/bet/settlement', 'Game\BetbyCenterController@betSettlement'); //Bet Settlement
Route::post('/bb/bet/refund', 'Game\BetbyCenterController@betRefund'); //Bet Refund
Route::post('/bb/bet/win', 'Game\BetbyCenterController@betWin'); //Bet Win
Route::post('/bb/bet/lost', 'Game\BetbyCenterController@betLost'); //Bet Lost
Route::post('/bb/bet/discard', 'Game\BetbyCenterController@betDiscard'); //Bet Discard
Route::post('/bb/bet/rollback', 'Game\BetbyCenterController@betRollback'); //Bet Rollback

Route::get('/bbsub/ping', 'Game\BetbyController@ping'); //Ping
Route::post('/bbsub/make', 'Game\BetbyController@betMake'); //Bet Make
Route::post('/bbsub/commit', 'Game\BetbyController@betCommit'); //Bet Commit (optional)
Route::post('/bbsub/settlement', 'Game\BetbyController@betSettlement'); //Bet Settlement
Route::post('/bbsub/refund', 'Game\BetbyController@betRefund'); //Bet Refund
Route::post('/bbsub/win', 'Game\BetbyController@betWin'); //Bet Win
Route::post('/bbsub/lost', 'Game\BetbyController@betLost'); //Bet Lost
Route::post('/bbsub/discard', 'Game\BetbyController@betDiscard'); //Bet Discard
Route::post('/bbsub/rollback', 'Game\BetbyController@betRollback'); //Bet Rollback


Route::get('/btest/ping', 'Game\BetbyTestController@ping'); //Ping
Route::any('/btest/bet/make', 'Game\BetbyTestController@betMake'); //Bet Make
Route::any('/btest/bet/commit', 'Game\BetbyTestController@betCommit'); //Bet Commit (optional)
Route::any('/btest/bet/settlement', 'Game\BetbyTestController@betSettlement'); //Bet Settlement
Route::any('/btest/bet/refund', 'Game\BetbyTestController@betRefund'); //Bet Refund
Route::any('/btest/bet/win', 'Game\BetbyTestController@betWin'); //Bet Win
Route::any('/btest/bet/lost', 'Game\BetbyTestController@betLost'); //Bet Lost
Route::any('/btest/bet/discard', 'Game\BetbyTestController@betDiscard'); //Bet Discard
Route::any('/btest/bet/rollback', 'Game\BetbyTestController@betRollback'); //Bet Rollback

//正式版
Route::any('/pgpro/game_list', 'Game\PgSoftController@gameList');
Route::any('/pgpro/VerifySession', 'Game\PgSoftController@VerifySession');
Route::any('/pgpro/Cash/Get', 'Game\PgSoftController@balance');
Route::any('/pgpro/Cash/TransferInOut', 'Game\PgSoftController@cashTransferInOut');
Route::any('/pgpro/Cash/Adjustment', 'Game\PgSoftController@cashAdjustment');
Route::any('/pgpro/Cash/UpdateBetDetail', 'Game\PgSoftController@cashUpdateBetDetail');

//测试版
Route::any('/pg/game_list', 'Game\PgSoftTestController@gameList');
Route::any('/pg/VerifySession', 'Game\PgSoftTestController@VerifySession');
Route::any('/pg/Cash/Get', 'Game\PgSoftTestController@balance');
Route::any('/pg/Cash/TransferInOut', 'Game\PgSoftTestController@cashTransferInOut');
Route::any('/pg/Cash/Adjustment', 'Game\PgSoftTestController@cashAdjustment');
Route::any('/pg/Cash/UpdateBetDetail', 'Game\PgSoftTestController@cashUpdateBetDetail');


//pragmaticplay正式接口
Route::any('/pp/game_list', 'Game\PPlayController@gameList');
Route::any('/pp/game_login', 'Game\PPlayController@gameLogin');
Route::any('/pp/lobby_list', 'Game\PPlayController@gameLobbyList');

Route::any('/pp/back_lobby', 'Game\PPlayController@backLobby')->name('pp.lobby');

Route::any('/pp/auth', 'Game\PPlayController@authenticate');
Route::any('/pp/balance', 'Game\PPlayController@balance');
Route::any('/pp/bet', 'Game\PPlayController@bet');
Route::any('/pp/result', 'Game\PPlayController@result');
Route::any('/pp/bonus_win', 'Game\PPlayController@bonusWin');
Route::any('/pp/jackpot_win', 'Game\PPlayController@jackpotWin');
Route::any('/pp/promo_win', 'Game\PPlayController@promoWin');
Route::any('/pp/refund', 'Game\PPlayController@refund');




Route::any('/pragmatic/game_list', 'Game\PPlayTestController@gameList');
Route::any('/pragmatic/game_login', 'Game\PPlayTestController@gameLogin');
Route::any('/pragmatic/lobby_list', 'Game\PPlayTestController@gameLobbyList');

Route::any('/pragmatic/back_lobby', 'Game\PPlayTestController@backLobby')->name('pp.lobby');;

Route::any('/pragmatic/auth', 'Game\PPlayTestController@authenticate');
Route::any('/pragmatic/balance', 'Game\PPlayTestController@balance');
Route::any('/pragmatic/bet', 'Game\PPlayTestController@bet');
Route::any('/pragmatic/result', 'Game\PPlayTestController@result');
Route::any('/pragmatic/bonus_win', 'Game\PPlayTestController@bonusWin');
Route::any('/pragmatic/jackpot_win', 'Game\PPlayTestController@jackpotWin');
Route::any('/pragmatic/promo_win', 'Game\PPlayTestController@promoWin');
Route::any('/pragmatic/refund', 'Game\PPlayTestController@refund');



// Evoplay API 回调接口
Route::prefix('evoplay')->group(function () {
    Route::post('/game_list', 'Game\EvoplayController@gameList');
    Route::post('/verify', 'Game\EvoplayController@verifyPlayer');
    Route::post('/balance', 'Game\EvoplayController@getBalance');
    Route::post('/bet', 'Game\EvoplayController@bet');
    Route::post('/win', 'Game\EvoplayController@win');
    Route::post('/rollback', 'Game\EvoplayController@rollback');
});





Route::group([

    'middleware' => ['checkGameLogin']

], function (\Illuminate\Routing\Router $route) {
    Route::any('/recharge/gear', 'Game\RechargeController@gear');

    $route->any('/log', 'Game\WebRouteController@log');

    $route->any('/apk/savenew', 'Game\WebRouteController@saveEnv');
    $route->any('/apk/loadnew', 'Game\WebRouteController@checkApkInstall');
    $route->any('/quickSave', 'Game\WebRouteController@quickSave');

    $route->any('/test_change', 'Game\WebRouteController@testScoreChange');

    $route->any('/user/message', 'Game\ServiceRedirectController@userMessageAdd');
//    $route->any('/send_code/send_verify', 'Game\SendCodeController@send_verify');
    $route->any('/recharge/firstPayConfig', 'Game\RechargeController@firstPayConfig');
    $route->any('/apk', 'Game\DownloadController@DownloadTWA');
    $route->any('/send_code', 'Game\SendCodeController@send');
    $route->any('/forgetPass', 'Game\LoginController@forgetPassword');

    $route->any('/routes', 'Game\WebRouteController@Routes');
    $route->any('/pageModules/{id}', 'Game\WebPageModuleController@PageModules');
    $route->any('/gameList', 'Game\WebPageModuleController@GameList');
    $route->any('/actList', 'Game\ActivityController@List');
});


Route::group([

    'middleware' => ['checkGameLogin', 'mustGameLogin']

], function (\Illuminate\Routing\Router $route) {

    $route->any('/igt/lunch', 'Game\IgtSimController@gameLunch');
    $route->any('/getRegisterGold', 'Game\WebRouteController@getRegisterGold');

    $route->any('/evoplay/lunch', 'Game\EvoplayController@gameLunch');
    $route->any('/lucky/lunch', 'Game\LuckyStreakController@gameLunch');

    $route->any('/pay/get_second', 'Game\PayRechargeController@getSecondGive'); // 返回首充金额

    $route->any('/pay/first_pay_multi', 'Game\PayRechargeController@firstPayMulti'); // 首充接口

    $route->any('/pay/first_pay', 'Game\PayRechargeController@firstPay'); // 返回首充金额

    $route->any('/pay/first_pay_gift', 'Game\PayRechargeController@firstPayGift'); // 首充礼包（带倒计时）
    $route->any('/pay/claim_first_pay_gift', 'Game\PayRechargeController@claimFirstPayGiftReward'); // 领取首充礼包奖励
    $route->any('/pay/bankruptcy_gift', 'Game\PayRechargeController@bankruptcyGift'); // 破产礼包
    $route->any('/pay/daily_first_recharge_gift', 'Game\PayRechargeController@dailyFirstRechargeGift'); // 每日首充礼包
    $route->any('/pay/daily_gift', 'Game\PayRechargeController@dailyGift'); // 每日礼包（三档充值）
    $route->any('/pay/claim_daily_gift_bonus', 'Game\PayRechargeController@claimDailyGiftBonus'); // 领取每日礼包三档完成后的额外奖励
    $route->any('/pay/vip_inactive_gift', 'Game\PayRechargeController@vipInactiveGift'); // 连续未充值VIP礼包入口
    $route->any('/pay/vip_inactive_gift_info', 'Game\PayRechargeController@vipInactiveGiftSevenDays'); // 连续未充值VIP礼包7日礼包信息
    $route->any('/pay/claim_vip_inactive_gift_day', 'Game\PayRechargeController@claimVipInactiveGiftDayReward'); // 领取连续未充值VIP礼包某日奖励
    $route->any('/pay/free_bonus_gift', 'Game\PayRechargeController@freeBonusGifts');

    $route->any('/reward-code/redeem', 'Game\RewardCodeController@redeem');

    $route->any('/triggerInvite', 'Game\ExtensionsController@triggerInvite');


    //正式
    $route->any('/pgpro/lunch', 'Game\PgSoftController@gameLunch');

    $route->any('/pgsoft/lunch', 'Game\PgSimController@gameLunch');
    $route->any('/jiligame/lunch', 'Game\JiliSimController@gameLunch');

    $route->any('/hacksaw/lunch', 'Game\HacksawController@gameLunch');

    //测试
    $route->any('/pg/lunch', 'Game\PgSoftTestController@gameLunch');


    $route->any('/pragmatic/lunch', 'Game\PPlayController@gameLunch');
    $route->any('/pp/lunch', 'Game\PPSimController@gameLunch');


    $route->any('/protect/check', 'Game\ActivityController@GetProtectNum');
    $route->any('/protect/get', 'Game\ActivityController@AddProtectNum');

    $route->any('/bindsms', 'Game\LoginController@BindPhone');

    $route->any('/favo/add', 'Game\WebPageModuleController@addFavorite');
    $route->any('/favo/remove', 'Game\WebPageModuleController@removeFavorite');
    $route->any('/favo/get', 'Game\WebPageModuleController@getFavorite');


    $route->any('/checkin/check', 'Game\ActivityController@GetCheckInInfoConfig');
    $route->any('/checkin/get', 'Game\ActivityController@GetCheckInInfo');


    $route->any('/agent/get', 'Game\AgentSystemController@receiveScore');
    $route->any('/agent/history', 'Game\AgentSystemController@history');

//    $route->any('/redpack/receive', 'Game\ActivityController@RedReceive');
    $route->any('/turnplate/bonus', 'Game\ExtensionsController@kanBonus');//bonus

    // 节假日大转盘
    $route->any('/holiday_wheel/info', 'Game\ActivityController@holidayWheelInfo');
    $route->any('/holiday_wheel/spin', 'Game\ActivityController@holidayWheelSpin');

    // 圣诞大转盘
    $route->any('/christmas_wheel/info', 'Game\ActivityController@christmasWheelInfo');
    $route->any('/christmas_wheel/spin', 'Game\ActivityController@christmasWheelSpin');

    // VIP提现诱导任务
    $route->any('/vip-withdraw/tasks', 'Game\ActivityController@getVipWithdrawTasks');
    $route->any('/vip-withdraw/claim', 'Game\ActivityController@claimVipWithdrawReward');

    // Superball 活跃活动
    $route->any('/superball/info', 'Game\SuperballActivityController@info');
    $route->any('/superball/select-tier', 'Game\SuperballActivityController@selectTier');
    $route->any('/superball/upgrade-tier', 'Game\SuperballActivityController@upgradeTier');
    $route->any('/superball/claim-reward', 'Game\SuperballActivityController@claimReward');
    $route->any('/superball/submit-numbers', 'Game\SuperballActivityController@submitNumbers');
    $route->any('/superball/my-balls', 'Game\SuperballActivityController@getMyBalls');
    $route->any('/superball/lucky-numbers', 'Game\SuperballActivityController@luckyNumbers');
    $route->any('/superball/claim-yesterday-reward', 'Game\SuperballActivityController@claimYesterdayReward');

    $route->any('/mail/check', 'Game\MailController@newMsg');
    $route->any('/mail/list', 'Game\MailController@mailList');
    $route->any('/mail/del', 'Game\MailController@delete');
    $route->any('/mail/read', 'Game\MailController@read');
    $route->any('/mail/take', 'Game\MailController@take');
    $route->any('/mail/test', 'Game\MailController@tst');

    $route->any('/info', 'Game\LoginController@GetUserInfo');
    $route->any('/changePayPass', 'Game\LoginController@modiInsurePassword');
    $route->any('/forgetPayPass', 'Game\LoginController@forgetInsurePassword');

    $route->any('/changePass', 'Game\LoginController@modiPassword');
    $route->any('/changePhone', 'Game\LoginController@modiPhone');
    $route->any('/changeEmail', 'Game\LoginController@modiEmail');
    $route->any('/changeInfo', 'Game\LoginController@modiUserInfo');
    $route->any('/ouro777', 'Game\GameController@Ouro777GamePage');

    $route->any('/gameinfo', 'Game\GameController@GetGameInfo');
    $route->any('/getPwaBonus', 'Game\LoginController@getPwaBonus');

    $route->any('/only', 'Game\OnlyGameController@gameLunch');

    $route->any('/aviatrix', 'Game\AviatrixController@gameLunch');

    $route->any('/atmosfera', 'Game\AtmosferaController@gameLunch');


    // 支付入口 -- 总入口
    $route->any('/payment_entry/pay', 'Game\PaymentEntryController@pay');
    $route->any('/payment_entry/payqr', 'Game\PaymentEntryController@payQR');
    $route->any('/payment_entry/iospay', 'Game\PaymentEntryController@iospay');
    $route->any('/payment_entry/googlepay', 'Game\PaymentEntryController@googlepay');

    $route->any('/recharge/userTotalRecharge', 'Game\RechargeController@userTotalRecharge');//用户总充值
    $route->any('/recharge/guidePayment', 'Game\RechargeController@guidePayment');//引导付费
    $route->any('/pay/orderList', 'Game\PayRechargeController@orderList'); // 充值记录

    $route->any('/withDraw/savecpf', 'Game\WithDrawInfoController@saveCpf');//提现信息完善
    $route->any('/withDraw/record', 'Game\WithDrawInfoController@WithDrawRecord');//提现信息完善
    $route->any('/withDraw/mexWithDrawInfo', 'Game\WithDrawInfoController@MexWithDrawInfo');//提现信息完善
    $route->any('/withDraw/ruWithDrawInfo', 'Game\WithDrawInfoController@RuWithDrawInfo');//提现信息完善
    $route->any('/withDraw/withDrawInfo', 'Game\WithDrawInfoController@withDrawInfo');//提现信息完善

    $route->any('/withDraw/freeWithDrawInfo', 'Game\WithDrawInfoController@FreeWithDrawInfo');//提现信息完善

    $route->any('/withDraw/getWithDrawInfo', 'Game\WithDrawInfoController@getWithDrawInfo');//获取提现信息
    $route->any('/withDraw/baseInfo', 'Game\WithDrawInfoController@GetWithDrawBaseInfo');//获取提现信息
    $route->any('/withDraw/payout', 'Game\WithDrawInfoController@GoWithDraw');//获取提现信息


    $route->any('/kyc/eu', 'Game\WithDrawInfoController@kycSimpleEU');


});


Route::group([

    'middleware' => 'apiSign'

], function (\Illuminate\Routing\Router $route) {

    $route->get('/{checkkey}/{ip_check_key}', 'Api\ApiController@LoginIP_NMask');

});


GameBasicConfig::$DOLLAR=env('CONFIG_24680_DOLLAR',GameBasicConfig::$DOLLAR);
GameBasicConfig::$ApiServer=env('APP_URL',GameBasicConfig::$ApiServer);
GameBasicConfig::$HallServer=env('CONFIG_24680_HALL',GameBasicConfig::$HallServer);
