Skip to content

Commit

Permalink
GH-230 Move dump creator to an util
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed Jul 3, 2022
1 parent b35b26c commit ab5ddc1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions modules/overview/_includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$includePath = $_EnginePath . 'modules/overview/';

include($includePath . './screens/FirstLogin/FirstLogin.screen.php');
include($includePath . './screens/FirstLogin/utils/effects/createUserDevLogDump.effect.php');
include($includePath . './screens/FirstLogin/utils/effects/handleProxyDetection.effect.php');
include($includePath . './screens/FirstLogin/utils/effects/handleReferralMultiAccountDetection.effect.php');
include($includePath . './screens/FirstLogin/utils/effects/triggerUserReferralTask.effect.php');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace UniEngine\Engine\Modules\Overview\Screens\FirstLogin\Utils\Effects;

/**
* @param array $params
* @param number $params['userId']
*/
function createUserDevLogDump($props) {
global $_EnginePath, $InnerUIDSet, $SkipDumpMsg;
// TODO: This should be imported in the script, not here
global $_Vars_ElementCategories, $_Vars_GameElements;

$userId = $props['userId'];

define('IN_USERFIRSTLOGIN', true);
$InnerUIDSet = $userId;
$SkipDumpMsg = true;

include("{$_EnginePath}admin/scripts/script.createUserDevDump.php");
}

?>
11 changes: 4 additions & 7 deletions overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
$Query_UpdateUser .= "WHERE `id` = {$_User['id']} LIMIT 1;";
doquery($Query_UpdateUser, 'users');

if($_User['referred'] > 0)
{
if ($_User['referred'] > 0) {
$referringUserWithTasksData = Overview\Screens\FirstLogin\Utils\Helpers\getReferrerTasksData([
'referredById' => $_User['referred'],
]);
Expand All @@ -86,11 +85,9 @@
// Give Free ProAccount for 7 days
//doquery("INSERT INTO {{table}} VALUES (NULL, {$_User['id']}, UNIX_TIMESTAMP(), 0, 0, 11, 0);", 'premium_free');

// Create DevLog Dump
define('IN_USERFIRSTLOGIN', true);
$InnerUIDSet = $_User['id'];
$SkipDumpMsg = true;
include($_EnginePath.'admin/scripts/script.createUserDevDump.php');
Overview\Screens\FirstLogin\Utils\Effects\createUserDevLogDump([
'userId' => $_User['id'],
]);

display(parsetemplate($TPL, $_Lang), $_Lang['FirstLogin_Title'], false);
}
Expand Down

0 comments on commit ab5ddc1

Please sign in to comment.