No unlocks

Discussion in 'BF2Statistics discussion' started by Sunnyghost, Apr 2, 2021.

  1. Sunnyghost

    Sunnyghost Member

    For some reason I don't get the question to choose a new unlock kit, when i log in to BF2.
    I am using BF2statistics 3.03 and playing mainly AIX2.
    All points, medals, ribbons and badges that I earned in game, are visible in BF2HQ. But I am not able to unlock one of the bonus kits. BF2 should give me to choice to select a kit to unlock, because I ahve enough points but I never get that option.
    When I manualy added the player_unlock table, the unlocks are shown in BF2HQ and I can use them in game.

    Anybody info to solve this?
     
  2. Wilson212

    Wilson212 Administrator Staff Member

    Are there any errors in the ASP log files? (Look in /ASP/system/logs" folder)
     
  3. Sunnyghost

    Sunnyghost Member

    No errors in log files.

    Maybe I just don't understand how it should work?

    My situation:

    BF2statistics version 3 Beta 4
    MS server 2016
    XAMPP windows-x647.2.34-0-VC15

    4 authorised servers: AIX2.0 conguest, AIX2.0 COOP, Special Forces COOP and BF2 conguest.
    All servers are uploading snapshots without any problem.

    Private Stats Admin:

    Rank Checking - disabled
    Awards Require Round Completion - disabled
    Unlocks Option - Earned
    Bonus Unlocks - Basic
    Min Rank for unlocks - Lance Corporal(2)

    All awards earned in game, are shown in BF2HQ and BF2sclone ( Badges, ribbons and unlocks ). so far so good.
    Even all unlocks I earned are shown BF2sclone and I can use them in game.

    The only thing i don't understand: The unlocks I earned ( because of the badges ), are not shown as un-locked in BF2HQ and i don't get a pop-up screen when I log in to BF2, thats telling me there are unlocks available and the option to select them.

    I also noticed the "player_unlock" table is empty.

    It looks like i only get the unlocks because i earned the "basic" badges and not because of the earned points ( 500+ ).
    If I change the "Bonus Unlocks" option to "veteran", i dont get any unlocks ( because i dont have the badges ) but i also do not get an unlock, after eaching more then 500 points.

    Maybe my thinking is wrong?
     
  4. Wilson212

    Wilson212 Administrator Staff Member

    What you are saying sounds right. I will take a look at this and see if maybe there is a bug in my code that is preventing unlocks from being stored properly
     
    Last edited: Apr 5, 2021
  5. Sunnyghost

    Sunnyghost Member

    Edit after latest update from beta 3 to beta 4:

    I have all basic badges. My score is 500+ points.
    I have no unlocks at all in game and they are also not visible in BF2HQ and BF2sclone.
    "player_unlock" table is empty.

    When I put one unlock in the "player-unlock" table, i get next screen in game and only can select "choose later" to close this screen. When i select "select unlock", it starts a loop.

    [​IMG]
     
  6. Wilson212

    Wilson212 Administrator Staff Member

    This is a lot of good information, thank you! Once I get home from work today I will look into getting this fixed (seems like an issue with the ASP).
     
  7. Sunnyghost

    Sunnyghost Member

    More info and hopefully you can use this. ( I earned bronze medic,
    Assault and Spec Ops badge ) ( I also earned 185 points in game ) ( Unlock options - "earned", Bonus unlocks - "Basic" and Min Rank for unlocks - "Pvt First Class (1) ).

    Checked the queries found in "getunlocksinfo.php" and "selectunlock.php".

    getunlocksinfo:
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    selectunlock.php

    [​IMG]
    [​IMG]
    [​IMG]

    Just for testing, i added kit 11

    [​IMG]
    [​IMG]
    [​IMG]
     
    Last edited: Apr 5, 2021
  8. Wilson212

    Wilson212 Administrator Staff Member

    After a review of my latest beta code, this is indeed a problem with my code. I am going to re-do the unlock system over the next couple of days and release an improved unlocks system, which will allow you to control which unlocks require other unlocks to be selected (plus, the bug fix ;))
     
    kjhedges likes this.
  9. Sunnyghost

    Sunnyghost Member

    Thanks again Wilson ;)
     
  10. Hjaldrgud

    Hjaldrgud New Member

    Hello. I'm having the same problem.

    Example of log error:
    2021-09-15 16:20:57 -- ERROR: A Handled Exception was logged
    Exception Type: PDOException
    Message: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1
    Code: 21S01
    File: C:\Battlefield 2 servershit\xampp\htdocs\ASP\aspx\selectunlock.php
    Line: 81
    Stack Trace:
    [0] => [
    "/aspx/selectunlock.php" @ line 81
    PDO->exec('INSERT INTO player_unlock VALUES (2900204, 66, 1631715657)')
    ]
    [1] => [
    "/system/System.php" @ line 128
    include('C:\Battlefield 2 servershit\xampp\htdocs\ASP\aspx\selectunlock.php')
    ]
    [2] => [
    "/system/System.php" @ line 52
    System::HandleAspxRequest()
    ]
    [3] => [
    "/index.php" @ line 47
    System::Run()
    ]

    video showing:


    config options:
    $game_unlocks = 0;
    $game_unlocks_bonus = 3;
    $game_unlocks_bonus_min = 7;
    $game_awds_ignore_time = 0;

    no player_unlock tables created
    [​IMG]

    I'm running a bf2 version 1.41 of the game. Everything else with the system is running stellar. You deserve all the praise in the world.

    Bonus questions:
    -Am I able to edit the unlock code so I get all the unlocks based on rank, and none of the bonus ones based on badges?
    Just continue from this one(selectunlock.php) and build it upwards:
    "if ($rank >= 9)
    {
    return 7;
    }"

    -Is the system able to support more than 14 unlocks? say seven more for a total of 21.
    14 based on rank, and seven on badges.


    EDIT: I seem to have fixed my problem by editing "selectunlock.php" in ..\..\xampp\htdocs\ASP\aspx. Line 81:

    $connection->exec("INSERT INTO player_unlock VALUES ($pid, $id, $time)");

    Simply remove $time:

    $connection->exec("INSERT INTO player_unlock VALUES ($pid, $id)");


    Now I can recieve the unlocks and I get no strange loops or problems. Again I must say that this thing you've made is a thing of beauty. My bonus questions are still open to be answered though :p
     
    Last edited: Sep 15, 2021

Share This Page