invcust + celle = no skin saving

Discussion in 'Celle' started by hambeast, Apr 12, 2013.

  1. hambeast

    hambeast Well-Known Member

    Joined:
    Nov 2, 2012
    Messages:
    189
    Likes Received:
    19
    When players log out of my server, the skins save in the database as their proper model but when they log back in, they are changed to a survivor model. I checked the server_playerlogin.sqf file and commented the code out for the model check...

    Any idea how to get this working?

    Here is my server_playerLogin.sqf
    Code:
    private["_botActive","_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"];
    //Set Variables
     
    diag_log ("STARTING LOGIN: " + str(_this));
     
    _playerID = _this select 0;
    _playerObj = _this select 1;
    _playerName = name _playerObj;
    _worldspace = [];
     
    if (_playerName == '__SERVER__' || _playerID == '' || local player) exitWith {};
     
    if (count _this > 2) then {
    dayz_players = dayz_players - [_this select 2];
    };
     
    //Variables
    _inventory =[];
    _backpack =[];
    _items =[];
    _magazines =[];
    _weapons =[];
    _medicalStats =[];
    _survival =[0,0,0];
    _tent =[];
    _state =[];
    _direction =0;
    _model ="";
    _newUnit =objNull;
    _botActive = false;
     
    if (_playerID == "") then {
    _playerID = getPlayerUID _playerObj;
    };
     
    if ((_playerID == "") or (isNil "_playerID")) exitWith {
    diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID");
    };
     
    //??? endLoadingScreen;
    diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);
     
    //Do Connection Attempt
    _doLoop = 0;
    while {_doLoop < 5} do {
    _key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
    _primary = _key call server_hiveReadWrite;
    if (count _primary > 0) then {
    if ((_primary select 0) != "ERROR") then {
    _doLoop = 9;
    };
    };
    _doLoop = _doLoop + 1;
    };
     
    if (isNull _playerObj or !isPlayer _playerObj) exitWith {
    diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj));
    };
     
    if ((_primary select 0) == "ERROR") exitWith {
        diag_log format ["LOGIN RESULT: Exiting, failed to load _primary: %1 for player: %2 ",_primary,_playerID];
    };
     
    //Process request
    _newPlayer =_primary select 1;
    _isNew =count _primary < 6; //_result select 1;
    _charID =_primary select 2;
    _randomSpot = false;
     
    //diag_log ("LOGIN RESULT: " + str(_primary));
     
    /* PROCESS */
    _hiveVer = 0;
     
    if (!_isNew) then {
    //RETURNING CHARACTER
    _inventory =_primary select 4;
    _backpack =_primary select 5;
    _survival =_primary select 6;
    _model =_primary select 7;
    _hiveVer =_primary select 8;
     
    if (_model == "") then {
    _key = format["CHILD:999:select replace(cl.`inventory`, '""', '""""') inventory, replace(cl.`backpack`, '""', '""""') backpack, replace(coalesce(cl.`model`, 'Survivor2_DZ'), '""', '""""') model from `cust_loadout` cl join `cust_loadout_profile` clp on clp.`cust_loadout_id` = cl.`id` where clp.`unique_id` = '?':[%1]:",str(_playerID)];
    _data = "HiveEXT" callExtension _key;
    //Process result
    _result = call compile format ["%1", _data];
    _status = _result select 0;
    if (_status == "CustomStreamStart") then {
    if ((_result select 1) > 0) then {
    _data = "HiveEXT" callExtension _key;
    _result = call compile format ["%1", _data];
    _inventory = call compile (_result select 0);
    _backpack = call compile (_result select 1);
    _model = call compile (_result select 2);
    };
    };
    };
    //if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","SurvivorW2_DZ"])) then {
    //_model = "Survivor2_DZ";
    //};
     
    } else {
    _model =_primary select 3;
    _hiveVer =_primary select 4;
    if (isNil "_model") then {
    _model = "Survivor2_DZ";
    } else {
    if (_model == "") then {
    _model = "Survivor2_DZ";
    };
    };
     
    //Record initial inventory
    _config = (configFile >> "CfgSurvival" >> "Inventory" >> "Default");
    _mags = getArray (_config >> "magazines");
    _wpns = getArray (_config >> "weapons");
    _bcpk = getText (_config >> "backpack");
    _randomSpot = true;
     
    //Wait for HIVE to be free
    _key = format["CHILD:203:%1:%2:%3:",_charID,[_wpns,_mags],[_bcpk,[],[]]];
    _key call server_hiveWrite;
     
    };
    diag_log ("LOGIN LOADED: " + str(_playerObj) + " Type: " + (typeOf _playerObj));
     
    _isHiveOk = false;//EDITED
    if (_hiveVer >= dayz_hiveVersionNo) then {
    _isHiveOk = true;
    };
    //diag_log ("SERVER RESULT: " + str("X") + " " + str(dayz_hiveVersionNo));
     
    //Server publishes variable to clients and WAITS
    //_playerObj setVariable ["publish",[_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer],true];
     
    dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer];
    (owner _playerObj) publicVariableClient "dayzPlayerLogin";
    
     
  2. Punisher79

    Punisher79 New Member

    Joined:
    Mar 3, 2013
    Messages:
    5
    Likes Received:
    0
    did you find a fix? I need this too. :/
     
  3. McKeighan

    McKeighan Well-Known Member

    Joined:
    Jan 8, 2013
    Messages:
    103
    Likes Received:
    6
    It has to do with the models in use not being allowed in the dayz_anim.pbo, but being allowed by Rmod2. It reads the @dayz mod first, before @rmod2, so it instantly kills the new model, before allowing it to be worn.

    The check to see if the model is allowed being commented out is irrelivant if the class is not also commented out from the config.cpp found in dayz_anim.pbo.

    You MAY get some traction by dropping in some code in the map file that would hopefully superceede the banned list found in anim.pbo.

    -----------

    It sadly would be WAY easier to just force your server population to use an altered version of @dayz then it would be to figure out how to allow these "banned" items without over-riding the @dayz coding.

    -----------

    Another thought - what if a segment of server side code was written, that on player connect to the server, it checks the current model being worn. If it's not in the allowed list, it drops the skin_model into their inventory automatically, so while they lose the skin on connect, they have it back in their inventory. Maybe having it spawn at their feet would be better - in case the inventory is full.... Just a thought.
     

Share This Page