Jump to content
3LGStevo

Conversion issue " to ""

Recommended Posts

I have an Altis Life server... everything has worked fine until recently where the last update now populates the database with "" everywhere where a " used to be.

I can't find out why this is now the case.

 

"[""765"",""Stevo"",""0"",""2629"",""3"",""1"",

"["765","Stevo","0","2629","3","1",

 

^ See above

 

Before the entries are populated into the database, as an array may contain "[ ]" tags, the array is converted to string using "ToString"

It is also converted using the default Altis Life MresToArray script:

private["_array"];
_array = [_this,0,"",[""]] call BIS_fnc_param;
if(_array == "") 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;

and re-compiled back to MRES for writing to the DB using:

private["_array"];
_array = [_this,0,[],[[]]] call BIS_fnc_param;
diag_log format ["MRESARRAY || Array 1: %1",_array];
_array = str(str(_array));
diag_log format ["MRESARRAY || Array 2: %1",_array];
_array = toArray(_array);
diag_log format ["MRESARRAY || Array 3: %1",_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];
		};
	};
};
diag_log format ["MRESARRAY || Array 4: %1",_array];

toString(_array);
diag_log format ["MRESARRAY || Array 5: %1",_array];

Share this post


Link to post
Share on other sites

I've found the problem to be with the command "Call Compile"

 

When the value is changed from ', the values remain correct, up until the call compile command.

 

15:38:48 "MREStoARRAY || Array 1: [[`license_cop_air`,0],[`license_cop_tf`,0]]"
15:38:48 "MREStoARRAY || Array 2: [91,91,96,108,105,99,101,110,115,101,95,99,111,112,95,97,105,114,96,44,48,93,44,91,96,108,105,99,101,110,115,101,95,99,111,112,95,116,102,96,44,48,93,93]"
15:38:48 "MREStoARRAY || Array 3: [91,91,39,108,105,99,101,110,115,101,95,99,111,112,95,97,105,114,39,44,48,93,44,91,39,108,105,99,101,110,115,101,95,99,111,112,95,116,102,39,44,48,93,93]"
15:38:48 "MREStoARRAY || Array 4: [['license_cop_air',0],['license_cop_tf',0]]"
15:38:48 "MREStoARRAY || Array 5: [[""license_cop_air"",0],[""license_cop_tf"",0]]"
 
 
Why has this changed?
There's nothing in the update notes regarding this...

Share this post


Link to post
Share on other sites

Fix for Altis Life code still using MRES function...
https://github.com/AsYetUntitled/Framework/commit/db66e545ef02faec2a2e9fd152eb5260b3deab8a

Note altis life forums are backup & they have discord setup aswell

----------------

This was asked to get changed by myself & afew other extension developers   https://feedback.bistudio.com/T79720
With this change its possible  to parse a str _array   in an extension without having to worry about user inputted data.


The changelog for this is 
Fixed: The GetText() method for a string would return an invalid string

The changelog is abit cryptic because they fixed a lowlevel engine function that got fixed.

Share this post


Link to post
Share on other sites

Fix for Altis Life code still using MRES function...

https://github.com/AsYetUntitled/Framework/commit/db66e545ef02faec2a2e9fd152eb5260b3deab8a

Note altis life forums are backup & they have discord setup aswell

----------------

This was asked to get changed by myself & afew other extension developers   https://feedback.bistudio.com/T79720

With this change its possible  to parse a str _array   in an extension without having to worry about user inputted data.

The changelog for this is 

Fixed: The GetText() method for a string would return an invalid string

The changelog is abit cryptic because they fixed a lowlevel engine function that got fixed.

 

I already have that code applied in my server, it still compiles a string containing an array, with double "" which becomes unreadable.

How do I fix the "null string" values that are now duplicated everywhere where a " used to be?

 

I also don't understand why you've had them change a base level function that already operates correctly.

If you have "...""..." as a string, you're using the double quotation as a single quotation contained inside a string. It should be written as '..."...'.

Instead, now every single compile request my server has, has "" contained within them... which is acceptable with integers and strings, but with arrays, the array context believes there's a missing , after each "" and completely breaks all arrays.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×