Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetHelperCallFirstArg()

static int System.Diagnostics.Tracing.EventSource.GetHelperCallFirstArg ( MethodInfo method)
inlinestaticprivateinherited

Definition at line 2598 of file EventSource.cs.

2599 {
2600 byte[] iLAsByteArray = method.GetMethodBody().GetILAsByteArray();
2601 int num = -1;
2602 for (int i = 0; i < iLAsByteArray.Length; i++)
2603 {
2604 switch (iLAsByteArray[i])
2605 {
2606 case 14:
2607 case 16:
2608 i++;
2609 continue;
2610 case 21:
2611 case 22:
2612 case 23:
2613 case 24:
2614 case 25:
2615 case 26:
2616 case 27:
2617 case 28:
2618 case 29:
2619 case 30:
2620 if (i > 0 && iLAsByteArray[i - 1] == 2)
2621 {
2622 num = iLAsByteArray[i] - 22;
2623 }
2624 continue;
2625 case 31:
2626 if (i > 0 && iLAsByteArray[i - 1] == 2)
2627 {
2628 num = iLAsByteArray[i + 1];
2629 }
2630 i++;
2631 continue;
2632 case 32:
2633 i += 4;
2634 continue;
2635 case 40:
2636 i += 4;
2637 if (num >= 0)
2638 {
2639 for (int j = i + 1; j < iLAsByteArray.Length; j++)
2640 {
2641 if (iLAsByteArray[j] == 42)
2642 {
2643 return num;
2644 }
2645 if (iLAsByteArray[j] != 0)
2646 {
2647 break;
2648 }
2649 }
2650 }
2651 num = -1;
2652 continue;
2653 case 44:
2654 case 45:
2655 num = -1;
2656 i++;
2657 continue;
2658 case 57:
2659 case 58:
2660 num = -1;
2661 i += 4;
2662 continue;
2663 case 140:
2664 case 141:
2665 i += 4;
2666 continue;
2667 case 254:
2668 i++;
2669 if (i < iLAsByteArray.Length && iLAsByteArray[i] < 6)
2670 {
2671 continue;
2672 }
2673 break;
2674 case 0:
2675 case 1:
2676 case 2:
2677 case 3:
2678 case 4:
2679 case 5:
2680 case 6:
2681 case 7:
2682 case 8:
2683 case 9:
2684 case 10:
2685 case 11:
2686 case 12:
2687 case 13:
2688 case 20:
2689 case 37:
2690 case 103:
2691 case 104:
2692 case 105:
2693 case 106:
2694 case 109:
2695 case 110:
2696 case 162:
2697 continue;
2698 }
2699 return -1;
2700 }
2701 return -1;
2702 }

Referenced by System.Diagnostics.Tracing.EventSource.DebugCheckEvent().