Closed BoGuu closed 7 years ago
@angryfatty You didn't fixed the cop column. Check the integrity of the cop column or reset it to the default
"[]"
Running a 4.4 server (not r3) none of the fixes above fix the issue of spawning with no gear or licenses :( It initially works, but as soon as you leave the server and rejoin (lobby or server list) the columns re write the '' into the database.
@JedINyte Post your mres (array) functions, and a snap shot of your DB.
Hello Boguu, im fairly new to all this, never had to delve this deep into the database before: mresarray:
` /* File: fn_mresArray.sqf Author: Bryan "Tonic" Boardwine";
Description:
Acts as a mres (MySQL Real Escape) for arrays so they
can be properly inserted into the database without causing
any problems. The return method is 'hacky' but it's effective.
*/ private ["_array"]; _array = [_this,0,[],[[]]] call BIS_fnc_param; _array = str _array; _array = toArray(_array);
for "_i" from 0 to (count _array)-1 do { _sel = _array select _i; if ((_i != 0 && _i != ((count _array)-1))) then { if (_sel isEqualTo 34) then { _array set[_i,96]; }; }; };
str(toString(_array));`
mres to array:
`/ File: fn_mresToArray.sqf Author: Bryan "Tonic" Boardwine"; Description: Acts as a mres (MySQL Real Escape) for arrays so they can be properly inserted into the database without causing any problems. The return method is 'hacky' but it's effective. / private["_array"]; _array = [_this,0,"",[""]] call BIS_fnc_param; if (_array isEqualTo "") exitWith {[]}; _array = toArray(_array);
for "_i" from 0 to (count _array)-1 do { _sel = _array select _i; if (_sel == 96) then { _array set[_i,39]; }; };
_array = toString(_array); _array = call compile format["%1", _array]; _array;`
what do you mean by a snapshot of DB?
I assume the ' at the start of that file and end on jedi is an attempt at markdown...
Also you guys need to make sure you're not doing the sql update while that player is on the server.... hope thats obvious...
Hope we can all now learn why its important to test arma updates on a test instance and db prior to updating a live production server... and why doing a backup is necessary before hand.
The ' at the start and end is where i tried to add it as code on here lol (the little <> box)!! I thought it would put it in a neat box, but it just displayed as is with the' at each end. The player isn't on the server when updating the SQL :)
@boguu 4.4R3
if (isAwesome){ return true }
@JedINyte, one backtick `
is for single-line code. Three backticks ```
above and below are for multi-line code blocks. Hope that clears it up.
im still having the issue with db after doing the mresarray fix anyone help??
@Gentism You need to fix your database as well. Either restore a backup or look for some little scripts in this issue thread.
@rebornfuel as @tkcjesse said. Why it only works for seconds is because you still have players on your server while updating the MySQL entries.
Just shut your server down, update the tables and then connect and it will work. At least for that issue.
But we still haven't pinpointed the issue itself or what is causing it?
@xProlithium, str on the Bohemia Interactive Community Wiki:
... Since Arma 3 v1.63.137891 this command will correctly escape all " inside a string:
str command does not escape nested double-quotes for strings on the Bohemia Interactive Feedback Tracker.
I just stumbled upon another issue and that is that as soon as you open your house crates everything and then log back in everything is gone.
See error log http://hastebin.com/xivobukafi.bash
@SimZor, it is the same issue; it is just affecting a different table.
Reference: https://github.com/AsYetUntitled/Framework/issues/81
I have an older version of tonic's mres so not only am I somewhat lost and how to fix it, I feel in the dark due to the version of the files as well.
@xProlithium, attach a copy of your fn_mresArray.sqf to a comment.
@Jawshy
private["_array"];
_array = [_this,0,[],[[]]] call BIS_fnc_param;
_array = str(str(_array));
_array = toArray(_array);
for "_i" from 0 to (count _array)-1 do
{
_sel = _array select _i;
if((_i != 0 && _i != ((count _array)-1))) then
{
if(_sel == 34) then
{
_array set[_i,96];
};
};
};
toString(_array);
When comparing mine to the one shown above, I saw very little difference, however when I overwrote it, I got an error in the insert
Better? I tried it the first time with ' and it didn't work lol
@Jawshy so that means I can just do the DB fix for that table aswell?
I needed to fix the following columns in my DB:
containers: inventory gear
gangs: members
players: aliases civ_licenses cop_licenses med_licenses civ_gear cop_gear med_gear
vehicles: inventory gear
wanted wantedCrimes
@xProlithium,
private["_array"];
_array = [_this,0,[],[[]]] call BIS_fnc_param;
_array = str _array;
_array = toArray(_array);
for "_i" from 0 to (count _array)-1 do
{
_sel = _array select _i;
if((_i != 0 && _i != ((count _array)-1))) then
{
if(_sel == 34) then
{
_array set[_i,96];
};
};
};
str(toString(_array));
@SimZor, yes. See @setoy's comment above.
There was no ´´ in my DB in any other tables than players, but yet it sometimes spits out the error.
@Jawshy
@Jawshy I'm getting an error in the asyncCall.sqf on line 53 and 56.
private["_queryStmt","_queryResult","_key","_mode","_return","_loop"];
_queryStmt = [_this,0,"",[""]] call BIS_fnc_param;
_mode = [_this,1,1,[0]] call BIS_fnc_param;
_multiarr = [_this,2,false,[false]] call BIS_fnc_param;
_key = "extDB2" callExtension format["%1:%2:%3",_mode,(call life_sql_id), _queryStmt];
if(_mode isEqualTo 1) exitWith {true};
_key = call compile format["%1",_key];
_key = _key select 1;
uiSleep (random .03);
_queryResult = "";
_loop = true;
while{_loop} do
{
_queryResult = "extDB2" callExtension format["4:%1", _key];
if (_queryResult isEqualTo "[5]") then {
_queryResult = "";
while{true} do {
_pipe = "extDB2" callExtension format["5:%1", _key];
if(_pipe isEqualTo "") exitWith {_loop = false};
_queryResult = _queryResult + _pipe;
};
}
else
{
if (_queryResult isEqualTo "[3]") then
{
uisleep 0.1;
} else {
_loop = false;
};
};
};
if(typeName _queryResult == "STRING") then {_queryResult = call compile _queryResult};
_return = (_queryResult select 1);
if(!_multiarr) then {
_return = _return select 0;
} else {
if((count (_return select 0)) == 0) then {_return = []};
};
_return;
Not sure what it refers to.
Line 53 is
_return = (_queryResult select 1);
and 56 is
if(!_multiarr) then {
_return = _return select 0;
I'm using 3.1.4.8 i have problem when players log out there gear is disappear after this update how i can solve this?
Lmfaoooo. Omg.
Is this troll?
Didn't they teach you to read in school?
Dude HAS to be trolling. Holy fuck. Man this thread... lmao.
So is any one still broken?
yes we are broken still
So @BoGuu whats been the issues? Does this actually not fix it for some peoplem or is it bad db stuff after they've realized somethings broken?
I've tried all the written ,Didn't work
mresArray http://pastebin.com/YD0UsEm5
mresToArray http://pastebin.com/9ZAR5XT7
https://github.com/AsYetUntitled/Framework/issues/104#issuecomment-249028317
https://github.com/AsYetUntitled/Framework/issues/104#issuecomment-249198252
@riskingfusion and @BartoCarto, your fn_mresArray.sqf file has not been updated with this change.
@Twisted123 Please post the files asked for, and a screenshot of your database (with recently logged in people)
@BartoCarto You haven't followed the one thing you were told to do in the OP
i have made this change https://github.com/AsYetUntitled/Framework/commit/db66e545ef02faec2a2e9fd152eb5260b3deab8a
same problem
@BartoCarto, the fn_mresArray.sqf on the Pastebin file you linked does not have the latest change. The green highlight on the diff is the latest code.
If your database contains malformed entries then following the steps outlined in https://github.com/AsYetUntitled/Framework/issues/104#issue-178678747.
If you have malformed entries in your DB, run the following command:
UPDATE `players` SET `civ_licenses` = replace(civ_licenses, '``', '`') where uid>=0;
Replace
players
andciv_licenses
with relevant table/column (licenses, gear, containers etc etc.)Or alternatively you can dump your DB, and find/replace
` ->
, then reupload.
Has this been fixed yet or anyone found a way to fix it?
@Twisted123 what exactly is your problem? You haven't posted any details about what your particular problem is, have you even made the changes stated?
after running this "fix" got https://gyazo.com/478e2e9eb6cc58588a386e838e716690 any help would be appreciated
@numpty9989 Post a picture of your gear in the database
@numpty9989 Please refer to the original post, which contains SQL to remove the malformed entries. (The double `` )
me running query https://gyazo.com/709163b4ba3cd810f959a54e165181f2 me running it https://gyazo.com/2995b13a11d01eec3c0d6b5bbdb78e20 original time i did it said affected 24 rows
@numpty9989 'Replace players and civ_licenses with relevant table/column (licenses, gear, containers etc etc.)'
huh
Please make the changes from this commit: db66e545ef02faec2a2e9fd152eb5260b3deab8a, to your life_server/Functions/MySQL/fn_mresArray.sqf. If you use a headless client, change the relevant file in life_hc also.
Update:
If you have malformed entries in your DB (contains ``) then replace your mresToArray with the following:
http://hastebin.com/omikofajej.cpphttps://gist.github.com/BoGuu/c552b652f752378f06a42c809150032e
Over time they should fix themselves, and you can revert back to the original.