3232 #include < Windows.h>
3333#endif
3434
35+ #include " engines_server.h"
3536#include " export_main.h"
3637#include " utilities/conversions.h"
3738
@@ -65,10 +66,11 @@ extern IServerGameDLL* servergamedll;
6566// ---------------------------------------------------------------------------------
6667// Forward declarations.
6768// ---------------------------------------------------------------------------------
68- void export_engine_server (scope);
69- void export_query_cvar_status (scope);
70- void export_server_game_dll (scope);
71- void export_iserver (scope);
69+ static void export_engine_server (scope);
70+ static void export_query_cvar_status (scope);
71+ static void export_server_game_dll (scope);
72+ static void export_iserver (scope);
73+ static void export_functions (scope);
7274
7375
7476// ---------------------------------------------------------------------------------
@@ -80,13 +82,14 @@ DECLARE_SP_SUBMODULE(_engines, _server)
8082 export_query_cvar_status (_server);
8183 export_server_game_dll (_server);
8284 export_iserver (_server);
85+ export_functions (_server);
8386}
8487
8588
8689// ---------------------------------------------------------------------------------
8790// Exports IVEngineServer.
8891// ---------------------------------------------------------------------------------
89- void export_engine_server (scope _server)
92+ static void export_engine_server (scope _server)
9093{
9194 // Call engine specific implementation function
9295 IVEngineServer_Visitor (
@@ -248,17 +251,6 @@ void export_engine_server(scope _server)
248251 args (" sentence_index" )
249252 )
250253
251- .def (" server_command" ,
252- &IVEngineServerExt::ServerCommand,
253- " Issues a command to the command parser as if it was typed at the server console." ,
254- args (" command" )
255- )
256-
257- .def (" server_execute" ,
258- &IVEngineServer::ServerExecute,
259- " Executes any commands currently in the command parser immediately (instead of once per frame)."
260- )
261-
262254 .def (" client_command" ,
263255 &IVEngineServerExt::ClientCommand,
264256 " Runs a command on the client." ,
@@ -555,12 +547,6 @@ void export_engine_server(scope _server)
555547 args (" edict" , " cvar_name" )
556548 )
557549
558- .def (" insert_server_command" ,
559- &IVEngineServerExt::InsertServerCommand,
560- " Inserts a command into the server's command buffer." ,
561- args (" command_string" )
562- )
563-
564550 .def (" get_player_info" ,
565551 &IVEngineServer::GetPlayerInfo,
566552 " Fill in the player info structure for the specified player." ,
@@ -777,7 +763,7 @@ void export_engine_server(scope _server)
777763// ---------------------------------------------------------------------------------
778764// Exports EQueryCvarValueStatus.
779765// ---------------------------------------------------------------------------------
780- void export_query_cvar_status (scope _server)
766+ static void export_query_cvar_status (scope _server)
781767{
782768 enum_<EQueryCvarValueStatus> QueryCvarStatus (" QueryCvarStatus" );
783769
@@ -792,7 +778,7 @@ void export_query_cvar_status(scope _server)
792778// -----------------------------------------------------------------------------
793779// Exports IServerGameDLL.
794780// -----------------------------------------------------------------------------
795- void export_server_game_dll (scope _server)
781+ static void export_server_game_dll (scope _server)
796782{
797783 class_<IServerGameDLL, boost::noncopyable> ServerGameDLL (" _ServerGameDLL" , no_init);
798784
@@ -826,7 +812,7 @@ void export_server_game_dll(scope _server)
826812// -----------------------------------------------------------------------------
827813// Exports IServer.
828814// -----------------------------------------------------------------------------
829- void export_iserver (scope _server)
815+ static void export_iserver (scope _server)
830816{
831817 class_<IConnectionlessPacketHandler, IConnectionlessPacketHandler*, boost::noncopyable> _IConnectionlessPacketHandler (" ConnectionlessPacketHandler" , no_init);
832818
@@ -1003,3 +989,23 @@ void export_iserver(scope _server)
1003989
1004990 _IServer ADD_MEM_TOOLS (IServer)
1005991}
992+
993+
994+ // -----------------------------------------------------------------------------
995+ // Exports functions.
996+ // -----------------------------------------------------------------------------
997+ static void export_functions (scope _server)
998+ {
999+ def (" execute_server_command" ,
1000+ raw_function (execute_server_command, 1 )
1001+ );
1002+
1003+ def (" queue_server_command" ,
1004+ raw_function (queue_server_command, 1 )
1005+ );
1006+
1007+ def (" queue_command_string" ,
1008+ &queue_command_string,
1009+ " Queue a string for execution."
1010+ );
1011+ }
0 commit comments