mardi 28 janvier 2020

Random.org API use [closed]

My site is distributing things from the Dota 2 game. The winner is randomly selected using the Random.org service. They give out 1,000 keys for free per day, but I get about 1,500 keys. I'm trying to make sure that if 1000 keys are used, when creating a new distribution, my second API key is selected.

My Controller

<?php namespace App\Http\Controllers;
use App\Http\Controllers\RandomOrgClient;

    public function newgame()
    {
        if ($this->game->status == 2) {

            $random = new RandomOrgClient();
            $arrRandomInt = $random->generateIntegers(1, 0, 14, false, 10, true);
            $game = Game_double::create(['random' => json_encode($random->last_response['result']['random']), 'signature' => $random->last_response['result']['signature'],
                'number' => $arrRandomInt[0],
            ]);

            return $game;
        }

    }

I need that if 1000 keys are used for the first API, the second API with new keys should be used. I duplicated file RandomOrgClient at App\Http\Controllers\, and try to change $random = new RandomOrgClient();, but nothing happens, a new game is not created due to the fact that 1000 keys are used.




Aucun commentaire:

Enregistrer un commentaire