[92.03] Add account benefits

Results 1 to 7 of 7
  1. #1
    Member Luciole is online now
    MemberRank
    Dec 2015 Join Date
    上海-ShanghaiLocation
    96Posts

    [92.03] Add account benefits

    [92.03] Add account benefits
    The account benefits is displayed in-game beside the VIP icon and on the right side in the lobby. It can be founder (Having a purchased account), TERA Club, PC cafe, etc...
    It's more convenient to have them set automatically than using the "add_privilege" QA method.

    Import this SQL file into your accountdb_2800 database:
    Code:
    DROP TABLE IF EXISTS `account_benefits`;
    CREATE TABLE `account_benefits` (
      `accountDBID` int(11) NOT NULL,
      `benefitId` int(11) NOT NULL,
      `availableUntil` int(11) NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    In the API, replace the "GetUserInfo" method with this one:
    Code:
    def GetUserInfo() {
            println '----------------GetUserInfo----------------'
            String msg = ''
            int returnCode = 0
            boolean paramLengthCheck = true
    
            params.putAll(request.JSON)
            params.each {
                if(it.getValue().toString().contains('./') || it.getValue().toString().contains('.?') || it.getValue().toString().length() > 1500)
                    paramLengthCheck = false
                msg = "$it.key parameter error"
            }
    
            if(!paramLengthCheck){
                JSONObject result = new JSONObject()
                result.put('Return',false)
                result.put('ReturnCode',50500)
                result.put('msg', msg)
                def resultJson = result as JSON
                response.setContentLength(resultJson.toString()?.bytes.length)
                render text : resultJson , contentType: 'application/json', encoding: 'UTF-8'
                println result
            }
            else {
                JSONObject result = new JSONObject()
                def paramMap = [:]
                try {
                    params.each { p ->
                        if (p.key != 'action' && p.key != 'controller') {
                            paramMap.put(p.key, p.value)
                            println 'Key: ' + p.key + ', value: ' + p.value
                        }
                    }
                } catch (RuntimeException e) {
                    returnCode = 58007
                    msg = 'invalid encoded parameter(base64)'
                    e.printStackTrace()
                }
    
                if(!params.user_srl || !params.server_id ||!params.ip || !params.serviceCode ){
                    returnCode = 2
                    msg = "user_srl=$params.user_srl&server_id=$params.server_id&ip=$params.ip&serviceCode=$params.serviceCode"
                }
    
                def accountList = []
                String selectQuery = "select * from AccountInfo where accountDBID = $params.user_srl"
                Sql sql = new Sql(dataSource)
                sql.eachRow(
                        selectQuery, {
                    it.eachWithIndex { row, index ->
                        accountList << [
                                charCount:        row.charCount,
                                //lastLoginTime:    row.lastLoginTime,
                                //playTimeLast:    row.playTimeLast,
                                isBlocked:        row.isBlocked,
                        ]
                    }
                }
                )
                sql.close()
    
                def benefit_array = []
                selectQuery = "select * from account_benefits where accountDBID = $params.user_srl"
                sql = new Sql(dataSource)
                sql.eachRow(
                        selectQuery, {
                            it.eachWithIndex { row, index ->
                            benefit_array << [
                                    row.benefitId,
                                    row.availableUntil - (System.currentTimeMillis()/1000).toInteger()
                            ]
                        }
                    }
                )
                if (accountList.size() != 1) {
                    msg = 'invalid login request'
                    returnCode = 50000
                }
                else {
                    def accountInfo = accountList.get(0)
                    def charCount = accountInfo.getAt('charCount')
                    def CharacterCount = "0|2800,$charCount|"
                    result.put("last_connected_server", null)
                    result.put("last_play_time", null)
                    result.put("logout_time_diff", null)
                    result.put("char_count_info", CharacterCount)
                    result.put("privilege", 0)
                    result.put("permission", accountInfo.getAt('isBlocked'))
                    result.put("result_code", returnCode)
                    result.put("benefit", benefit_array)
                    result.put("vip_pub_exp", 0)
                }
                if (returnCode > 0)
                    result.put("msg", msg)
                response.setContentLength((result as JSON).toString()?.size())
                render text: result as JSON, contentType: 'application/json', encoding: 'UTF-8'
                println result
            }
        }
    You can find the list of all the different benefits in the "StrSheet_AccountBenefit.xml" file in the datacenter, or use the list below

    Code:
    <String id="31" string="Proof of the expedition member" />
      <String id="32" string="Skillful Adventurer" />
      <String id="33" string="TERA Rewards" showLeftTimeOver1Year="False" />
      <String id="34" string="Frontier" hideCoolTime="True" />
      <String id="35" string="EP XP increases by 30" hideCoolTime="True" />
      <String id="70" string="" showLeftTimeOver1Year="False" />
      <String id="77" string="Monthly Pass" showLeftTimeOver1Year="False" />
      <String id="101" string="" showLeftTimeOver1Year="True" />
      <String id="102" string="" hideCoolTime="True" />
      <String id="103" string="Japan Returning user" />
      <String id="104" string="JP Tooltip" showLeftTimeOver1Year="True" />
      <String id="105" string="" showLeftTimeOver1Year="True" />
      <String id="106" string="" showLeftTimeOver1Year="True" />
      <String id="107" string="" showLeftTimeOver1Year="True" />
      <String id="108" string="" showLeftTimeOver1Year="True" />
      <String id="109" string="" showLeftTimeOver1Year="True" />
      <String id="333" string="Elite Status" />
      <String id="334" string="Founder" />
      <String id="335" string="Console Elite" />
      <String id="350" string="Server Benefit" />
      <String id="433" string="TERA Club" />
      <String id="434" string="Veteran" />
      <String id="435" string="Package Benefit I" />
      <String id="436" string="Package Benefit II" />
      <String id="437" string="Package Benefit III" />
      <String id="500" string="VIP" showLeftTimeOver1Year="False" />
      <String id="510" string="TW XP Boost Server" />
      <String id="520" string="VIP2" />
      <String id="530" string="" showLeftTimeOver1Year="False" />
      <String id="533" string="VIP" />
      <String id="534" string="Founder" hideCoolTime="True" />
      <String id="600" string="Trade restricted" hideCoolTime="True" />
      <String id="601" string="Basic Package" hideCoolTime="True" />
      <String id="691" string="Safe Mode" />
      <String id="701" string="VIP" showLeftTimeOver1Year="False" />
      <String id="800" string="PC Café (Minor)" />
      <String id="801" string="PC Café (Intermediate)" />
      <String id="802" string="PC Café (Major)" />
      <String id="803" string="PC Café (VIP)" />
      <String id="804" string="User ELITE (Minor)" />
      <String id="805" string="User ELITE (Intermediate)" />
      <String id="806" string="User ELITE (Major)" />
      <String id="807" string="User ELITE (VIP)" />
      <String id="808" string="" />
      <String id="809" string="" showLeftTimeOver1Year="False" />
      <String id="810" string="" showLeftTimeOver1Year="False" />
      <String id="1000" string="TERA PC cafe" hideCoolTime="True" />
      <String id="1001" string="" hideCoolTime="True" />
    In the new table account_benefit, set the "accountDBID" to yours found in the "accountinfo" table, "benefitId" with your wanted benefit from the list or datacenter file and "availableUntil" to the date you want this benefit to be available (set the date in 10 years if you want it permanently).


  2. #2
    Hardcore Member argeus99 is online now
    MemberRank
    Mar 2019 Join Date
    ColombiaLocation
    127Posts

    Re: [92.03] Add account benefits

    Thanks for sharing. Let me ask, is there a way to enable 2 accounts benefits at same time? like Founder and Elite/Club Status

  3. #3
    Member Luciole is online now
    MemberRank
    Dec 2015 Join Date
    上海-ShanghaiLocation
    96Posts

    Re: [92.03] Add account benefits

    Quote Originally Posted by argeus99 View Post
    Thanks for sharing. Let me ask, is there a way to enable 2 accounts benefits at same time? like Founder and Elite/Club Status
    Yeah sure. This is an array of array. Each benefit array is in this format: [benefit_id, time_remaining].

    So sending [[334, 600000], [433, 600000], [1000, 600000]] will result having founder (334), TERA CLUB EU (443) and KR pc cafe (1000) for 1h

  4. #4
    Member templar is online now
    MemberRank
    Mar 2012 Join Date
    43Posts

    Re: [92.03] Add account benefits

    what file in the api does this go into? and recompile?

  5. #5
    Registered arsokas is offline
    MemberRank
    Mar 2021 Join Date
    7Posts

    Re: [92.03] Add account benefits

    Shared files does not contain file StrSheet_AccountBenefit.xml, how do we proceed with that?

  6. #6
    Hardcore Member TenShie is offline
    MemberRank
    Apr 2011 Join Date
    Frankfurt a. M.Location
    116Posts

    Re: [92.03] Add account benefits

    Quote Originally Posted by arsokas View Post
    Shared files does not contain file StrSheet_AccountBenefit.xml, how do we proceed with that?
    TeraAPI\grails-4.0.3\TeraAPI\grails-app\controllers\com\tera\AccountController.groovy

  7. #7
    Hardcore Member argeus99 is online now
    MemberRank
    Mar 2019 Join Date
    ColombiaLocation
    127Posts

    Re: [92.03] Add account benefits

    Its the same file previously shared by Luciole

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <StrSheet_AccountBenefit>
      <String id="31" string="Proof of the expedition member" />
      <String id="32" string="Skillful Adventurer" />
      <String id="33" string="TERA Rewards" showLeftTimeOver1Year="False" />
      <String id="34" string="Frontier" hideCoolTime="True" />
      <String id="35" string="EP XP increases by 30" hideCoolTime="True" />
      <String id="70" string="" showLeftTimeOver1Year="False" />
      <String id="77" string="Monthly Pass" showLeftTimeOver1Year="False" />
      <String id="101" string="" showLeftTimeOver1Year="True" />
      <String id="102" string="" hideCoolTime="True" />
      <String id="103" string="Japan Returning user" />
      <String id="104" string="JP Tooltip" showLeftTimeOver1Year="True" />
      <String id="105" string="" showLeftTimeOver1Year="True" />
      <String id="106" string="" showLeftTimeOver1Year="True" />
      <String id="107" string="" showLeftTimeOver1Year="True" />
      <String id="108" string="" showLeftTimeOver1Year="True" />
      <String id="109" string="" showLeftTimeOver1Year="True" />
      <String id="333" string="Elite Status" />
      <String id="334" string="Founder" />
      <String id="335" string="Console Elite" />
      <String id="350" string="Server Benefit" />
      <String id="433" string="TERA Club" />
      <String id="434" string="Veteran" />
      <String id="435" string="Package Benefit I" />
      <String id="436" string="Package Benefit II" />
      <String id="437" string="Package Benefit III" />
      <String id="500" string="VIP" showLeftTimeOver1Year="False" />
      <String id="510" string="TW XP Boost Server" />
      <String id="520" string="VIP2" />
      <String id="530" string="" showLeftTimeOver1Year="False" />
      <String id="533" string="VIP" />
      <String id="534" string="Founder" hideCoolTime="True" />
      <String id="600" string="Trade restricted" hideCoolTime="True" />
      <String id="601" string="Basic Package" hideCoolTime="True" />
      <String id="691" string="Safe Mode" />
      <String id="701" string="VIP" showLeftTimeOver1Year="False" />
      <String id="800" string="PC Café (Minor)" />
      <String id="801" string="PC Café (Intermediate)" />
      <String id="802" string="PC Café (Major)" />
      <String id="803" string="PC Café (VIP)" />
      <String id="804" string="User ELITE (Minor)" />
      <String id="805" string="User ELITE (Intermediate)" />
      <String id="806" string="User ELITE (Major)" />
      <String id="807" string="User ELITE (VIP)" />
      <String id="808" string="" />
      <String id="809" string="" showLeftTimeOver1Year="False" />
      <String id="810" string="" showLeftTimeOver1Year="False" />
      <String id="1000" string="TERA PC cafe" hideCoolTime="True" />
      <String id="1001" string="" hideCoolTime="True" />
      <String id="10031" string="Reward: receive two Valkyon's Response when using instance matching." />
      <String id="10032" string="Decrease cooldown of instance in half &amp; increase instance entries by 100%" />
      <String id="10033" string="Earnest Money: exemption&lt;BR&gt;Trading brokerage fee: 5%&lt;BR&gt;Brokerage Registration Number: 50&lt;BR&gt;Broker's price negotiation: Available&lt;BR&gt;Reward: receive Valkyon's Response when using instance matching system between servers.&lt;BR&gt;Decrease cooldown of instance &amp; increase instance entries&lt;BR&gt;Increases maximum number and charging speed of Adventure Coin&lt;BR&gt;Apply Instance Beginner System&lt;BR&gt;Apply XP Boost and Reputation Boost&lt;BR&gt;Doubles access to Ghillieglade." />
      <String id="10034" string="Reward: receive Valkyon's Response when using instance matching system between servers.&lt;BR&gt;Apply Instance Beginner System" />
      <String id="10035" string="EP XP increases by 30%." />
      <String id="10070" string="" />
      <String id="10077" string="100% XP Boost (1 Hour) access&lt;BR&gt;Earnest Money: 2%&lt;BR&gt;Trading brokerage fee: 10%&lt;BR&gt;Brokerage Registration Number: 50&lt;BR&gt;Broker's price negotiation: Available&lt;BR&gt;Reward: receive Valkyon's Response when using instance matching system between servers.&lt;BR&gt;Decrease cooldown of instance &amp; increase instance entries&lt;BR&gt;Increases maximum number and charging speed of Adventure Coin&lt;BR&gt;Apply Instance Beginner System&lt;BR&gt;Apply XP Boost and EP Boost&lt;BR&gt;Increased Item XP gains&lt;BR&gt;Doubles access to Ghillieglade." />
      <String id="10101" string="" />
      <String id="10102" string="" />
      <String id="10103" string="Japan Returning user tooltip" />
      <String id="10104" string="JP Tooltip" />
      <String id="10105" string="" />
      <String id="10106" string="" />
      <String id="10107" string="" />
      <String id="10108" string="" />
      <String id="10109" string="" />
      <String id="10333" string="Monthly Account Rewards:&lt;BR&gt;Permanent 100% XP Boost.&lt;BR&gt;Permanent 100% Reputation Boost.&lt;BR&gt;Permanent 100% Quester's Gold Boost.&lt;BR&gt;Village Atlas.&lt;BR&gt;Travel Journal.&lt;BR&gt;Two Valkyon's Responses from Instance Matching.&lt;BR&gt;Twice as many available daily quests.&lt;BR&gt;Instance access twice as often.&lt;BR&gt;Up to 50 items active on brokerage.&lt;BR&gt;Exempt from earnest money requirements on brokerage.&lt;BR&gt;Brokerage fee of only 10%.&lt;BR&gt;Sampler mount (changes periodically).&lt;BR&gt;Daily boosts and loot boxes." />
      <String id="10334" string="Permanent Account Rewards: &lt;BR&gt;8 free character slots per server.&lt;BR&gt;4 bank tabs per server.&lt;BR&gt;Terminus, the argon hybrid warhorse.&lt;BR&gt;&quot;Founder&quot; title.&lt;BR&gt;Up to 30 items active on brokerage." hideCoolTime="True" />
      <String id="10335" string="Monthly Account Rewards:&lt;BR&gt;Permanent 100% XP Boost.&lt;BR&gt;Permanent 100% Reputation Boost.&lt;BR&gt;Permanent 100% Quester's Gold Boost.&lt;BR&gt;Village Atlas.&lt;BR&gt;Travel Journal.&lt;BR&gt;Two Valkyon's Responses from Instance Matching.&lt;BR&gt;Twice as many available daily quests.&lt;BR&gt;Instance access twice as often.&lt;BR&gt;Up to 50 items active on brokerage.&lt;BR&gt;Exempt from earnest money requirements on brokerage.&lt;BR&gt;Brokerage fee of only 10%.&lt;BR&gt;Sampler mount (changes periodically).&lt;BR&gt;Daily boosts and loot boxes." />
      <String id="10433" string="Active Bonuses During Membership:&lt;BR&gt;Instance cooldowns halved and entries doubled&lt;BR&gt;Increased maximum and faster regeneration of Adventure Coins&lt;BR&gt;Special mount and pet&lt;BR&gt;Free teleportation to cities, towns and villages plus your own teleport locations&lt;BR&gt;Various boosts such as 100% increased character experience&lt;BR&gt;NPC summoning scrolls and keys&lt;BR&gt;Up to 50 active offers on the brokerage&lt;BR&gt;Reduced earnest money and instant buy fees from the brokerage&lt;BR&gt;Permanent crystalbind&lt;BR&gt;Additional daily deliveries to fishing NPCs&lt;BR&gt;Twice as many daily quests&lt;BR&gt;+50% skill advancement XP&lt;BR&gt;+100% EP XP&lt;BR&gt;... and much more!" />
      <String id="10434" string="Permanent Account Rewards: &lt;BR&gt;8 characters available per server.&lt;BR&gt;4 bank tabs per server.&lt;BR&gt;&quot;Veteran of the Valkyon Federation&quot; title.&lt;BR&gt;Up to 30 items active on brokerage." hideCoolTime="True" />
      <String id="10435" string="Permanent Account Rewards: &lt;BR&gt;8 characters available per server.&lt;BR&gt;4 bank tabs per server." hideCoolTime="True" />
      <String id="10436" string="Permanent Account Rewards: &lt;BR&gt;10 characters available per server.&lt;BR&gt;5 bank tabs per server." hideCoolTime="True" />
      <String id="10437" string="Permanent Account Rewards: &lt;BR&gt;12 characters available per server.&lt;BR&gt;6 bank tabs per server." hideCoolTime="True" />
      <String id="10500" string="" />
      <String id="10530" string="" />
      <String id="10533" string="" />
      <String id="10534" string="" />
      <String id="10600" string="In order to prevent account theft, trading items or gold to inactive accounts is restricted.&lt;br&gt;Press the icon and verify your account to enable trading." />
      <String id="10601" string="Permanent Account Rewards: &lt;BR&gt;8 characters available per server.&lt;BR&gt;4 bank tabs per server.&lt;BR&gt;&quot;Veteran of the Valkyon Federation&quot; title.&lt;BR&gt;Up to 30 items active on brokerage." />
      <String id="10691" string="Monthly Account Rewards:&lt;BR&gt;Two Valkyon's Responses from Instance Matching.&lt;BR&gt;Twice as many available daily quests.&lt;BR&gt;Instance access twice as often.&lt;BR&gt;Sampler mount (changes periodically).&lt;BR&gt;Up to 50 items active on brokerage.&lt;BR&gt;Exempt from earnest money requirements on brokerage.&lt;BR&gt;Brokerage fee of only 10%.&lt;BR&gt;&lt;BR&gt;Village atlas.&lt;BR&gt;Ten strongbox keys.&lt;BR&gt;Traveler's Insurance scrolls.&lt;BR&gt;Boosts that replenish daily." />
      <String id="10733" string="" />
      <String id="10800" string="" />
      <String id="10801" string="" />
      <String id="10802" string="" />
      <String id="10803" string="" />
      <String id="10804" string="" />
      <String id="10805" string="" />
      <String id="10806" string="" />
      <String id="10807" string="" />
      <String id="10808" string="" />
      <String id="10809" string="" />
      <String id="10810" string="" />
      <String id="11000" string="Brokerage Registration Number: 50&lt;BR&gt;Broker's price negotiation: available&lt;BR&gt;Increases critical success chance by 10% on crafting items&lt;BR&gt;PC cafe inventory: available&lt;BR&gt;Acquire 100% additional experience&lt;BR&gt;Gain 100% additional hunting XP rewards&lt;BR&gt;Gain 10% additional EP XP rewards&lt;BR&gt;Significantly decreases crafting time." />
      <String id="11001" string="" />
      <String id="100031" string="" />
      <String id="100032" string="" />
      <String id="100033" string="Package Benefit" />
      <String id="100034" string="Package Benefit" />
      <String id="100070" string="Package Benefit" />
      <String id="100077" string="Package Benefit" />
      <String id="100101" string="" />
      <String id="100102" string="" />
      <String id="100103" string="Japan Returning user benefit" />
      <String id="100104" string="JP Tooltip" />
      <String id="100105" string="" />
      <String id="100106" string="" />
      <String id="100107" string="" />
      <String id="100108" string="" />
      <String id="100109" string="" />
      <String id="100333" string="Package Benefit" />
      <String id="100334" string="Package Benefit" />
      <String id="100335" string="Package Benefit" />
      <String id="100350" string="You are under the effect of double experience points." />
      <String id="100433" string="Package Benefit" />
      <String id="100434" string="Package Benefit" />
      <String id="100435" string="Package Benefit" />
      <String id="100436" string="Package Benefit" />
      <String id="100437" string="Package Benefit" />
      <String id="100500" string="" />
      <String id="100530" string="" />
      <String id="100533" string="" />
      <String id="100534" string="" />
      <String id="100600" string="Mail, Brokerage, Trade, Deathmatch, Guild Bank" />
      <String id="100601" string="Package Benefit" />
      <String id="100691" string="Safe Mode" />
      <String id="100733" string="" />
      <String id="100800" string="" />
      <String id="100801" string="" />
      <String id="100802" string="" />
      <String id="100803" string="" />
      <String id="100804" string="" />
      <String id="100805" string="" />
      <String id="100806" string="" />
      <String id="100807" string="" />
      <String id="100808" string="" />
      <String id="100809" string="" />
      <String id="100810" string="" />
      <String id="101000" string="Package Benefit" />
      <String id="101001" string="" />
      <String id="1000600" string="In order to prevent account theft, trading is restricted to inactive accounts." />
      <String id="1000601" string="In order to prevent account theft, trading items or gold is restricted." />
      <String id="77777777" string="&lt;font color = '#00A0FF'&gt;{EventName}&lt;/font&gt;" hideCoolTime="True" />
      <String id="88888888" string="Play Time Event" hideCoolTime="True" />
      <String id="1077777777" string="&lt;font color = '#ABF200'&gt;{EventType}&lt;/font&gt; &lt;font color = '#FFBB00'&gt;{EventValue}&lt;/font&gt;{RegionList}" hideCoolTime="True" />
      <String id="1088888888" string="The Play Time Event rewards players for accumulating play time each day and over the course of the event." hideCoolTime="True" />
      <String id="1188888888" string="Claim" />
      <String id="1288888888" string="Confirm" />
    </StrSheet_AccountBenefit>



Advertisement