Author Topic: [BL SOURCE CODE/REFERENCE] ServerLoadSaveFile_Start/Tick/End/Color Data  (Read 9545 times)

cm's decompilers are stuffe
It's really not considering it gives correct output

It's really not considering it gives correct output
cm's decompiler actually does not handle arrays properly either

cm's decompiler actually does not handle arrays properly either
It actually compiles/decompiles it just fine, and you can see all the correct opcodes, it's just the code it displays in the disassembly file that isn't quite right when you start to work with arrays on objects.
Decompiling? Just fine. Disassembly, slightly less so.
« Last Edit: February 08, 2017, 09:33:23 PM by Ipquarx »

It actually compiles/decompiles it just fine, and you can see all the correct opcodes, it's just the code it displays in the disassembly file that isn't quite right when you start to work with arrays on objects.
Decompiling? Just fine. Disassembly, slightly less so.
sorry i meant disassembly output whatever same thing ;_;

I came here expecting cheese

even if it is incorrect its probably still somewhat useful - hopefully the code gets updated soon.

even if it is incorrect its probably still somewhat useful - hopefully the code gets updated soon.

Code: [Select]
function New_QueueSO(%size)
{
if (%size <= 1.0 || %size > 10000.0)
{
error("ERROR: New_QueueSO() - invalid size '" @ %size @ "'");
return;
}
%ret = new ScriptObject()
{
size = %size;
head = 0;
tail = 0;
};
MissionCleanup.add(%ret);
%i = 0;
while(%i < %size)
{
%ret.val[%i] = 0;
%i += 1;
}
return %ret;
}

function QueueSO::push(%obj, %val)
{
%obj.val[%obj.head] = %val;
%obj.head = (%obj.head+1)%%obj.size;
%obj.val[%obj.head] = 0;
if (%obj.head == %obj.tail)
{
%obj.tail = (%obj.tail+1)%%obj.size;
}
return 0;
}

function QueueSO::pop(%obj)
{
if(%obj.head != %obj.tail)
{
%obj.head--;
if(%obj.head < 0)
{
%obj.head = %obj.size-1;
}
%ret = %obj.val[%obj.head];
%obj.val[%obj.head] = 0;
}
return %ret;
}
function QueueSO::dumpVals(%obj)
{
%i = 0;
while(%i < %obj.size)
{
%line = %i @ %obj.val[%i];
if (%obj.head == %i)
{
%line = %line @ " <Head";
}
if (%obj.tail == %i)
{
%line = %line @ " <Tail";
}
echo(%line);
%i = %i + 1.0;
}
return %line;
}

Edit: thanks mctwist for catching that ♥
« Last Edit: April 20, 2017, 10:03:55 PM by Swollow »

It actually compiles/decompiles it just fine, and you can see all the correct opcodes, it's just the code it displays in the disassembly file that isn't quite right when you start to work with arrays on objects.
Decompiling? Just fine. Disassembly, slightly less so.
It doesn't even handle ternary operations correctly

Updated the QueueSO code to be accurate, and posted the BanManagerSO code.

can we request things for you to release or no

Do you even look at the code to fix it?

Do you even look at the code to fix it?
Using a (WIP) decompiler - if errors are found the decompiler gets fixed.



can we request things for you to release or no
Depends on what you request and what it contains.



Posted event registration. Also, found these cute:


function ExplosionData::onAdd(%this, %obj)
{
   echo("explosion on adD");
}


function E(%val)
{
   if (!isUnlocked())
   {
      return;
   }
   %filePattern = "base/server/*" @ %val @ "*.cs";
   %file = findFirstFile(%filePattern);
   while(%file !$= "")
   {
      exec(%file);
      %file = findNextFile(%filePattern);
   }
   %filePattern = "base/server/*/" @ %val @ "*.cs";
   %file = findFirstFile(%filePattern);
   while(%file !$= "")
   {
      exec(%file);
      %file = findNextFile(%filePattern);
   }
   %filePattern = "add-ons/*/" @ %val @ "*.cs";
   %file = findFirstFile(%filePattern);
   while(%file !$= "")
   {
      exec(%file);
      %file = findNextFile(%filePattern);
   }
   %filePattern = "add-ons/" @ %val @ "*.cs";
   %file = findFirstFile(%filePattern);
   while(%file !$= "")
   {
      exec(%file);
      %file = findNextFile(%filePattern);
   }

}
« Last Edit: March 05, 2017, 06:19:31 AM by Mocha »

Those loops should most likely be for loops.

Loading code has been posted.