Skip to content

Commit ec5db66

Browse files
committed
Integrated verifier server
1 parent b245b9a commit ec5db66

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

bot.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ function loadEnv(string $filePath = __DIR__ . '/.env'): void
153153
// The website must return valid json when no parameters are passed to it and MUST allow POST requests including 'token', 'ckey', and 'discord'
154154
// Reach out to Valithor if you need help setting up your website
155155
'webserver_url' => 'www.valzargaming.com',
156-
'verify_url' => 'http://valzargaming.com:8080/verified/', // Leave this blank if you do not want to use the webserver, ckeys will be stored locally as provisional
156+
//'verify_url' => 'http://valzargaming.com:8080/verified/', // Leave this blank if you do not want to use the webserver, ckeys will be stored locally as provisional
157+
'verify_url' => getenv('VERIFIER_HOST_ADDR') . ':' . getenv('VERIFIER_HOST_PORT') . '/verified/', // Local/Integrated Verifier Server
157158
// 'serverinfo_url' => '', // URL of the serverinfo.json file, defaults to the webserver if left blank
158159
'ooc_badwords' => $ooc_badwords,
159160
'ic_badwords' => $ic_badwords,
@@ -448,5 +449,24 @@ function loadEnv(string $filePath = __DIR__ . '/.env'): void
448449
//$events = ['MESSAGE_UPDATE'];
449450
//$eventLogger = new \EventLogger\EventLogger($discord, $events);
450451

451-
$civ13 = new Civ13($options, $server_settings);
452+
use VerifierServer\PersistentState;
453+
use VerifierServer\Server as VerifierServer;
454+
455+
$verifier_server = new VerifierServer(
456+
new PersistentState(
457+
getenv('CIV_TOKEN'),
458+
PersistentState::loadVerifyFile(getenv('VERIFIER_JSON_PATH') ?? 'json\verified.json'),
459+
getenv('VERIFIER_STORAGE_TYPE') ?? 'filesystem',
460+
getenv('VERIFIER_JSON_PATH') ?? 'json\verified.json',
461+
),
462+
getenv('VERIFIER_HOST_ADDR') . ':' . getenv('VERIFIER_HOST_PORT')
463+
);
464+
$verifier_server->init($loop);
465+
$verifier_server->setLogger($logger);
466+
467+
$civ13 = new Civ13(
468+
$options,
469+
$server_settings,
470+
$verifier_server
471+
);
452472
$civ13->run();

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"vzgcoders/twitchphp": "dev-main",
1818
"valzargaming/byond": "dev-main",
1919
"valzargaming/handler": "dev-main",
20+
"vzgcoders/verifier-server": "^2",
2021
"wyrihaximus/react-cache-redis": "^4.5",
2122
"valgorithms/discord-php-eventlogger": "dev-master"
2223
},

0 commit comments

Comments
 (0)