@@ -83,7 +83,7 @@ private void Reset()
8383 public TString Name { get ; set ; }
8484 public TString File { get ; set ; }
8585 private int Gs1Flags { get ; set ; }
86- public ScriptMachine Machine { get ; set ; }
86+ public ScriptMachine Machine { get ; }
8787 private DateTime ? Timer { get ; set ; }
8888
8989 public ScriptCom [ ] Bytecode => _bytecode ;
@@ -286,172 +286,7 @@ private static void onScriptUpdated()
286286
287287 private static void optimizeByteCode ( )
288288 {
289- /*
290- TString str;
291- uint hashcode;
292- TScriptProperty* pTVar1;
293- int oIndex;
294- void* __fn;
295- void* in_R8;
296- TProperties* properties;
297- TScriptCom* bytecodeByte1;
298- TScriptCom* bytecodeByte2;
299- int length;
300- unsigned char opCode;
301- unsigned char opCode2;
302-
303- oIndex = 0;
304- length = this->bytecodeLength;
305- if (1 < length)
306- do
307- {
308- properties = TScriptUniverse_properties;
309- bytecodeByte1 = &this->bytecode[oIndex];
310- bytecodeByte2 = &this->bytecode[oIndex + 1];
311- opCode = bytecodeByte1->byte;
312- switch (opCode)
313- {
314- case '\x14':
315- opCode2 = bytecodeByte2->byte;
316- if (opCode2 < 0x4c)
317- {
318- if (opCode2 < 0x48)
319- {
320- if ((unsigned char)opCode2 - 0x3c < 8) {
321- if (oIndex + 2 < length && (this->bytecode[(long)oIndex + 2].byte == '2')) {
322- bytecodeByte1->byte = opCode2 + 0x9c;
323- oIndex = oIndex + 2;
324- }
325- else {
326- bytecodeByte1->byte = opCode2 + 0x8c;
327- oIndex = oIndex + 1;
328- }
329- }
330- }
331- else
332- {
333- oIndex = oIndex + 1;
334- bytecodeByte1->byte = opCode2 + 0x98;
335- }
336- }
337- else if (opCode2 == 0x83)
338- {
339- bytecodeByte1->byte = -0x10;
340- oIndex = oIndex + 1;
341- }
342-
343- break;
344- case '\x16':
345- switch (bytecodeByte2->
346-
347- byte) {
348- case '\x06':
349- case '-':
350- case '/':
351- str = bytecodeByte1->variableName;
352- hashcode = THashList::getHashcode(str);
353- __fn = (void*)hashcode;
354- /*
355- pTVar1 = (TScriptProperty *)
356- THashList::getObjectEncoded(&properties->hashList,hashcode,str);
357- if ((pTVar1 != (TScriptProperty *)0x0) && (pTVar1->isFunction != false)) {
358- str.clear();
359- bytecodeByte1->byte = -0xf;
360- if ((this->graalVar).protected_object < pTVar1->functionLevel) {
361- length = TServerList::getServerPrivileges();
362- if (length < (int)(uint)pTVar1->functionLevel) {
363- pTVar1 = TScriptProperty::clone
364- (pTVar1,__fn,(void *)(ulong)pTVar1->functionLevel,0x408390,in_R8)
365- ;
366- bytecodeByte1->scriptProperty = pTVar1;
367- pTVar1->functionLevel = 10;
368- break;
369- }
370- }
371- bytecodeByte1->scriptProperty = pTVar1;
372- }
373- *
374- break;
375- case '#':
376- if (oIndex < length + -2)
377- {
378- opCode2 = this->bytecode[(long)oIndex + 2].byte;
379- if (opCode2 == 0x22)
380- {
381- bytecodeByte1->byte = -0x13;
382- oIndex = oIndex + 2;
383- }
384- else if (opCode2 < 0x23)
385- {
386- if (opCode2 != 0x21) goto LAB_0032d73b;
387- bytecodeByte1->byte = -0x14;
388- oIndex = oIndex + 2;
389- }
390- else if (opCode2 == 0x24)
391- {
392- bytecodeByte1->byte = -0x12;
393- oIndex = oIndex + 2;
394- }
395- else
396- {
397- if (opCode2 != 0x2f ||
398- ((oIndex + 3 < length && (this->bytecode[(long)oIndex + 3].byte == '-'))))
399- goto LAB_0032d73b;
400- bytecodeByte1->byte = -0x11;
401- oIndex = oIndex + 2;
402- }
403- }
404- else
405- {
406- bytecodeByte1->byte = -0x16;
407- oIndex = oIndex + 1;
408- }
409-
410- break;
411- case '$':
412- bytecodeByte1->byte = -0x15;
413- oIndex = oIndex + 1;
414- }
415- break;
416- case '.':
417- opCode2 = bytecodeByte2->byte - 0x1e;
418- if (opCode2 < 0x18)
419- {
420- /*
421- /* WARNING: Could not recover jumptable at 0x0032d702. Too many branches */
422- /* WARNING: Treating indirect jump as call *
423- (*(code *)(&DAT_00408390 + *(int *)(&DAT_00408390 + (ulong)opCode2 * 4)))
424- (length,opCode,&DAT_00408390 + *(int *)(&DAT_00408390 + (ulong)opCode2 * 4));
425- return;
426- *
427- }
428-
429- break;
430- case '/':
431- if (bytecodeByte2->byte == '-') {
432- bytecodeByte1->byte = -0xe;
433- bytecodeByte1->value = bytecodeByte2->value;
434- oIndex = oIndex + 1;
435- }
436- break;
437- case '<':
438- case '=':
439- case '>':
440- case '?':
441- case '@':
442- case 'A':
443- case 'B':
444- case 'C':
445- if (bytecodeByte2->byte == '2') {
446- bytecodeByte1->byte = opCode + -0x6c;
447- oIndex = oIndex + 1;
448- }
449- }
450-
451- length = this->bytecodeLength;
452- oIndex = oIndex + 1;
453- } while (oIndex < length + -1);
454- */
289+
455290 }
456291
457292 private async Task < IStackEntry > Execute ( string functionName , Stack < IStackEntry > ? parameters = null ) =>
@@ -518,7 +353,7 @@ public async Task<IStackEntry> TriggerEvent(string eventName)
518353 return 0 . ToStackEntry ( ) ;
519354 }
520355
521- public void SetTimer ( double value ) => Timer = DateTime . UtcNow . AddSeconds ( value ) ;
356+ private void SetTimer ( double value ) => Timer = DateTime . UtcNow . AddSeconds ( value ) ;
522357
523358
524359 public async Task < IStackEntry > RunEvents ( )
0 commit comments