Modification [IGCN] Add account to T_InGameShop_Point automatically

Mon

Administrator
Developer
Nov 8, 2018
185
45
28
Hello,

This is a modification for WebEngine 1.2.x that will automatically add accounts to the T_InGameShop_Point table so your accounts can receive credits through the WebEngine credit system even if they have not logged into the game yet.

Requirements:
- WebEngine 1.2.x
- IGCN Mu FIles (or similar files that use the T_InGameShop_Point table)

Step 1:
Open /modules/usercp.php

Step 2:
Replace all the code with the following:
PHP:
<?php
/**
 * WebEngine CMS
 * https://webenginecms.org/
 *
 * @version 1.2.0
 * @author Lautaro Angelico <http://lautaroangelico.com/>
 * @copyright (c) 2013-2019 Lautaro Angelico, All Rights Reserved
 *
 * Licensed under the MIT license
 * http://opensource.org/licenses/MIT
 */

if(!isLoggedIn()) redirect(1,'login');

$db = Connection::Database('MuOnline');
$check = $db->query_fetch_single("SELECT * FROM T_InGameShop_Point WHERE AccountID = ?", array($_SESSION['username']));
if(!is_array($check)) {
    $create = $db->query("INSERT INTO T_InGameShop_Point (AccountID, WCoin, GoblinPoint) VALUES (?, 0, 0)", array($_SESSION['username']));
}

# redirect to my account
redirect(1, 'usercp/myaccount');