alphaland ticket dep

This commit is contained in:
Astrologies 2021-12-17 06:11:34 -05:00
parent f86671d3dc
commit e059ce550d
3 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,41 @@
<?php
/*
Alphaland 2021
*/
namespace Alphaland\Games {
use Alphaland\Common\Signing;
class Ticket
{
public static function ClientTicket(array $arguments)
{
//is this a bad method of doing this?
if (sizeof($arguments) == 5) {
$userid = $arguments[0];
$accountage = $arguments[1];
$username = $arguments[2];
$characterappearance = $arguments[3];
$jobid = $arguments[4];
$ticket = "";
if ($userid &&
userExists($userid) &&
$accountage &&
$username &&
getUsername($userid) == $username &&
$characterappearance &&
$jobid) {
$timestamp = date("m/d/Y h:m:s A", time());
$sig1 = Signing::SignData($userid . "\n" . $accountage . "\n" . $username . "\n" . $characterappearance . "\n" . $jobid . "\n" . $timestamp, false);
$sig2 = Signing::SignData($userid . "\n" . $jobid . "\n" . $timestamp, false);
$ticket = $timestamp.";".$sig1.";".$sig2;
}
}
return $ticket;
}
}
}

View File

@ -112,6 +112,7 @@ try
include "C:/Webserver/nginx/Alphaland/globals/Dependencies/UI/ImageHelper.php";
include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Users/Render.php";
include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Common/Signing.php";
include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Games/Ticket.php";
//authenticator
$authenticator = new PHPGangsta_GoogleAuthenticator();

View File

@ -71,7 +71,13 @@ if ($_SERVER['HTTP_USER_AGENT'] == $GLOBALS['clientUserAgent']) //user agent res
"UserId" => $userid,
"SuperSafeChat" => false, //always false, dont need this
"CharacterAppearance" => $characterappearance,
"ClientTicket" => generateClientTicket($userid, $accountage, $username, $characterappearance, $jobid), //generate epic clientticket
"ClientTicket" => Ticket::ClientTicket(array(
$userid,
$accountage,
$username,
$characterappearance,
$jobid
)),
"GameId" => '00000000-0000-0000-0000-000000000000', //not set rn?
"PlaceId" => $placeid,
"BaseUrl" => $url . "/",