forked from axetion/go-vsp-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvtable.go
41 lines (36 loc) · 1.08 KB
/
vtable.go
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
package main
/*
// Stubs for the virtuals we're not going to override.
void dummy(void) {} // return nothing
int dummy2(void) { return 0; } // return PLUGIN_CONTINUE
// Our exported Go functions.
extern unsigned char Load(void *this, void *fac1, void *fac2);
extern void Unload(void *this);
extern const char *Description(void *this);
extern void PutInServer(void *this, void *player, const char *name);
void *vtable[20] = {
&Load, // ::Load
&Unload, // ::Unload
&dummy, // ::Pause
&dummy, // ::UnPause
&Description, // ::GetPluginDescription
&dummy, // ::LevelInit
&dummy, // ::ServerActivate
&dummy, // ::GameFrame
&dummy, // ::LevelShutdown
&dummy, // ::ClientActive
&dummy, // ::ClientDisconnect
&PutInServer, // ::ClientPutInServer
&dummy, // ::SetCommandClient
&dummy, // ::ClientSettingsChanged
&dummy2, // ::ClientConnect
&dummy2, // ::ClientCommand
&dummy2, // ::NetworkIDValidated
&dummy, // ::OnQueryCvarValueFinished
&dummy, // ::OnEdictAllocated
&dummy // ::OnEdictFreed
};
void *vptr = &vtable;
*/
import "C"
var vptr = &C.vptr