public int join(int uid, int sid, int session) { //GCHandle handle = GCHandle.Alloc(ud); //IntPtr ptr = GCHandle.ToIntPtr(handle); //SharpC.CSObject[] args = new SharpC.CSObject[3]; //args[0].type = SharpC.CSType.INT32; //args[0].v32 = uid; //args[1].type = SharpC.CSType.INT32; //args[1].v32 = sid; //args[2].type = SharpC.CSType.INT32; //args[2].v32 = session; //return Play_CSharp.play_join(_play, args[0], args[1], args[2]); SharpC.CSObject x1 = new SharpC.CSObject(); x1.type = SharpC.CSType.INT32; x1.v32 = uid; SharpC.CSObject x2 = new SharpC.CSObject(); x2.type = SharpC.CSType.INT32; x2.v32 = sid; SharpC.CSObject x3 = new SharpC.CSObject(); x3.type = SharpC.CSType.INT32; x3.v32 = session; return(Play_CSharp.play_join(_play, x1, x2, x3)); }
public static extern IntPtr hexmapaux_create(IntPtr sc, int o, float oradis, int shape, int width, int height, [In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject foreach_cb);
public void update(float delta) { SharpC.CSObject cso = new SharpC.CSObject(); cso.type = SharpC.CSType.REAL; cso.f = delta; Play_CSharp.play_update(_play, cso); }
public Play(SharpC sharpc) { _sharpc = sharpc; SharpC.CSObject[] args = new SharpC.CSObject[2]; args[0] = _sharpc.CacheObj(this); args[1] = _sharpc.CacheFunc(fetch); _play = Play_CSharp.play_alloc(args[0], args[1]); }
public int xfetch(ref IntPtr ptr, ref int len) { SharpC.CSObject[] args = new SharpC.CSObject[2]; args[0].type = SharpC.CSType.INTPTR; args[0].ptr = ptr; args[1].type = SharpC.CSType.INT32; args[1].v32 = len; return(Play_CSharp.play_fetch(_play, args[0], args[1])); }
public void leave(int uid, int sid, int session) { SharpC.CSObject[] args = new SharpC.CSObject[3]; args[0].type = SharpC.CSType.INT32; args[0].v32 = uid; args[1].type = SharpC.CSType.INT32; args[1].v32 = sid; args[2].type = SharpC.CSType.INT32; args[2].v32 = session; Play_CSharp.play_leave(_play, args[0], args[1], args[2]); }
public Rudp(SharpC sharpc, int send_delay, int expired_time) { _sharpc = sharpc; SharpC.CSObject cso0 = sharpc.CacheObj(this); SharpC.CSObject cso1 = sharpc.CacheFunc(RSend); SharpC.CSObject cso2 = sharpc.CacheFunc(RRecv); _u = Rudp_CSharp.rudpaux_alloc(send_delay, expired_time, cso0, cso1, cso2); _buffer = Marshal.AllocHGlobal(3072); _sendBuffer = new byte[3072]; _recvBuffer = new byte[3072]; }
public Rudp(SharpC sharpc, int send_delay, int expired_time) { _sharpc = sharpc; SharpC.CSObject cso0 = SharpC.CacheObj(this); SharpC.CSObject cso1 = SharpC.CacheFunc(RSend); SharpC.CSObject cso2 = SharpC.CacheFunc(RRecv); SharpC.CSObject cso3 = new SharpC.CSObject(); cso3.type = SharpC.CSType.INTPTR; cso3.ptr = _sharpc.CPtr; _u = Rudp_CSharp.rudpaux_alloc(send_delay, expired_time, cso3, cso0, cso1, cso2); _buffer = Marshal.AllocHGlobal(3072); // 单线程 _sendBuffer = new byte[3072]; _recvBuffer = new byte[3072]; }
public static extern IntPtr rudpaux_alloc(int send_delay, int expired_time, [In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject ex, [In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject send, [In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject recv);
public static extern IntPtr play_alloc([In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject ex, [In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject cb);
public static extern int play_fetch(IntPtr self, [In, Out, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject ptr, [In, Out, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject len);
public static extern void play_leave(IntPtr self, [In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject uid, [In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject sid, [In, MarshalAs(UnmanagedType.Struct)] SharpC.CSObject session);
public static extern void play_update(IntPtr self, SharpC.CSObject delta);