Make shared code separate

The work is partial, and does not compile.
This commit is contained in:
Amos 2023-07-18 21:05:29 +02:00
parent 95ee7ddec6
commit 6e223d1730
8 changed files with 566 additions and 520 deletions

View File

@ -80,6 +80,7 @@ target_link_libraries( ${PROJECT_NAME} PRIVATE
"localize"
"vscript"
"game_shared_static"
)
if( NOT ${PROJECT_NAME} STREQUAL "dedicated" )

View File

@ -5,6 +5,8 @@ add_module( "lib" ${PROJECT_NAME} "vpc" ${FOLDER_CONTEXT} TRUE TRUE )
start_sources()
if( ${PROJECT_NAME} STREQUAL "game_shared_static" )
add_sources( SOURCE_GROUP "Shared"
"shared/ai_utility_shared.cpp"
"shared/ai_utility_shared.h"
@ -35,7 +37,10 @@ add_sources( SOURCE_GROUP "Shared/Weapon"
"shared/r1/weapon_bolt.h"
)
if( NOT ${PROJECT_NAME} STREQUAL "client_static" )
endif()
if( ${PROJECT_NAME} STREQUAL "server_static" )
add_sources( SOURCE_GROUP "Server"
"server/ai_network.cpp"
"server/ai_network.h"
@ -64,6 +69,8 @@ add_sources( SOURCE_GROUP "Server"
"server/player.cpp"
"server/player.h"
"server/playerlocaldata.h"
"server/vscript_server.cpp"
"server/vscript_server.h"
)
add_sources( SOURCE_GROUP "Public"
@ -74,7 +81,8 @@ add_sources( SOURCE_GROUP "Public"
endif()
if( NOT ${PROJECT_NAME} STREQUAL "server_static" )
if( ${PROJECT_NAME} STREQUAL "client_static" )
add_sources( SOURCE_GROUP "Client"
"client/c_baseentity.cpp"
"client/c_baseentity.h"
@ -89,6 +97,8 @@ add_sources( SOURCE_GROUP "Client"
"client/spritemodel.cpp"
"client/viewrender.cpp"
"client/viewrender.h"
"client/vscript_client.cpp"
"client/vscript_client.h"
)
add_sources( SOURCE_GROUP "Public"
@ -118,6 +128,7 @@ add_sources( SOURCE_GROUP "Public"
end_sources()
if( ${PROJECT_NAME} STREQUAL "server_static" )
target_compile_definitions( ${PROJECT_NAME} PRIVATE
"SERVER_DLL"
)
@ -125,6 +136,7 @@ elseif( ${PROJECT_NAME} STREQUAL "client_static" )
target_compile_definitions( ${PROJECT_NAME} PRIVATE
"CLIENT_DLL"
)
endif()
target_include_directories( ${PROJECT_NAME} PRIVATE
@ -136,3 +148,4 @@ endmacro()
add_game_project( "server_static" )
add_game_project( "client_static" )
add_game_project( "game_shared_static" )

View File

@ -0,0 +1,470 @@
//=============================================================================//
//
// Purpose: Expose native code to VScript API
//
//-----------------------------------------------------------------------------
//
// See 'game/shared/vscript_shared.cpp' for more details.
//
//=============================================================================//
#include "core/stdafx.h"
#include "vpc/keyvalues.h"
#include "engine/cmodel_bsp.h"
#include "engine/host_state.h"
#include "networksystem/pylon.h"
#include "networksystem/listmanager.h"
#include "game/shared/vscript_shared.h"
#include "vscript/languages/squirrel_re/include/sqvm.h"
namespace VScriptCode
{
namespace Client
{
}
namespace Ui
{
//-----------------------------------------------------------------------------
// Purpose: refreshes the server list
//-----------------------------------------------------------------------------
SQRESULT RefreshServerCount(HSQUIRRELVM v)
{
string serverMessage; // Refresh list.
size_t iCount = g_pServerListManager->RefreshServerList(serverMessage);
sq_pushinteger(v, static_cast<SQInteger>(iCount));
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current name from serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerName(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& serverName = g_pServerListManager->m_vServerList[iServer].m_svHostName;
sq_pushstring(v, serverName.c_str(), -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current description from serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerDescription(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& serverDescription = g_pServerListManager->m_vServerList[iServer].m_svDescription;
sq_pushstring(v, serverDescription.c_str(), -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current map via serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerMap(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& svServerMapName = g_pServerListManager->m_vServerList[iServer].m_svHostMap;
sq_pushstring(v, svServerMapName.c_str(), -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current playlist via serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerPlaylist(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& serverPlaylist = g_pServerListManager->m_vServerList[iServer].m_svPlaylist;
sq_pushstring(v, serverPlaylist.c_str(), -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current player count via serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerCurrentPlayers(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& playerCount = g_pServerListManager->m_vServerList[iServer].m_svPlayerCount.c_str();
sq_pushinteger(v, strtol(playerCount.c_str(), NULL, NULL));
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current player count via serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerMaxPlayers(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& maxPlayers = g_pServerListManager->m_vServerList[iServer].m_svMaxPlayers;
sq_pushinteger(v, strtol(maxPlayers.c_str(), NULL, NULL));
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get current server count from pylon
//-----------------------------------------------------------------------------
SQRESULT GetServerCount(HSQUIRRELVM v)
{
size_t iCount = g_pServerListManager->m_vServerList.size();
sq_pushinteger(v, static_cast<SQInteger>(iCount));
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get promo data for serverbrowser panels
//-----------------------------------------------------------------------------
SQRESULT GetPromoData(HSQUIRRELVM v)
{
enum class R5RPromoData : SQInteger
{
PromoLargeTitle,
PromoLargeDesc,
PromoLeftTitle,
PromoLeftDesc,
PromoRightTitle,
PromoRightDesc
};
R5RPromoData ePromoIndex = static_cast<R5RPromoData>(sq_getinteger(v, 1));
const char* pszPromoKey;
switch (ePromoIndex)
{
case R5RPromoData::PromoLargeTitle:
{
pszPromoKey = "#PROMO_LARGE_TITLE";
break;
}
case R5RPromoData::PromoLargeDesc:
{
pszPromoKey = "#PROMO_LARGE_DESCRIPTION";
break;
}
case R5RPromoData::PromoLeftTitle:
{
pszPromoKey = "#PROMO_LEFT_TITLE";
break;
}
case R5RPromoData::PromoLeftDesc:
{
pszPromoKey = "#PROMO_LEFT_DESCRIPTION";
break;
}
case R5RPromoData::PromoRightTitle:
{
pszPromoKey = "#PROMO_RIGHT_TITLE";
break;
}
case R5RPromoData::PromoRightDesc:
{
pszPromoKey = "#PROMO_RIGHT_DESCRIPTION";
break;
}
default:
{
pszPromoKey = "#PROMO_SDK_ERROR";
break;
}
}
sq_pushstring(v, pszPromoKey, -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: create server via native serverbrowser entries
// TODO: return a boolean on failure instead of raising an error, so we could
// determine from scripts whether or not to spin a local server, or connect
// to a dedicated server (for disconnecting and loading the lobby, for example)
//-----------------------------------------------------------------------------
SQRESULT CreateServer(HSQUIRRELVM v)
{
#ifndef CLIENT_DLL
SQChar* serverName = sq_getstring(v, 1);
SQChar* serverDescription = sq_getstring(v, 2);
SQChar* serverMapName = sq_getstring(v, 3);
SQChar* serverPlaylist = sq_getstring(v, 4);
EServerVisibility_t eServerVisibility = static_cast<EServerVisibility_t>(sq_getinteger(v, 5));
if (!VALID_CHARSTAR(serverName) ||
!VALID_CHARSTAR(serverMapName) ||
!VALID_CHARSTAR(serverPlaylist))
{
return SQ_OK;
}
// Adjust browser settings.
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
g_pServerListManager->m_Server.m_svHostName = serverName;
g_pServerListManager->m_Server.m_svDescription = serverDescription;
g_pServerListManager->m_Server.m_svHostMap = serverMapName;
g_pServerListManager->m_Server.m_svPlaylist = serverPlaylist;
g_pServerListManager->m_ServerVisibility = eServerVisibility;
// Launch server.
g_pServerListManager->LaunchServer();
return SQ_OK;
#else
v_SQVM_RaiseError(v, "\"%s\" is not supported for client builds.\n", "CreateServer");
return SQ_ERROR;
#endif
}
//-----------------------------------------------------------------------------
// Purpose: connect to server from native server browser entries
//-----------------------------------------------------------------------------
SQRESULT ConnectToServer(HSQUIRRELVM v)
{
SQChar* ipAddress = sq_getstring(v, 1);
SQChar* cryptoKey = sq_getstring(v, 2);
if (!VALID_CHARSTAR(ipAddress) || VALID_CHARSTAR(cryptoKey))
return SQ_OK;
DevMsg(eDLL_T::UI, "Connecting to server with ip address '%s' and encryption key '%s'\n", ipAddress, cryptoKey);
g_pServerListManager->ConnectToServer(ipAddress, cryptoKey);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: set netchannel encryption key and connect to server
//-----------------------------------------------------------------------------
SQRESULT ConnectToListedServer(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const NetGameServer_t& gameServer = g_pServerListManager->m_vServerList[iServer];
g_pServerListManager->ConnectToServer(gameServer.m_svIpAddress, gameServer.m_svGamePort,
gameServer.m_svEncryptionKey);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: request token from pylon and join server with result.
//-----------------------------------------------------------------------------
SQRESULT ConnectToHiddenServer(HSQUIRRELVM v)
{
SQChar* privateToken = sq_getstring(v, 1);
if (!VALID_CHARSTAR(privateToken))
return SQ_OK;
string hiddenServerRequestMessage;
NetGameServer_t netListing;
bool result = g_pMasterServer->GetServerByToken(netListing, hiddenServerRequestMessage, privateToken); // Send token connect request.
if (result)
{
g_pServerListManager->ConnectToServer(netListing.m_svIpAddress, netListing.m_svGamePort, netListing.m_svEncryptionKey);
}
else
{
Warning(eDLL_T::UI, "Failed to connect to private server: %s\n", hiddenServerRequestMessage.c_str());
}
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get response from private server request
//-----------------------------------------------------------------------------
SQRESULT GetHiddenServerName(HSQUIRRELVM v)
{
SQChar* privateToken = sq_getstring(v, 1);
if (!VALID_CHARSTAR(privateToken))
return SQ_OK;
string hiddenServerRequestMessage;
NetGameServer_t serverListing;
bool result = g_pMasterServer->GetServerByToken(serverListing, hiddenServerRequestMessage, privateToken); // Send token connect request.
if (!result)
{
if (hiddenServerRequestMessage.empty())
{
sq_pushstring(v, "Request failed", -1);
}
else
{
hiddenServerRequestMessage = Format("Request failed: %s", hiddenServerRequestMessage.c_str());
sq_pushstring(v, hiddenServerRequestMessage.c_str(), -1);
}
return SQ_OK;
}
if (serverListing.m_svHostName.empty())
{
if (hiddenServerRequestMessage.empty())
{
hiddenServerRequestMessage = Format("Server listing empty");
}
else
{
hiddenServerRequestMessage = Format("Server listing empty: %s", hiddenServerRequestMessage.c_str());
}
sq_pushstring(v, hiddenServerRequestMessage.c_str(), -1);
}
else
{
hiddenServerRequestMessage = Format("Found server: %s", serverListing.m_svHostName.c_str());
sq_pushstring(v, hiddenServerRequestMessage.c_str(), -1);
}
return SQ_OK;
}
}
}
//---------------------------------------------------------------------------------
// Purpose: registers script functions in CLIENT context
// Input : *s -
//---------------------------------------------------------------------------------
void Script_RegisterClientFunctions(CSquirrelVM* s)
{
s->RegisterFunction("SDKNativeTest", "Script_SDKNativeTest", "Native CLIENT test function", "void", "", &VScriptCode::Shared::SDKNativeTest);
s->RegisterFunction("GetSDKVersion", "Script_GetSDKVersion", "Gets the SDK version as a string", "string", "", &VScriptCode::Shared::GetSDKVersion);
s->RegisterFunction("GetAvailableMaps", "Script_GetAvailableMaps", "Gets an array of all available maps", "array< string >", "", &VScriptCode::Shared::GetAvailableMaps);
s->RegisterFunction("GetAvailablePlaylists", "Script_GetAvailablePlaylists", "Gets an array of all available playlists", "array< string >", "", &VScriptCode::Shared::GetAvailablePlaylists);
s->RegisterFunction("ShutdownHostGame", "Script_ShutdownHostGame", "Shuts the local host game down", "void", "", &VScriptCode::Shared::ShutdownHostGame);
s->RegisterFunction("IsClientDLL", "Script_IsClientDLL", "Returns whether this build is client only", "bool", "", &VScriptCode::Shared::IsClientDLL);
}
//---------------------------------------------------------------------------------
// Purpose: registers script functions in UI context
// Input : *s -
//---------------------------------------------------------------------------------
void Script_RegisterUIFunctions(CSquirrelVM* s)
{
s->RegisterFunction("SDKNativeTest", "Script_SDKNativeTest", "Native UI test function", "void", "", &VScriptCode::Shared::SDKNativeTest);
s->RegisterFunction("GetSDKVersion", "Script_GetSDKVersion", "Gets the SDK version as a string", "string", "", &VScriptCode::Shared::GetSDKVersion);
s->RegisterFunction("RefreshServerList", "Script_RefreshServerList", "Refreshes the public server list and returns the count", "int", "", &VScriptCode::Ui::RefreshServerCount);
// Functions for retrieving server browser data
s->RegisterFunction("GetServerName", "Script_GetServerName", "Gets the name of the server at the specified index of the server list", "string", "int", &VScriptCode::Ui::GetServerName);
s->RegisterFunction("GetServerDescription", "Script_GetServerDescription", "Gets the description of the server at the specified index of the server list", "string", "int", &VScriptCode::Ui::GetServerDescription);
s->RegisterFunction("GetServerMap", "Script_GetServerMap", "Gets the map of the server at the specified index of the server list", "string", "int", &VScriptCode::Ui::GetServerMap);
s->RegisterFunction("GetServerPlaylist", "Script_GetServerPlaylist", "Gets the playlist of the server at the specified index of the server list", "string", "int", &VScriptCode::Ui::GetServerPlaylist);
s->RegisterFunction("GetServerCurrentPlayers", "Script_GetServerCurrentPlayers", "Gets the current player count of the server at the specified index of the server list", "int", "int", &VScriptCode::Ui::GetServerCurrentPlayers);
s->RegisterFunction("GetServerMaxPlayers", "Script_GetServerMaxPlayers", "Gets the max player count of the server at the specified index of the server list", "int", "int", &VScriptCode::Ui::GetServerMaxPlayers);
s->RegisterFunction("GetServerCount", "Script_GetServerCount", "Gets the number of public servers", "int", "", &VScriptCode::Ui::GetServerCount);
// Misc main menu functions
s->RegisterFunction("GetPromoData", "Script_GetPromoData", "Gets promo data for specified slot type", "string", "int", &VScriptCode::Ui::GetPromoData);
// Functions for creating servers
s->RegisterFunction("CreateServer", "Script_CreateServer", "Starts server with the specified settings", "void", "string, string, string, string, int", &VScriptCode::Ui::CreateServer);
s->RegisterFunction("IsServerActive", "Script_IsServerActive", "Returns whether the server is active", "bool", "", &VScriptCode::Shared::IsServerActive);
// Functions for connecting to servers
s->RegisterFunction("ConnectToServer", "Script_ConnectToServer", "Joins server by ip address and encryption key", "void", "string, string", &VScriptCode::Ui::ConnectToServer);
s->RegisterFunction("ConnectToListedServer", "Script_ConnectToListedServer", "Joins listed server by index", "void", "int", &VScriptCode::Ui::ConnectToListedServer);
s->RegisterFunction("ConnectToHiddenServer", "Script_ConnectToHiddenServer", "Joins hidden server by token", "void", "string", &VScriptCode::Ui::ConnectToHiddenServer);
s->RegisterFunction("GetHiddenServerName", "Script_GetHiddenServerName", "Gets hidden server name by token", "string", "string", &VScriptCode::Ui::GetHiddenServerName);
s->RegisterFunction("GetAvailableMaps", "Script_GetAvailableMaps", "Gets an array of all available maps", "array< string >", "", &VScriptCode::Shared::GetAvailableMaps);
s->RegisterFunction("GetAvailablePlaylists", "Script_GetAvailablePlaylists", "Gets an array of all available playlists", "array< string >", "", &VScriptCode::Shared::GetAvailablePlaylists);
#ifndef CLIENT_DLL // UI 'admin' functions controlling server code
s->RegisterFunction("KickPlayerByName", "Script_KickPlayerByName", "Kicks a player from the server by name", "void", "string", &VScriptCode::SHARED::KickPlayerByName);
s->RegisterFunction("KickPlayerById", "Script_KickPlayerById", "Kicks a player from the server by handle or nucleus id", "void", "string", &VScriptCode::SHARED::KickPlayerById);
s->RegisterFunction("BanPlayerByName", "Script_BanPlayerByName", "Bans a player from the server by name", "void", "string", &VScriptCode::SHARED::BanPlayerByName);
s->RegisterFunction("BanPlayerById", "Script_BanPlayerById", "Bans a player from the server by handle or nucleus id", "void", "string", &VScriptCode::SHARED::BanPlayerById);
s->RegisterFunction("UnbanPlayer", "Script_UnbanPlayer", "Unbans a player from the server by nucleus id or ip address", "void", "string", &VScriptCode::SHARED::UnbanPlayer);
s->RegisterFunction("ShutdownHostGame", "Script_ShutdownHostGame", "Shuts the local host game down", "void", "", &VScriptCode::SHARED::ShutdownHostGame);
#endif // !CLIENT_DLL
s->RegisterFunction("IsClientDLL", "Script_IsClientDLL", "Returns whether this build is client only", "bool", "", &VScriptCode::Shared::IsClientDLL);
}

View File

View File

@ -0,0 +1,75 @@
//=============================================================================//
//
// Purpose: Expose native code to VScript API
//
//-----------------------------------------------------------------------------
//
// See 'game/shared/vscript_shared.cpp' for more details.
//
//=============================================================================//
#include "core/stdafx.h"
#include "engine/server/server.h"
#include "game/shared/vscript_shared.h"
#include "vscript/languages/squirrel_re/include/sqvm.h"
namespace VScriptCode
{
namespace Server
{
//-----------------------------------------------------------------------------
// Purpose: gets the number of real players on this server
//-----------------------------------------------------------------------------
SQRESULT GetNumHumanPlayers(HSQUIRRELVM v)
{
sq_pushinteger(v, g_pServer->GetNumHumanPlayers());
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: gets the number of fake players on this server
//-----------------------------------------------------------------------------
SQRESULT GetNumFakeClients(HSQUIRRELVM v)
{
sq_pushinteger(v, g_pServer->GetNumFakeClients());
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: checks whether this SDK build is a dedicated server
//-----------------------------------------------------------------------------
SQRESULT IsDedicated(HSQUIRRELVM v)
{
sq_pushbool(v, ::IsDedicated());
return SQ_OK;
}
}
}
//---------------------------------------------------------------------------------
// Purpose: registers script functions in SERVER context
// Input : *s -
//---------------------------------------------------------------------------------
void Script_RegisterServerFunctions(CSquirrelVM* s)
{
s->RegisterFunction("SDKNativeTest", "Script_SDKNativeTest", "Native SERVER test function", "void", "", &VScriptCode::Shared::SDKNativeTest);
s->RegisterFunction("GetSDKVersion", "Script_GetSDKVersion", "Gets the SDK version as a string", "string", "", &VScriptCode::Shared::GetSDKVersion);
s->RegisterFunction("GetNumHumanPlayers", "Script_GetNumHumanPlayers", "Gets the number of human players on the server", "int", "", &VScriptCode::Server::GetNumHumanPlayers);
s->RegisterFunction("GetNumFakeClients", "Script_GetNumFakeClients", "Gets the number of bot players on the server", "int", "", &VScriptCode::Server::GetNumFakeClients);
s->RegisterFunction("GetAvailableMaps", "Script_GetAvailableMaps", "Gets an array of all available maps", "array< string >", "", &VScriptCode::Shared::GetAvailableMaps);
s->RegisterFunction("GetAvailablePlaylists", "Script_GetAvailablePlaylists", "Gets an array of all available playlists", "array< string >", "", &VScriptCode::Shared::GetAvailablePlaylists);
s->RegisterFunction("KickPlayerByName", "Script_KickPlayerByName", "Kicks a player from the server by name", "void", "string, string", &VScriptCode::Shared::KickPlayerByName);
s->RegisterFunction("KickPlayerById", "Script_KickPlayerById", "Kicks a player from the server by handle or nucleus id", "void", "string, string", &VScriptCode::Shared::KickPlayerById);
s->RegisterFunction("BanPlayerByName", "Script_BanPlayerByName", "Bans a player from the server by name", "void", "string", &VScriptCode::Shared::BanPlayerByName);
s->RegisterFunction("BanPlayerById", "Script_BanPlayerById", "Bans a player from the server by handle or nucleus id", "void", "string, string", &VScriptCode::Shared::BanPlayerById);
s->RegisterFunction("UnbanPlayer", "Script_UnbanPlayer", "Unbans a player from the server by nucleus id or ip address", "void", "string, string", &VScriptCode::Shared::UnbanPlayer);
s->RegisterFunction("ShutdownHostGame", "Script_ShutdownHostGame", "Shuts the local host game down", "void", "", &VScriptCode::Shared::ShutdownHostGame);
s->RegisterFunction("IsDedicated", "Script_IsDedicated", "Returns whether this is a dedicated server", "bool", "", &VScriptCode::Server::IsDedicated);
}

View File

View File

@ -30,7 +30,7 @@
namespace VScriptCode
{
namespace SHARED
namespace Shared
{
//-----------------------------------------------------------------------------
// Purpose: SDK test and example body
@ -208,517 +208,4 @@ namespace VScriptCode
return SQ_OK;
}
}
#ifndef CLIENT_DLL
namespace SERVER
{
//-----------------------------------------------------------------------------
// Purpose: gets the number of real players on this server
//-----------------------------------------------------------------------------
SQRESULT GetNumHumanPlayers(HSQUIRRELVM v)
{
sq_pushinteger(v, g_pServer->GetNumHumanPlayers());
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: gets the number of fake players on this server
//-----------------------------------------------------------------------------
SQRESULT GetNumFakeClients(HSQUIRRELVM v)
{
sq_pushinteger(v, g_pServer->GetNumFakeClients());
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: checks whether this SDK build is a dedicated server
//-----------------------------------------------------------------------------
SQRESULT IsDedicated(HSQUIRRELVM v)
{
sq_pushbool(v, ::IsDedicated());
return SQ_OK;
}
}
#endif // !CLIENT_DLL
#ifndef SERVER_DLL
namespace CLIENT
{
}
namespace UI
{
//-----------------------------------------------------------------------------
// Purpose: refreshes the server list
//-----------------------------------------------------------------------------
SQRESULT RefreshServerCount(HSQUIRRELVM v)
{
string serverMessage; // Refresh list.
size_t iCount = g_pServerListManager->RefreshServerList(serverMessage);
sq_pushinteger(v, static_cast<SQInteger>(iCount));
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current name from serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerName(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& serverName = g_pServerListManager->m_vServerList[iServer].m_svHostName;
sq_pushstring(v, serverName.c_str(), -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current description from serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerDescription(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& serverDescription = g_pServerListManager->m_vServerList[iServer].m_svDescription;
sq_pushstring(v, serverDescription.c_str(), -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current map via serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerMap(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& svServerMapName = g_pServerListManager->m_vServerList[iServer].m_svHostMap;
sq_pushstring(v, svServerMapName.c_str(), -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current playlist via serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerPlaylist(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& serverPlaylist = g_pServerListManager->m_vServerList[iServer].m_svPlaylist;
sq_pushstring(v, serverPlaylist.c_str(), -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current player count via serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerCurrentPlayers(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& playerCount = g_pServerListManager->m_vServerList[iServer].m_svPlayerCount.c_str();
sq_pushinteger(v, strtol(playerCount.c_str(), NULL, NULL));
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get server's current player count via serverlist index
//-----------------------------------------------------------------------------
SQRESULT GetServerMaxPlayers(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const string& maxPlayers = g_pServerListManager->m_vServerList[iServer].m_svMaxPlayers;
sq_pushinteger(v, strtol(maxPlayers.c_str(), NULL, NULL));
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get current server count from pylon
//-----------------------------------------------------------------------------
SQRESULT GetServerCount(HSQUIRRELVM v)
{
size_t iCount = g_pServerListManager->m_vServerList.size();
sq_pushinteger(v, static_cast<SQInteger>(iCount));
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get promo data for serverbrowser panels
//-----------------------------------------------------------------------------
SQRESULT GetPromoData(HSQUIRRELVM v)
{
enum class R5RPromoData : SQInteger
{
PromoLargeTitle,
PromoLargeDesc,
PromoLeftTitle,
PromoLeftDesc,
PromoRightTitle,
PromoRightDesc
};
R5RPromoData ePromoIndex = static_cast<R5RPromoData>(sq_getinteger(v, 1));
const char* pszPromoKey;
switch (ePromoIndex)
{
case R5RPromoData::PromoLargeTitle:
{
pszPromoKey = "#PROMO_LARGE_TITLE";
break;
}
case R5RPromoData::PromoLargeDesc:
{
pszPromoKey = "#PROMO_LARGE_DESCRIPTION";
break;
}
case R5RPromoData::PromoLeftTitle:
{
pszPromoKey = "#PROMO_LEFT_TITLE";
break;
}
case R5RPromoData::PromoLeftDesc:
{
pszPromoKey = "#PROMO_LEFT_DESCRIPTION";
break;
}
case R5RPromoData::PromoRightTitle:
{
pszPromoKey = "#PROMO_RIGHT_TITLE";
break;
}
case R5RPromoData::PromoRightDesc:
{
pszPromoKey = "#PROMO_RIGHT_DESCRIPTION";
break;
}
default:
{
pszPromoKey = "#PROMO_SDK_ERROR";
break;
}
}
sq_pushstring(v, pszPromoKey, -1);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: create server via native serverbrowser entries
// TODO: return a boolean on failure instead of raising an error, so we could
// determine from scripts whether or not to spin a local server, or connect
// to a dedicated server (for disconnecting and loading the lobby, for example)
//-----------------------------------------------------------------------------
SQRESULT CreateServer(HSQUIRRELVM v)
{
#ifndef CLIENT_DLL
SQChar* serverName = sq_getstring(v, 1);
SQChar* serverDescription = sq_getstring(v, 2);
SQChar* serverMapName = sq_getstring(v, 3);
SQChar* serverPlaylist = sq_getstring(v, 4);
EServerVisibility_t eServerVisibility = static_cast<EServerVisibility_t>(sq_getinteger(v, 5));
if (!VALID_CHARSTAR(serverName) ||
!VALID_CHARSTAR(serverMapName) ||
!VALID_CHARSTAR(serverPlaylist))
{
return SQ_OK;
}
// Adjust browser settings.
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
g_pServerListManager->m_Server.m_svHostName = serverName;
g_pServerListManager->m_Server.m_svDescription = serverDescription;
g_pServerListManager->m_Server.m_svHostMap = serverMapName;
g_pServerListManager->m_Server.m_svPlaylist = serverPlaylist;
g_pServerListManager->m_ServerVisibility = eServerVisibility;
// Launch server.
g_pServerListManager->LaunchServer();
return SQ_OK;
#else
v_SQVM_RaiseError(v, "\"%s\" is not supported for client builds.\n", "CreateServer");
return SQ_ERROR;
#endif
}
//-----------------------------------------------------------------------------
// Purpose: connect to server from native server browser entries
//-----------------------------------------------------------------------------
SQRESULT ConnectToServer(HSQUIRRELVM v)
{
SQChar* ipAddress = sq_getstring(v, 1);
SQChar* cryptoKey = sq_getstring(v, 2);
if (!VALID_CHARSTAR(ipAddress) || VALID_CHARSTAR(cryptoKey))
return SQ_OK;
DevMsg(eDLL_T::UI, "Connecting to server with ip address '%s' and encryption key '%s'\n", ipAddress, cryptoKey);
g_pServerListManager->ConnectToServer(ipAddress, cryptoKey);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: set netchannel encryption key and connect to server
//-----------------------------------------------------------------------------
SQRESULT ConnectToListedServer(HSQUIRRELVM v)
{
std::lock_guard<std::mutex> l(g_pServerListManager->m_Mutex);
SQInteger iServer = sq_getinteger(v, 1);
SQInteger iCount = static_cast<SQInteger>(g_pServerListManager->m_vServerList.size());
if (iServer >= iCount)
{
v_SQVM_RaiseError(v, "Index must be less than %i.\n", iCount);
return SQ_ERROR;
}
const NetGameServer_t& gameServer = g_pServerListManager->m_vServerList[iServer];
g_pServerListManager->ConnectToServer(gameServer.m_svIpAddress, gameServer.m_svGamePort,
gameServer.m_svEncryptionKey);
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: request token from pylon and join server with result.
//-----------------------------------------------------------------------------
SQRESULT ConnectToHiddenServer(HSQUIRRELVM v)
{
SQChar* privateToken = sq_getstring(v, 1);
if (!VALID_CHARSTAR(privateToken))
return SQ_OK;
string hiddenServerRequestMessage;
NetGameServer_t netListing;
bool result = g_pMasterServer->GetServerByToken(netListing, hiddenServerRequestMessage, privateToken); // Send token connect request.
if (result)
{
g_pServerListManager->ConnectToServer(netListing.m_svIpAddress, netListing.m_svGamePort, netListing.m_svEncryptionKey);
}
else
{
Warning(eDLL_T::UI, "Failed to connect to private server: %s\n", hiddenServerRequestMessage.c_str());
}
return SQ_OK;
}
//-----------------------------------------------------------------------------
// Purpose: get response from private server request
//-----------------------------------------------------------------------------
SQRESULT GetHiddenServerName(HSQUIRRELVM v)
{
SQChar* privateToken = sq_getstring(v, 1);
if (!VALID_CHARSTAR(privateToken))
return SQ_OK;
string hiddenServerRequestMessage;
NetGameServer_t serverListing;
bool result = g_pMasterServer->GetServerByToken(serverListing, hiddenServerRequestMessage, privateToken); // Send token connect request.
if (!result)
{
if (hiddenServerRequestMessage.empty())
{
sq_pushstring(v, "Request failed", -1);
}
else
{
hiddenServerRequestMessage = Format("Request failed: %s", hiddenServerRequestMessage.c_str());
sq_pushstring(v, hiddenServerRequestMessage.c_str(), -1);
}
return SQ_OK;
}
if (serverListing.m_svHostName.empty())
{
if (hiddenServerRequestMessage.empty())
{
hiddenServerRequestMessage = Format("Server listing empty");
}
else
{
hiddenServerRequestMessage = Format("Server listing empty: %s", hiddenServerRequestMessage.c_str());
}
sq_pushstring(v, hiddenServerRequestMessage.c_str(), -1);
}
else
{
hiddenServerRequestMessage = Format("Found server: %s", serverListing.m_svHostName.c_str());
sq_pushstring(v, hiddenServerRequestMessage.c_str(), -1);
}
return SQ_OK;
}
}
#endif // !SERVER_DLL
}
#ifndef CLIENT_DLL
//---------------------------------------------------------------------------------
// Purpose: registers script functions in SERVER context
// Input : *s -
//---------------------------------------------------------------------------------
void Script_RegisterServerFunctions(CSquirrelVM* s)
{
s->RegisterFunction("SDKNativeTest", "Script_SDKNativeTest", "Native SERVER test function", "void", "", &VScriptCode::SHARED::SDKNativeTest);
s->RegisterFunction("GetSDKVersion", "Script_GetSDKVersion", "Gets the SDK version as a string", "string", "", &VScriptCode::SHARED::GetSDKVersion);
s->RegisterFunction("GetNumHumanPlayers", "Script_GetNumHumanPlayers", "Gets the number of human players on the server", "int", "", &VScriptCode::SERVER::GetNumHumanPlayers);
s->RegisterFunction("GetNumFakeClients", "Script_GetNumFakeClients", "Gets the number of bot players on the server", "int", "", &VScriptCode::SERVER::GetNumFakeClients);
s->RegisterFunction("GetAvailableMaps", "Script_GetAvailableMaps", "Gets an array of all available maps", "array< string >", "", &VScriptCode::SHARED::GetAvailableMaps);
s->RegisterFunction("GetAvailablePlaylists", "Script_GetAvailablePlaylists", "Gets an array of all available playlists", "array< string >", "", &VScriptCode::SHARED::GetAvailablePlaylists);
s->RegisterFunction("KickPlayerByName", "Script_KickPlayerByName", "Kicks a player from the server by name", "void", "string, string", &VScriptCode::SHARED::KickPlayerByName);
s->RegisterFunction("KickPlayerById", "Script_KickPlayerById", "Kicks a player from the server by handle or nucleus id", "void", "string, string", &VScriptCode::SHARED::KickPlayerById);
s->RegisterFunction("BanPlayerByName", "Script_BanPlayerByName", "Bans a player from the server by name", "void", "string", &VScriptCode::SHARED::BanPlayerByName);
s->RegisterFunction("BanPlayerById", "Script_BanPlayerById", "Bans a player from the server by handle or nucleus id", "void", "string, string", &VScriptCode::SHARED::BanPlayerById);
s->RegisterFunction("UnbanPlayer", "Script_UnbanPlayer", "Unbans a player from the server by nucleus id or ip address", "void", "string, string", &VScriptCode::SHARED::UnbanPlayer);
s->RegisterFunction("ShutdownHostGame", "Script_ShutdownHostGame", "Shuts the local host game down", "void", "", &VScriptCode::SHARED::ShutdownHostGame);
s->RegisterFunction("IsDedicated", "Script_IsDedicated", "Returns whether this is a dedicated server", "bool", "", &VScriptCode::SERVER::IsDedicated);
}
#endif // !CLIENT_DLL
#ifndef SERVER_DLL
//---------------------------------------------------------------------------------
// Purpose: registers script functions in CLIENT context
// Input : *s -
//---------------------------------------------------------------------------------
void Script_RegisterClientFunctions(CSquirrelVM* s)
{
s->RegisterFunction("SDKNativeTest", "Script_SDKNativeTest", "Native CLIENT test function", "void", "", &VScriptCode::SHARED::SDKNativeTest);
s->RegisterFunction("GetSDKVersion", "Script_GetSDKVersion", "Gets the SDK version as a string", "string", "", &VScriptCode::SHARED::GetSDKVersion);
s->RegisterFunction("GetAvailableMaps", "Script_GetAvailableMaps", "Gets an array of all available maps", "array< string >", "", &VScriptCode::SHARED::GetAvailableMaps);
s->RegisterFunction("GetAvailablePlaylists", "Script_GetAvailablePlaylists", "Gets an array of all available playlists", "array< string >", "", &VScriptCode::SHARED::GetAvailablePlaylists);
s->RegisterFunction("ShutdownHostGame", "Script_ShutdownHostGame", "Shuts the local host game down", "void", "", &VScriptCode::SHARED::ShutdownHostGame);
s->RegisterFunction("IsClientDLL", "Script_IsClientDLL", "Returns whether this build is client only", "bool", "", &VScriptCode::SHARED::IsClientDLL);
}
//---------------------------------------------------------------------------------
// Purpose: registers script functions in UI context
// Input : *s -
//---------------------------------------------------------------------------------
void Script_RegisterUIFunctions(CSquirrelVM* s)
{
s->RegisterFunction("SDKNativeTest", "Script_SDKNativeTest", "Native UI test function", "void", "", &VScriptCode::SHARED::SDKNativeTest);
s->RegisterFunction("GetSDKVersion", "Script_GetSDKVersion", "Gets the SDK version as a string", "string", "", &VScriptCode::SHARED::GetSDKVersion);
s->RegisterFunction("RefreshServerList", "Script_RefreshServerList", "Refreshes the public server list and returns the count", "int", "", &VScriptCode::UI::RefreshServerCount);
// Functions for retrieving server browser data
s->RegisterFunction("GetServerName", "Script_GetServerName", "Gets the name of the server at the specified index of the server list", "string", "int", &VScriptCode::UI::GetServerName);
s->RegisterFunction("GetServerDescription", "Script_GetServerDescription", "Gets the description of the server at the specified index of the server list", "string", "int", &VScriptCode::UI::GetServerDescription);
s->RegisterFunction("GetServerMap", "Script_GetServerMap", "Gets the map of the server at the specified index of the server list", "string", "int", &VScriptCode::UI::GetServerMap);
s->RegisterFunction("GetServerPlaylist", "Script_GetServerPlaylist", "Gets the playlist of the server at the specified index of the server list", "string", "int", &VScriptCode::UI::GetServerPlaylist);
s->RegisterFunction("GetServerCurrentPlayers", "Script_GetServerCurrentPlayers", "Gets the current player count of the server at the specified index of the server list", "int", "int", &VScriptCode::UI::GetServerCurrentPlayers);
s->RegisterFunction("GetServerMaxPlayers", "Script_GetServerMaxPlayers", "Gets the max player count of the server at the specified index of the server list", "int", "int", &VScriptCode::UI::GetServerMaxPlayers);
s->RegisterFunction("GetServerCount", "Script_GetServerCount", "Gets the number of public servers", "int", "", &VScriptCode::UI::GetServerCount);
// Misc main menu functions
s->RegisterFunction("GetPromoData", "Script_GetPromoData", "Gets promo data for specified slot type", "string", "int", &VScriptCode::UI::GetPromoData);
// Functions for creating servers
s->RegisterFunction("CreateServer", "Script_CreateServer", "Starts server with the specified settings", "void", "string, string, string, string, int", &VScriptCode::UI::CreateServer);
s->RegisterFunction("IsServerActive", "Script_IsServerActive", "Returns whether the server is active", "bool", "", &VScriptCode::SHARED::IsServerActive);
// Functions for connecting to servers
s->RegisterFunction("ConnectToServer", "Script_ConnectToServer", "Joins server by ip address and encryption key", "void", "string, string", &VScriptCode::UI::ConnectToServer);
s->RegisterFunction("ConnectToListedServer", "Script_ConnectToListedServer", "Joins listed server by index", "void", "int", &VScriptCode::UI::ConnectToListedServer);
s->RegisterFunction("ConnectToHiddenServer", "Script_ConnectToHiddenServer", "Joins hidden server by token", "void", "string", &VScriptCode::UI::ConnectToHiddenServer);
s->RegisterFunction("GetHiddenServerName", "Script_GetHiddenServerName", "Gets hidden server name by token", "string", "string", &VScriptCode::UI::GetHiddenServerName);
s->RegisterFunction("GetAvailableMaps", "Script_GetAvailableMaps", "Gets an array of all available maps", "array< string >", "", &VScriptCode::SHARED::GetAvailableMaps);
s->RegisterFunction("GetAvailablePlaylists", "Script_GetAvailablePlaylists", "Gets an array of all available playlists", "array< string >", "", &VScriptCode::SHARED::GetAvailablePlaylists);
#ifndef CLIENT_DLL // UI 'admin' functions controlling server code
s->RegisterFunction("KickPlayerByName", "Script_KickPlayerByName", "Kicks a player from the server by name", "void", "string", &VScriptCode::SHARED::KickPlayerByName);
s->RegisterFunction("KickPlayerById", "Script_KickPlayerById", "Kicks a player from the server by handle or nucleus id", "void", "string", &VScriptCode::SHARED::KickPlayerById);
s->RegisterFunction("BanPlayerByName", "Script_BanPlayerByName", "Bans a player from the server by name", "void", "string", &VScriptCode::SHARED::BanPlayerByName);
s->RegisterFunction("BanPlayerById", "Script_BanPlayerById", "Bans a player from the server by handle or nucleus id", "void", "string", &VScriptCode::SHARED::BanPlayerById);
s->RegisterFunction("UnbanPlayer", "Script_UnbanPlayer", "Unbans a player from the server by nucleus id or ip address", "void", "string", &VScriptCode::SHARED::UnbanPlayer);
s->RegisterFunction("ShutdownHostGame", "Script_ShutdownHostGame", "Shuts the local host game down", "void", "", &VScriptCode::SHARED::ShutdownHostGame);
#endif // !CLIENT_DLL
s->RegisterFunction("IsClientDLL", "Script_IsClientDLL", "Returns whether this build is client only", "bool", "", &VScriptCode::SHARED::IsClientDLL);
}
#endif

View File

@ -18,7 +18,7 @@ inline uint32_t* g_nClientRemoteChecksum = nullptr;
namespace VScriptCode
{
namespace SHARED
namespace Shared
{
SQRESULT SDKNativeTest(HSQUIRRELVM v);
SQRESULT GetSDKVersion(HSQUIRRELVM v);
@ -38,7 +38,7 @@ namespace VScriptCode
#endif // !CLIENT_DLL
}
#ifndef CLIENT_DLL
namespace SERVER
namespace Server
{
SQRESULT GetNumHumanPlayers(HSQUIRRELVM v);
SQRESULT GetNumFakeClients(HSQUIRRELVM v);
@ -46,10 +46,10 @@ namespace VScriptCode
}
#endif // !CLIENT_DLL
#ifndef SERVER_DLL
namespace CLIENT
namespace Client
{
}
namespace UI
namespace Ui
{
SQRESULT RefreshServerCount(HSQUIRRELVM v);
SQRESULT GetServerName(HSQUIRRELVM v);