-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
183 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <dll_includes.hpp> | ||
|
||
using namespace custom_gsc_func; | ||
using scriptinstance::ScriptInstance; | ||
|
||
void actshello(ScriptInstance inst) { | ||
LOG_INFO("Hello from vm {}", scriptinstance::Name(inst)); | ||
} | ||
|
||
std::vector<Builtin> custom_gsc_func::custom_functions[2] = { | ||
{ // Server functions | ||
{ | ||
.name = hash::Hash32("actshello"), | ||
.min_args = 0, | ||
.max_args = 0, | ||
.actionFunc = actshello, | ||
.type = BUILTIN_DEFAULT | ||
} | ||
}, | ||
{ // Client functions | ||
{ | ||
.name = hash::Hash32("actshello"), | ||
.min_args = 0, | ||
.max_args = 0, | ||
.actionFunc = actshello, | ||
.type = BUILTIN_DEFAULT | ||
} | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
#include <dll_includes.hpp> | ||
|
||
namespace custom_gsc_func { | ||
typedef void (*BuiltinFunction)(scriptinstance::ScriptInstance inst); | ||
|
||
|
||
enum BuiltinType : int { | ||
BUILTIN_DEFAULT = 0, | ||
BUILTIN_DEV = 1 | ||
}; | ||
|
||
struct __declspec(align(8)) Builtin { | ||
UINT32 name; | ||
int min_args; | ||
int max_args; | ||
BuiltinFunction actionFunc; | ||
BuiltinType type; | ||
}; | ||
|
||
extern std::vector<Builtin> custom_functions[2]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters