1.0.9.6 97D+99I Darksteam Support - HELP!

Natzugen

New Member
Sep 16, 2017
4
0
1
26
Hello everyone!
Is there any way to adapt this cms for the Darksteam 97D files?
I've tried to add query in class.account.php but it did not create a values in VI_CURR_INFO.
Without VI_CURR_INFO - Players gets No Charge Info in the game.
Here is how i tried to do:

First i've defined keys in custom.tables.php
Code:
define('_TBL_VIC_', 'VI_CURR_INFO');
    define('_CLMN_DAYS_', 'ends_days');
    define('_CLMN_CODE_', 'chek_code');
    define('_CLMN_TIME_', 'used_time');
    define('_CLMN_ID_', 'memb___id');
    define('_CLMN_NAME_', 'memb_name');
    define('_CLMN_GUID_', 'memb_guid');
    define('_CLMN_SNNUM_', 'sno__numb');
    define('_CLMN_BILLSEC_', 'Bill_Section');
    define('_CLMN_BILLVAL_', 'Bill_Value');
    define('_CLMN_BILLHOUR_', 'Bill_Hour');
    define('_CLMN_SURP_', 'Surplus_Point');
    define('_CLMN_SURM_', 'Surplus_Minute');
    define('_CLMN_INCDAY_', 'Increase_Days');
Then i've added a query in class.account.php

Code:
        # query
        if($this->_md5Enabled) {
            $query = "INSERT INTO "._TBL_MI_." ("._CLMN_USERNM_.", "._CLMN_PASSWD_.", "._CLMN_MEMBNAME_.", "._CLMN_SNONUMBER_.", "._CLMN_EMAIL_.", "._CLMN_BLOCCODE_.", "._CLMN_CTLCODE_.") VALUES (:username, [dbo].[fn_md5](:password, :username), :name, :serial, :email, 0, 0)";
        } else {
            $query = "INSERT INTO "._TBL_VIC_." ("._CLMN_DAYS_.", "._CLMN_CODE_.", "._CLMN_TIME_.", "._CLMN_ID_.", "._CLMN_NAME_.", "._CLMN_GUID_.", "._CLMN_SNNUM_.", "._CLMN_BILLSEC_.", "._CLMN_BILLVAL_.", "._CLMN_BILLHOUR_.", "._CLMN_SURP_.", "._CLMN_SURM_.", "._CLMN_INCDAY_.") VALUES (2005, 1, 1234, :username, 123123, 1, 0, 7, 6, 3, 0, 0, 0, 0)";
            $query = "INSERT INTO "._TBL_MI_." ("._CLMN_USERNM_.", "._CLMN_PASSWD_.", "._CLMN_MEMBNAME_.", "._CLMN_SNONUMBER_.", "._CLMN_EMAIL_.", "._CLMN_BLOCCODE_.", "._CLMN_CTLCODE_.") VALUES (:username, :password, :name, :serial, :email, 0, 0)";
        }
But it doesn't work. Can anyone help me on this?
 

Lautaro

Administrator
Developer
Dec 19, 2012
560
234
43
Please upload your database structure so I can have a proper look at it.
 

Lautaro

Administrator
Developer
Dec 19, 2012
560
234
43
Ok so here are the issues I see on your code:

1) You have 13 columns and 14 values in your query. Columns and values must be equal amount for the query to be executed properly.

2) You defined your query in the variable $query, which gets replaced on the next line with the account registration query. This is how you should run your query:
PHP:
// query data
$vicData = array(
    'username' => $username
);

// your query
$vicQuery = "INSERT INTO "._TBL_VIC_." ("._CLMN_DAYS_.", "._CLMN_CODE_.", "._CLMN_TIME_.", "._CLMN_ID_.", "._CLMN_NAME_.", "._CLMN_GUID_.", "._CLMN_SNNUM_.", "._CLMN_BILLSEC_.", "._CLMN_BILLVAL_.", "._CLMN_BILLHOUR_.", "._CLMN_SURP_.", "._CLMN_SURM_.", "._CLMN_INCDAY_.") VALUES (2005, 1, 1234, :username, 123123, 1, 0, 7, 6, 3, 0, 0, 0)";

// query execution
$vicResult = $this->db->query($vicQuery, $vicData);
I'm guessing this code is to give free VIP to your new users? If so, add it after the account registration query execution and before sending the welcome email (line 74 - 75), here:
https://github.com/lautaroangelico/WebEngine/blob/master/includes/classes/class.account.php#L75
 

Natzugen

New Member
Sep 16, 2017
4
0
1
26
Ok so here are the issues I see on your code:

1) You have 13 columns and 14 values in your query. Columns and values must be equal amount for the query to be executed properly.

2) You defined your query in the variable $query, which gets replaced on the next line with the account registration query. This is how you should run your query:
PHP:
// query data
$vicData = array(
    'username' => $username
);

// your query
$vicQuery = "INSERT INTO "._TBL_VIC_." ("._CLMN_DAYS_.", "._CLMN_CODE_.", "._CLMN_TIME_.", "._CLMN_ID_.", "._CLMN_NAME_.", "._CLMN_GUID_.", "._CLMN_SNNUM_.", "._CLMN_BILLSEC_.", "._CLMN_BILLVAL_.", "._CLMN_BILLHOUR_.", "._CLMN_SURP_.", "._CLMN_SURM_.", "._CLMN_INCDAY_.") VALUES (2005, 1, 1234, :username, 123123, 1, 0, 7, 6, 3, 0, 0, 0)";

// query execution
$vicResult = $this->db->query($vicQuery, $vicData);
I'm guessing this code is to give free VIP to your new users? If so, add it after the account registration query execution and before sending the welcome email (line 74 - 75), here:
https://github.com/lautaroangelico/WebEngine/blob/master/includes/classes/class.account.php#L75
No this is not a VIP. My server requires an information in VI_CURR_INFO table that allows people to connect to the server. If there is not information about account so when player trying to log-in game he is getting error message: NO CHARGE INFO. I need to make CMS to insert value into VI_CURR_INFO table.

And this should be inserted on registration.
Here is my database structure: http://dropmefiles.com/2Pe8F