少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#include "il2cpp-config.h"
#include "il2cpp-api.h"
#include "il2cpp-class-internals.h"
#include "il2cpp-object-internals.h"
#include "il2cpp-tabledefs.h"
#include "icalls/mscorlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.h"
#include "vm/Exception.h"
#include "vm/Atomic.h"
#include "vm/Array.h"
#include "vm/String.h"
#include "utils/dynamic_array.h"
 
namespace il2cpp
{
namespace icalls
{
namespace mscorlib
{
namespace System
{
namespace Runtime
{
namespace Remoting
{
namespace Messaging
{
    void MonoMethodMessage::InitMessage(Il2CppMethodMessage *this_obj, Il2CppReflectionMethod *method, Il2CppArray *out_args)
    {
        static Il2CppClass *object_array_klass;
        static Il2CppClass *byte_array_klass;
        static Il2CppClass *string_array_klass;
        Il2CppString *name;
        Il2CppArray *arr;
        int i, j;
        unsigned char arg_type;
 
        if (!object_array_klass)
        {
            Il2CppClass *klass;
 
            klass = il2cpp_array_class_get(il2cpp_defaults.byte_class, 1);
            IL2CPP_ASSERT(klass);
            byte_array_klass = klass;
 
            klass = il2cpp_array_class_get(il2cpp_defaults.string_class, 1);
            IL2CPP_ASSERT(klass);
            string_array_klass = klass;
 
            klass = il2cpp_array_class_get(il2cpp_defaults.object_class, 1);
            IL2CPP_ASSERT(klass);
 
            il2cpp::vm::Atomic::ExchangePointer(&object_array_klass, klass);
        }
 
        IL2CPP_OBJECT_SETREF(this_obj, method, method);
 
        arr = il2cpp_array_new_specific(object_array_klass, method->method->parameters_count);
 
        IL2CPP_OBJECT_SETREF(this_obj, args, arr);
 
        arr = il2cpp_array_new_specific(byte_array_klass, method->method->parameters_count);
 
        IL2CPP_OBJECT_SETREF(this_obj, arg_types, arr);
 
        this_obj->async_result = NULL;
        this_obj->call_type = Il2Cpp_CallType_Sync;
 
        il2cpp::utils::dynamic_array<const char*> names(method->method->parameters_count);
 
        for (int i = 0; i < method->method->parameters_count; ++i)
            names[i] = method->method->parameters[i].name;
 
        arr = il2cpp_array_new_specific(string_array_klass, method->method->parameters_count);
 
        IL2CPP_OBJECT_SETREF(this_obj, names, arr);
 
        for (i = 0; i < method->method->parameters_count; i++)
        {
            name = il2cpp::vm::String::New(names[i]);
            il2cpp_array_setref(this_obj->names, i, name);
        }
 
        for (i = 0, j = 0; i < method->method->parameters_count; i++)
        {
            if (method->method->parameters[i].parameter_type->byref)
            {
                if (out_args)
                {
                    Il2CppObject* arg = (Il2CppObject*)il2cpp_array_get(out_args, void*, j);
                    il2cpp_array_setref(this_obj->args, i, arg);
                    j++;
                }
 
                arg_type = 2;
                if (!(method->method->parameters[i].parameter_type->attrs & PARAM_ATTRIBUTE_OUT))
                    arg_type |= 1;
            }
            else
            {
                arg_type = 1;
                if (method->method->parameters[i].parameter_type->attrs & PARAM_ATTRIBUTE_OUT)
                    arg_type |= 4;
            }
 
            il2cpp_array_set(this_obj->arg_types, unsigned char, i, arg_type);
        }
    }
} /* namespace Messaging */
} /* namespace Remoting */
} /* namespace Runtime */
} /* namespace System */
} /* namespace mscorlib */
} /* namespace icalls */
} /* namespace il2cpp */