-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-230 Move effects to their own function
- Loading branch information
Showing
3 changed files
with
55 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace UniEngine\Engine\Modules\Overview\Screens\FirstLogin; | ||
|
||
use UniEngine\Engine\Modules\Overview\Screens\FirstLogin; | ||
|
||
/** | ||
* @param array $params | ||
* @param arrayRef $params['user'] | ||
* @param number $params['currentTimestamp'] | ||
*/ | ||
function runEffects($props) { | ||
$user = &$props['user']; | ||
$currentTimestamp = $props['currentTimestamp']; | ||
|
||
FirstLogin\Utils\Effects\updateUserOnFirstLogin([ | ||
'userId' => $user['id'], | ||
'currentTimestamp' => $currentTimestamp, | ||
]); | ||
|
||
if ($user['referred'] > 0) { | ||
$referringUserWithTasksData = FirstLogin\Utils\Helpers\getReferrerTasksData([ | ||
'referredById' => $user['referred'], | ||
]); | ||
|
||
FirstLogin\Utils\Effects\triggerUserReferralTask([ | ||
'referringUserWithTasksData' => &$referringUserWithTasksData, | ||
]); | ||
FirstLogin\Utils\Effects\handleReferralMultiAccountDetection([ | ||
'user' => &$user, | ||
'referredById' => $user['referred'], | ||
'referringUserWithTasksData' => &$referringUserWithTasksData, | ||
'currentTimestamp' => $currentTimestamp, | ||
]); | ||
} | ||
|
||
// Check, if this IP is Proxy | ||
FirstLogin\Utils\Effects\handleProxyDetection([ | ||
'user' => &$user, | ||
'currentTimestamp' => $currentTimestamp, | ||
]); | ||
|
||
// TODO: move this to utils | ||
// Give Free ProAccount for 7 days | ||
// doquery("INSERT INTO {{table}} VALUES (NULL, {$user['id']}, UNIX_TIMESTAMP(), 0, 0, 11, 0);", 'premium_free'); | ||
|
||
FirstLogin\Utils\Effects\createUserDevLogDump([ | ||
'userId' => $user['id'], | ||
]); | ||
} | ||
|
||
?> |