少年修仙传客户端基础资源
dabaoji
2023-11-13 0a23e1b83f8fda8ab9f9e32fe71c26c431faf63a
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
using System;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
 
namespace ILCrossBinding
{
    public class GameNetPackBasicAdapter : CrossBindingAdaptor
    {
        static CrossBindingMethodInfo<System.Byte[]> mReadFromBytes_0 = new CrossBindingMethodInfo<System.Byte[]>("ReadFromBytes");
        static CrossBindingMethodInfo mWriteToBytes_1 = new CrossBindingMethodInfo("WriteToBytes");
        public override Type BaseCLRType
        {
            get
            {
                return typeof(global::GameNetPackBasic);
            }
        }
 
        public override Type AdaptorType
        {
            get
            {
                return typeof(Adapter);
            }
        }
 
        public override object CreateCLRInstance(ILRuntime.Runtime.Enviorment.AppDomain appdomain, ILTypeInstance instance)
        {
            return new Adapter(appdomain, instance);
        }
 
        public class Adapter : global::GameNetPackBasic, CrossBindingAdaptorType
        {
            ILTypeInstance instance;
            ILRuntime.Runtime.Enviorment.AppDomain appdomain;
 
            public Adapter()
            {
 
            }
 
            public Adapter(ILRuntime.Runtime.Enviorment.AppDomain appdomain, ILTypeInstance instance)
            {
                this.appdomain = appdomain;
                this.instance = instance;
            }
 
            public ILTypeInstance ILInstance { get { return instance; } }
 
            public override void ReadFromBytes(System.Byte[] vBytes)
            {
                if (mReadFromBytes_0.CheckShouldInvokeBase(this.instance))
                    base.ReadFromBytes(vBytes);
                else
                    mReadFromBytes_0.Invoke(this.instance, vBytes);
            }
 
            public override void WriteToBytes()
            {
                if (mWriteToBytes_1.CheckShouldInvokeBase(this.instance))
                    base.WriteToBytes();
                else
                    mWriteToBytes_1.Invoke(this.instance);
            }
 
            public override string ToString()
            {
                IMethod m = appdomain.ObjectType.GetMethod("ToString", 0);
                m = instance.Type.GetVirtualMethod(m);
                if (m == null || m is ILMethod)
                {
                    return instance.ToString();
                }
                else
                    return instance.Type.FullName;
            }
        }
    }
}