Welcome to the GBF Test Portal

This was built to track decompiler and CFG progress.

Decompiler Output

Backtrace

{
  "frames": []
}

Context

{
  "current_block_id": {
    "index": 23,
    "block_type": "Normal",
    "address": 7910
  },
  "current_ast_node_stack": [],
  "current_instruction": {
    "opcode": "Jne",
    "operand": {
      "Number": 7912
    },
    "address": 7909
  }
}
function onReceiveText(texttype#2, textoptions#1, textlines#0)
{
    lit#26 = "clientrc";
    // RegionId(0)
    // RegionId(1)
    if (texttype#2 == lit#26) 
    {
        lit#27 = 1;
        // RegionId(1)
        // RegionId(2)
        if (textoptions#1 == lit#27) 
        {
            lit#28 = "NewClientRC";
            lit#29 = "Control-NPC";
            lit#30 = "npc";
            fn_call#32 = triggerserver#31(lit#30, lit#29, lit#28);
            lit#33 = "bantypes";
            lit#34 = "lister";
            fn_call#37 = this.queueRequest(lit#34, lit#33);
            fn_call#39 = addPlayerlistMenuEntries#38();
        }
        // RegionId(3)
        else
        {
            lit#40 = 0;
            // RegionId(3)
            // RegionId(4)
            if (textoptions#1 == lit#40) 
            {
                fn_call#42 = killRC#41();
                lit#43 = "";
                // RegionId(4)
                // RegionId(5)
                if (textlines#0 != lit#43) 
                {
                    lit#44 = "RC Access Denied: ";
                    lit#45 = 0;
                    fn_call#48 = shared.adminMessage(lit#44 @ textlines#0[lit#45]);
                }
            }
        }
    }
    // RegionId(6)
    else
    {
        lit#49 = "serverflags";
        // RegionId(6)
        // RegionId(7)
        if (texttype#2 == lit#49) 
        {
            lit#50 = "options";
            // RegionId(7)
            // RegionId(8)
            if (texttype#2 == lit#50) 
            {
                lit#51 = "playerflags";
                // RegionId(8)
                // RegionId(9)
                if (texttype#2 == lit#51) 
                {
                    lit#52 = "playerweapons";
                    // RegionId(9)
                    // RegionId(10)
                    if (texttype#2 == lit#52) 
                    {
                        lit#53 = "playerchests";
                    }
                }
            }
        }
        // RegionId(11)
        // RegionId(12)
        if (phi<idx=0, regions=()>) 
        {
            lit#54 = "serverflags";
            // RegionId(12)
            // RegionId(13)
            if (texttype#2 == lit#54) 
            {
                lit#55 = "Server Flags";
                temp.title = lit#55;
            }
            // RegionId(14)
            else
            {
                lit#56 = "options";
                // RegionId(14)
                // RegionId(15)
                if (texttype#2 == lit#56) 
                {
                    lit#57 = "Server Options";
                    temp.title = lit#57;
                }
                // RegionId(16)
                else
                {
                    lit#58 = "playerflags";
                    // RegionId(16)
                    // RegionId(17)
                    if (texttype#2 == lit#58) 
                    {
                        lit#59 = "Player Flags: ";
                        temp.title = lit#59 @ textoptions#1;
                    }
                    // RegionId(18)
                    else
                    {
                        lit#60 = "playerweapons";
                        // RegionId(18)
                        // RegionId(19)
                        if (texttype#2 == lit#60) 
                        {
                            lit#61 = "Player Weapons: ";
                            temp.title = lit#61 @ textoptions#1;
                        }
                        // RegionId(20)
                        else
                        {
                            lit#62 = "playerchests";
                            // RegionId(20)
                            // RegionId(21)
                            if (texttype#2 == lit#62) 
                            {
                                lit#63 = "Player Chests: ";
                                temp.title = lit#63 @ textoptions#1;
                            }
                        }
                    }
                }
            }
            lit#66 = 1;
            lit#67 = 32;
            lit#68 = 0;
            lit#69 = 32;
            lit#70 = false;
            lit#71 = "-TextEditor";
            fn_call#73 = lit.openScript(temp.title, textlines#0, lit#70, {GuiRC.externalwindow.bounds[lit#68] + lit#69, GuiRC.externalwindow.bounds[lit#66] + lit#67});
            temp.object = fn_call#73;
            lit#74 = "-TextEditor";
            fn_call#76 = lit.setButtonProfile(temp.object, GuiRCButtonProfile#18);
            lit#77 = "-TextEditor";
            fn_call#79 = lit.setCheckBoxProfile(temp.object, GuiRCCheckBoxProfile#21);
            lit#80 = "-TextEditor";
            fn_call#82 = lit.setMLTextEditProfile(temp.object, GuiRCMLTextEditProfile#13);
            lit#83 = "-TextEditor";
            fn_call#85 = lit.setScrollProfile(temp.object, GuiRCScrollProfile#22);
            lit#86 = "-TextEditor";
            fn_call#88 = lit.setTextProfile(temp.object, GuiRCTextProfile#16);
            lit#89 = "-TextEditor";
            fn_call#91 = lit.setTextEditProfile(temp.object, GuiRCTextEditProfile#10);
            lit#92 = "-TextEditor";
            fn_call#94 = lit.setWindowProfile(temp.object, GuiRCWindowProfile#15);
            // RegionId(22)
            // RegionId(23)
            if (remotecontrol.options.noexternalstyle) 
            {
                lit#97 = "none";
            }
            // RegionId(24)
            else
            {
            }
            lit#98 = "-TextEditor";
            fn_call#100 = phi_fn_call({lit.setWindowStyle, temp.object, ...phi<idx=0, regions=()>});
            temp.object.texttype = texttype#2;
            temp.object.textoptions = textoptions#1;
            phi<idx=0, regions=()> = this.function_357_7;
        }
        // RegionId(27)
        else
        {
            lit#103 = "comments";
            // RegionId(27)
            // RegionId(28)
            if (texttype#2 == lit#103) 
            {
                lit#104 = "folderconfig";
            }
            // RegionId(29)
            // RegionId(30)
            if (phi<idx=0, regions=()>) 
            {
                lit#105 = "comments";
                // RegionId(30)
                // RegionId(31)
                if (texttype#2 == lit#105) 
                {
                    lit#106 = "Comments: ";
                    temp.title = lit#106 @ textoptions#1;
                }
                // RegionId(32)
                else
                {
                    lit#107 = "folderconfig";
                    // RegionId(32)
                    // RegionId(33)
                    if (texttype#2 == lit#107) 
                    {
                        lit#108 = "Folder Configuration";
                        temp.title = lit#108;
                    }
                }
                lit#109 = 1;
                lit#110 = 32;
                lit#111 = 0;
                lit#112 = 32;
                lit#113 = false;
                lit#114 = "-TextEditor";
                fn_call#116 = lit.openText(temp.title, textlines#0, lit#113, {GuiRC.externalwindow.bounds[lit#111] + lit#112, GuiRC.externalwindow.bounds[lit#109] + lit#110});
                temp.object = fn_call#116;
                lit#117 = "-TextEditor";
                fn_call#118 = lit.setButtonProfile(temp.object, GuiRCButtonProfile#18);
                lit#119 = "-TextEditor";
                fn_call#120 = lit.setCheckBoxProfile(temp.object, GuiRCCheckBoxProfile#21);
                lit#121 = "-TextEditor";
                fn_call#122 = lit.setMLTextEditProfile(temp.object, GuiRCMLTextEditProfile#13);
                lit#123 = "-TextEditor";
                fn_call#124 = lit.setScrollProfile(temp.object, GuiRCScrollProfile#22);
                lit#125 = "-TextEditor";
                fn_call#126 = lit.setTextProfile(temp.object, GuiRCTextProfile#16);
                lit#127 = "-TextEditor";
                fn_call#128 = lit.setTextEditProfile(temp.object, GuiRCTextEditProfile#10);
                lit#129 = "-TextEditor";
                fn_call#130 = lit.setWindowProfile(temp.object, GuiRCWindowProfile#15);
                // RegionId(34)
                // RegionId(35)
                if (remotecontrol.options.noexternalstyle) 
                {
                    lit#131 = "none";
                }
                // RegionId(36)
                else
                {
                }
                lit#132 = "-TextEditor";
                fn_call#133 = phi_fn_call({lit.setWindowStyle, temp.object, ...phi<idx=0, regions=()>});
                temp.object.texttype = texttype#2;
                temp.object.textoptions = textoptions#1;
                phi<idx=0, regions=()> = this.function_357_8;
            }
            // RegionId(39)
            else
            {
                lit#135 = "rights";
                // RegionId(39)
                // RegionId(40)
                if (texttype#2 == lit#135) 
                {
                    fn_call#137 = showRightsWindow#136(texttype#2, textoptions#1, textlines#0);
                }
                // RegionId(41)
                else
                {
                    lit#138 = "playerattributes";
                    // RegionId(41)
                    // RegionId(42)
                    if (texttype#2 == lit#138) 
                    {
                        fn_call#140 = showAttributesWindow#139(texttype#2, textoptions#1, textlines#0);
                    }
                    // RegionId(43)
                    else
                    {
                        lit#141 = "lister";
                        // RegionId(43)
                        // RegionId(44)
                        if (texttype#2 == lit#141) 
                        {
                            lit#142 = "accountlist";
                            // RegionId(44)
                            // RegionId(45)
                            if (textoptions#1 == lit#142) 
                            {
                                fn_call#144 = this.showAccountList(temp.textlines);
                            }
                            // RegionId(46)
                            else
                            {
                                lit#145 = "account";
                                // RegionId(46)
                                // RegionId(47)
                                if (textoptions#1 == lit#145) 
                                {
                                    fn_call#147 = this.showAccountData(temp.textlines);
                                }
                                // RegionId(48)
                                else
                                {
                                    lit#148 = "bantypes";
                                    // RegionId(48)
                                    // RegionId(49)
                                    if (textoptions#1 == lit#148) 
                                    {
                                        this.bantypes = temp.textlines;
                                    }
                                    // RegionId(50)
                                    else
                                    {
                                        lit#150 = "staffactivity";
                                        // RegionId(50)
                                        // RegionId(51)
                                        if (textoptions#1 == lit#150) 
                                        {
                                            lit#151 = 1;
                                            lit#152 = 32;
                                            lit#153 = 0;
                                            lit#154 = 32;
                                            lit#155 = true;
                                            lit#156 = 1;
                                            lit#157 = -1;
                                            builtin_fn_call#158 = textlines#0.subarray(lit#157, lit#156);
                                            lit#159 = "Staff Activity: ";
                                            lit#160 = 0;
                                            lit#161 = "-TextEditor";
                                            fn_call#162 = lit.openText(lit#159 @ temp.textlines[lit#160], builtin_fn_call#158, lit#155, {GuiRC.externalwindow.bounds[lit#153] + lit#154, GuiRC.externalwindow.bounds[lit#151] + lit#152});
                                            temp.object = fn_call#162;
                                            lit#163 = "-TextEditor";
                                            fn_call#164 = lit.setButtonProfile(temp.object, GuiRCButtonProfile#18);
                                            lit#165 = "-TextEditor";
                                            fn_call#166 = lit.setCheckBoxProfile(temp.object, GuiRCCheckBoxProfile#21);
                                            lit#167 = "-TextEditor";
                                            fn_call#168 = lit.setMLTextEditProfile(temp.object, GuiRCMLTextEditProfile#13);
                                            lit#169 = "-TextEditor";
                                            fn_call#170 = lit.setScrollProfile(temp.object, GuiRCScrollProfile#22);
                                            lit#171 = "-TextEditor";
                                            fn_call#172 = lit.setTextProfile(temp.object, GuiRCTextProfile#16);
                                            lit#173 = "-TextEditor";
                                            fn_call#174 = lit.setTextEditProfile(temp.object, GuiRCTextEditProfile#10);
                                            lit#175 = "-TextEditor";
                                            fn_call#176 = lit.setWindowProfile(temp.object, GuiRCWindowProfile#15);
                                            // RegionId(51)
                                            // RegionId(52)
                                            if (remotecontrol.options.noexternalstyle) 
                                            {
                                                lit#177 = "none";
                                            }
                                            // RegionId(53)
                                            else
                                            {
                                            }
                                            lit#178 = "-TextEditor";
                                            fn_call#179 = phi_fn_call({lit.setWindowStyle, temp.object, ...phi<idx=0, regions=()>});
                                        }
                                        // RegionId(55)
                                        else
                                        {
                                            lit#180 = "banhistory";
                                            // RegionId(55)
                                            // RegionId(56)
                                            if (textoptions#1 == lit#180) 
                                            {
                                                lit#181 = 1;
                                                lit#182 = 32;
                                                lit#183 = 0;
                                                lit#184 = 32;
                                                lit#185 = true;
                                                lit#186 = 1;
                                                lit#187 = -1;
                                                builtin_fn_call#188 = textlines#0.subarray(lit#187, lit#186);
                                                lit#189 = "Ban History: ";
                                                lit#190 = 0;
                                                lit#191 = "-TextEditor";
                                                fn_call#192 = lit.openText(lit#189 @ temp.textlines[lit#190], builtin_fn_call#188, lit#185, {GuiRC.externalwindow.bounds[lit#183] + lit#184, GuiRC.externalwindow.bounds[lit#181] + lit#182});
                                                temp.object = fn_call#192;
                                                lit#193 = "-TextEditor";
                                                fn_call#194 = lit.setButtonProfile(temp.object, GuiRCButtonProfile#18);
                                                lit#195 = "-TextEditor";
                                                fn_call#196 = lit.setCheckBoxProfile(temp.object, GuiRCCheckBoxProfile#21);
                                                lit#197 = "-TextEditor";
                                                fn_call#198 = lit.setMLTextEditProfile(temp.object, GuiRCMLTextEditProfile#13);
                                                lit#199 = "-TextEditor";
                                                fn_call#200 = lit.setScrollProfile(temp.object, GuiRCScrollProfile#22);
                                                lit#201 = "-TextEditor";
                                                fn_call#202 = lit.setTextProfile(temp.object, GuiRCTextProfile#16);
                                                lit#203 = "-TextEditor";
                                                fn_call#204 = lit.setTextEditProfile(temp.object, GuiRCTextEditProfile#10);
                                                lit#205 = "-TextEditor";
                                                fn_call#206 = lit.setWindowProfile(temp.object, GuiRCWindowProfile#15);
                                                // RegionId(56)
                                                // RegionId(57)
                                                if (remotecontrol.options.noexternalstyle) 
                                                {
                                                    lit#207 = "none";
                                                }
                                                // RegionId(58)
                                                else
                                                {
                                                }
                                                lit#208 = "-TextEditor";
                                                fn_call#209 = phi_fn_call({lit.setWindowStyle, temp.object, ...phi<idx=0, regions=()>});
                                            }
                                            // RegionId(60)
                                            else
                                            {
                                                lit#210 = "ban";
                                                // RegionId(60)
                                                // RegionId(61)
                                                if (textoptions#1 == lit#210) 
                                                {
                                                    fn_call#212 = showBanWindow#211(texttype#2, textoptions#1, temp.textlines);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        // RegionId(62)
                        else
                        {
                            lit#213 = "nextdbnpcid";
                            // RegionId(62)
                            // RegionId(63)
                            if (texttype#2 == lit#213) 
                            {
                                lit#214 = 0;
                                lit#215 = "npc";
                                fn_call#217 = showAddScript#216(lit#215, temp.textlines[lit#214]);
                            }
                            // RegionId(64)
                            else
                            {
                                lit#218 = "npc";
                                // RegionId(64)
                                // RegionId(65)
                                if (texttype#2 == lit#218) 
                                {
                                    lit#219 = "class";
                                    // RegionId(65)
                                    // RegionId(66)
                                    if (texttype#2 == lit#219) 
                                    {
                                        lit#220 = "weapon";
                                        // RegionId(66)
                                        // RegionId(67)
                                        if (texttype#2 == lit#220) 
                                        {
                                            lit#221 = "npcflags";
                                        }
                                    }
                                }
                                // RegionId(68)
                                // RegionId(69)
                                if (phi<idx=0, regions=()>) 
                                {
                                    lit#222 = 1;
                                    lit#223 = 32;
                                    lit#224 = 0;
                                    lit#225 = 32;
                                    lit#226 = false;
                                    lit#227 = "-TextEditor";
                                    fn_call#228 = lit.openScript(textoptions#1, temp.textlines, lit#226, {GuiRC.externalwindow.bounds[lit#224] + lit#225, GuiRC.externalwindow.bounds[lit#222] + lit#223});
                                    temp.object = fn_call#228;
                                    lit#229 = "-TextEditor";
                                    fn_call#230 = lit.setButtonProfile(temp.object, GuiRCButtonProfile#18);
                                    lit#231 = "-TextEditor";
                                    fn_call#232 = lit.setCheckBoxProfile(temp.object, GuiRCCheckBoxProfile#21);
                                    lit#233 = "-TextEditor";
                                    fn_call#234 = lit.setMLTextEditProfile(temp.object, GuiRCMLTextEditProfile#13);
                                    lit#235 = "-TextEditor";
                                    fn_call#236 = lit.setScrollProfile(temp.object, GuiRCScrollProfile#22);
                                    lit#237 = "-TextEditor";
                                    fn_call#238 = lit.setTextProfile(temp.object, GuiRCTextProfile#16);
                                    lit#239 = "-TextEditor";
                                    fn_call#240 = lit.setTextEditProfile(temp.object, GuiRCTextEditProfile#10);
                                    lit#241 = "-TextEditor";
                                    fn_call#242 = lit.setWindowProfile(temp.object, GuiRCWindowProfile#15);
                                    // RegionId(69)
                                    // RegionId(70)
                                    if (remotecontrol.options.noexternalstyle) 
                                    {
                                        lit#243 = "none";
                                    }
                                    // RegionId(71)
                                    else
                                    {
                                    }
                                    lit#244 = "-TextEditor";
                                    fn_call#245 = phi_fn_call({lit.setWindowStyle, temp.object, ...phi<idx=0, regions=()>});
                                    temp.object.texttype = texttype#2;
                                    temp.object.textoptions = textoptions#1;
                                    phi<idx=0, regions=()> = this.function_357_9;
                                }
                                // RegionId(74)
                                else
                                {
                                    lit#247 = "weaponlist";
                                    // RegionId(74)
                                    // RegionId(75)
                                    if (texttype#2 == lit#247) 
                                    {
                                        lit#248 = "Close";
                                        lit#249 = "Edit";
                                        lit#250 = "Delete";
                                        lit#251 = "Add";
                                        lit#252 = "Weapons";
                                        fn_call#254 = showList#253(lit#252, temp.textlines, {lit#251, lit#250, lit#249, lit#248});
                                    }
                                    // RegionId(76)
                                    else
                                    {
                                        lit#255 = "npclist";
                                        // RegionId(76)
                                        // RegionId(77)
                                        if (texttype#2 == lit#255) 
                                        {
                                            lit#256 = "Close";
                                            lit#257 = "Edit";
                                            lit#258 = "Delete";
                                            lit#259 = "Add";
                                            lit#260 = "Flags";
                                            lit#261 = "NPCs";
                                            fn_call#262 = showList#253(lit#261, temp.textlines, {lit#260, lit#259, lit#258, lit#257, lit#256});
                                        }
                                        // RegionId(78)
                                        else
                                        {
                                            lit#263 = "classlist";
                                            // RegionId(78)
                                            // RegionId(79)
                                            if (texttype#2 == lit#263) 
                                            {
                                                lit#264 = "Close";
                                                lit#265 = "Edit";
                                                lit#266 = "Delete";
                                                lit#267 = "Add";
                                                lit#268 = "Classes";
                                                fn_call#269 = showList#253(lit#268, temp.textlines, {lit#267, lit#266, lit#265, lit#264});
                                            }
                                            // RegionId(80)
                                            else
                                            {
                                                lit#270 = "folders";
                                                // RegionId(80)
                                                // RegionId(81)
                                                if (texttype#2 == lit#270) 
                                                {
                                                    fn_call#272 = openFileBrowser#271();
                                                    fn_call#274 = FileBrowser_Tree.clearNodes();
                                                    lit#275 = 0;
                                                    for (phi<idx=0, regions=()> : phi<idx=1, regions=()>) 
                                                    {
                                                        lit#276 = "/";
                                                        fn_call#278 = FileBrowser_Tree.addNodeByPath(foldername#5, lit#276);
                                                        subnode#279 = fn_call#278;
                                                        lit#281 = 1;
                                                        subnode.sortgroup = lit#281;
                                                        lit#283 = false;
                                                        subnode.expanded = lit#283;
                                                        phi<idx=0, regions=()>++;
                                                    }
                                                    fn_call#285 = FileBrowser_Tree.sort();
                                                }
                                                // RegionId(85)
                                                else
                                                {
                                                    lit#286 = "folder";
                                                    // RegionId(85)
                                                    // RegionId(86)
                                                    if (texttype#2 == lit#286) 
                                                    {
                                                        fn_call#289 = FileBrowser_FilesList.clearRows();
                                                        this.displayedfiles = temp.textlines;
                                                        lit#291 = 0;
                                                        i#292 = lit#291;
                                                        builtin_fn_call#293 = textlines#0.size();
                                                        while (i#9 < builtin_fn_call#293) 
                                                        {
                                                            fileentry#294 = temp.textlines[i#9];
                                                            lit#295 = 0;
                                                            lit#296 = "\t  ";
                                                            lit#297 = 1;
                                                            lit#298 = "\t";
                                                            lit#299 = 2;
                                                            lit#300 = "\t";
                                                            lit#301 = 3;
                                                            lit#302 = "%Y-%m-%d %H:%M:%S";
                                                            fn_call#303 = timestamp#17(lit#302, fileentry#24[lit#301]);
                                                            str#304 = (((((fileentry#24[lit#295] @ lit#296) @ fileentry#24[lit#297]) @ lit#298) @ fileentry#24[lit#299]) @ lit#300) @ fn_call#303;
                                                            fn_call#306 = FileBrowser_FilesList.addRow(i#292, str#304);
                                                            // RegionId(88)
                                                            // RegionId(89)
                                                            with (fn_call#306) 
                                                            {
                                                                lit#308 = 2;
                                                                sortvalue#309 = fileentry#294[lit#308];
                                                            }
                                                            lit#310 = 0;
                                                            lit#311 = ".";
                                                            builtin_fn_call#312 = fileentry#294[lit#310].positions(lit#311);
                                                            dotpos#313 = builtin_fn_call#312;
                                                            builtin_fn_call#314 = dotpos#313.size();
                                                            lit#315 = 0;
                                                            // RegionId(90)
                                                            // RegionId(91)
                                                            if (builtin_fn_call#314 > lit#315) 
                                                            {
                                                                lit#316 = "fileicon_";
                                                                lit#317 = 0;
                                                                builtin_fn_call#318 = dotpos#313.size();
                                                                lit#319 = 1;
                                                                lit#320 = 1;
                                                                lit#321 = -1;
                                                                builtin_fn_call#322 = fileentry#294[lit#317].substring(dotpos#313[(builtin_fn_call#318 - lit#319)] + lit#320, lit#321);
                                                                lit#323 = ".png";
                                                            }
                                                            // RegionId(92)
                                                            else
                                                            {
                                                                lit#324 = "";
                                                            }
                                                            phi<idx=1, regions=()> = phi<idx=0, regions=()>;
                                                            lit#325 = 16;
                                                            lit#326 = 16;
                                                            lit#327 = 0;
                                                            lit#328 = 0;
                                                            lit#329 = 0;
                                                            lit#330 = 0;
                                                            fn_call#331 = lastRow#25();
                                                            fn_call#334 = fn_call.icon.drawimagerectangle(lit#330, lit#329, imgfilename#8, lit#328, lit#327, lit#326, lit#325);
                                                            i#335 = i#9 + 1;
                                                        }
                                                        fn_call#336 = FileBrowser_FilesList.sort();
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    lit#337 = 0;
    return lit#337;
}