2015-09-30 02:56:11 +02:00
|
|
|
#include "Common.hpp"
|
|
|
|
#include "Logger.hpp"
|
|
|
|
#include "Core.hpp"
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
#include <cstdio>
|
|
|
|
|
2015-10-30 03:17:18 +01:00
|
|
|
#if defined(_WIN32)
|
|
|
|
#include <winsock2.h>
|
|
|
|
#endif // _WIN32
|
|
|
|
|
2015-09-30 02:56:11 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------------
|
|
|
|
PluginFuncs* _Func = 0;
|
|
|
|
PluginCallbacks* _Clbk = 0;
|
|
|
|
PluginInfo* _Info = 0;
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void BindCallbacks();
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs * funcs, PluginCallbacks * calls, PluginInfo * info)
|
|
|
|
{
|
2015-10-30 03:17:18 +01:00
|
|
|
#if defined(_WIN32)
|
|
|
|
WSADATA wsaData;
|
|
|
|
#endif // _WIN32
|
|
|
|
// Verify that core components are working
|
2015-09-30 02:56:11 +02:00
|
|
|
if (!_Log)
|
|
|
|
{
|
|
|
|
puts("[SQMOD] Unable to start because the logging class could not be instantiated");
|
|
|
|
return SQMOD_FAILURE;
|
|
|
|
}
|
|
|
|
else if (!_Core)
|
|
|
|
{
|
|
|
|
puts("[SQMOD] Unable to start because the central core class could not be instantiated");
|
|
|
|
return SQMOD_FAILURE;
|
|
|
|
}
|
2015-10-30 03:17:18 +01:00
|
|
|
#if defined(_WIN32)
|
|
|
|
// Initialize the sockets on windows
|
|
|
|
else if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
|
|
|
|
{
|
|
|
|
puts("[SQMOD] Unable to start because the windows sockets could not be initialized");
|
|
|
|
return SQMOD_FAILURE;
|
|
|
|
}
|
|
|
|
#endif // _WIN32
|
2015-09-30 02:56:11 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
_Func = funcs;
|
|
|
|
_Clbk = calls;
|
|
|
|
_Info = info;
|
|
|
|
|
|
|
|
_Info->uPluginVer = SQMOD_VERSION;
|
|
|
|
std::strcpy(_Info->szName, SQMOD_NAME);
|
|
|
|
}
|
|
|
|
|
|
|
|
_Log->Msg("%s", CenterStr("STARTUP", '*'));
|
|
|
|
|
|
|
|
_Log->Inf("%s", CenterStr(SQMOD_NAME, ' '));
|
|
|
|
_Log->Inf("%s", CenterStr(SQMOD_COPYRIGHT, ' '));
|
|
|
|
_Log->Inf("%s", CenterStr(SQMOD_VERSION_STR, ' '));
|
|
|
|
|
|
|
|
if (!_Core->Init())
|
|
|
|
{
|
|
|
|
_Log->Ftl("The plugin failed to initialize");
|
|
|
|
_Log->Msg("%s", CenterStr("ABORTING", '*'));
|
|
|
|
|
|
|
|
_Core->Deinit();
|
|
|
|
|
|
|
|
return SQMOD_FAILURE;
|
|
|
|
}
|
|
|
|
else if (_Clbk)
|
|
|
|
{
|
|
|
|
BindCallbacks();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_Log->Ftl("Unable to start because the server callbacks are missing");
|
|
|
|
|
|
|
|
return SQMOD_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return SQMOD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_InitServer(void)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
if (_Core->Load())
|
|
|
|
{
|
|
|
|
_Core->OnServerStartup();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_Log->Ftl("Unable to load the plugin resources properly");
|
|
|
|
}
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_ShutdownServer(void)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnServerShutdown();
|
|
|
|
_Core->Terminate();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_Frame(float delta)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnServerFrame(delta);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerConnect(int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-11-07 11:17:39 +01:00
|
|
|
_Core->ConnectPlayer(player, SQMOD_CREATE_AUTOMATIC, NullData());
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerDisconnect(int player, int reason)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-11-07 11:17:39 +01:00
|
|
|
_Core->DisconnectPlayer(player, reason, NullData());
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerBeginTyping(int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerStartTyping(player);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerEndTyping(int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerStopTyping(player);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_PlayerRequestClass(int player, int offset)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
|
|
|
_Core->OnPlayerRequestClass(player, offset);
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_PlayerRequestSpawn(int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
|
|
|
_Core->OnPlayerRequestSpawn(player);
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerSpawn(int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerSpawn(player);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerDeath(int player, int killer, int reason, int body_part)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
if (_Func->IsPlayerConnected(killer))
|
|
|
|
{
|
|
|
|
_Core->OnPlayerKilled(player, killer, reason, body_part);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_Core->OnPlayerWasted(player, reason);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerUpdate(int player, int type)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerUpdate(player, type);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_PlayerRequestEnter(int player, int vehicle, int slot)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
|
|
|
_Core->OnPlayerEmbarking(player, vehicle, slot);
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerEnterVehicle(int player, int vehicle, int slot)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerEmbarked(player, vehicle, slot);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerExitVehicle(int player, int vehicle)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerDisembark(player, vehicle);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_PickupClaimPicked(int pickup, int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
2015-10-11 23:26:14 +02:00
|
|
|
_Core->OnPickupClaimed(player, pickup);
|
2015-09-30 02:56:11 +02:00
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PickupPickedUp(int pickup, int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-10-11 23:26:14 +02:00
|
|
|
_Core->OnPickupCollected(player, pickup);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PickupRespawn(int pickup)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPickupRespawn(pickup);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_VehicleUpdate(int vehicle, int type)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnVehicleUpdate(vehicle, type);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_VehicleExplode(int vehicle)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnVehicleExplode(vehicle);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_VehicleRespawn(int vehicle)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnVehicleRespawn(vehicle);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_ObjectShot(int object, int player, int weapon)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-10-11 23:26:14 +02:00
|
|
|
_Core->OnObjectShot(player, object, weapon);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_ObjectBump(int object, int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-10-11 23:26:14 +02:00
|
|
|
_Core->OnObjectBump(player, object);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_PublicMessage(int player, const char * text)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
|
|
|
_Core->OnPlayerChat(player, static_cast<const SQChar *>(text));
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_CommandMessage(int player, const char * text)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
|
|
|
_Core->OnPlayerCommand(player, static_cast<const SQChar *>(text));
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_PrivateMessage(int player, int target, const char * text)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
|
|
|
_Core->OnPlayerMessage(player, target, static_cast<const SQChar *>(text));
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_InternalCommand(unsigned int type, const char * text)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
|
|
|
_Core->OnInternalCommand(type, static_cast<const SQChar *>(text));
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static int VC_LoginAttempt(char * name, const char * passwd, const char * address)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->SetState(SQMOD_SUCCESS);
|
|
|
|
_Core->OnLoginAttempt(static_cast<const SQChar *>(name), static_cast<const SQChar *>(passwd), static_cast<const SQChar *>(address));
|
|
|
|
return _Core->GetState();
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_EntityPool(int type, int id, unsigned int deleted)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnEntityPool(type, id, static_cast<bool>(deleted));
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_KeyBindDown(int player, int bind)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerKeyPress(player, bind);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_KeyBindUp(int player, int bind)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerKeyRelease(player, bind);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerAway(int player, unsigned int status)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerAway(player, static_cast<bool>(status));
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerSpectate(int player, int target)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerSpectate(player, target);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerCrashReport(int player, const char * report)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerCrashreport(player, static_cast<const SQChar *>(report));
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_ServerPerformanceReport(int count, const char ** description, unsigned long long * millis)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
// Ignored for now...
|
2015-11-01 04:36:03 +01:00
|
|
|
SQMOD_UNUSED_VAR(count);
|
|
|
|
SQMOD_UNUSED_VAR(description);
|
|
|
|
SQMOD_UNUSED_VAR(millis);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerName(int player, const char * previous, const char * current)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerName(player, static_cast<const SQChar *>(previous), static_cast<const SQChar *>(current));
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerState(int player, int previous, int current)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerState(player, previous, current);
|
|
|
|
|
|
|
|
switch (current)
|
|
|
|
{
|
|
|
|
case SQMOD_PLAYER_STATE_NONE:
|
|
|
|
_Core->OnStateNone(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_STATE_NORMAL:
|
|
|
|
_Core->OnStateNormal(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_STATE_SHOOTING:
|
|
|
|
_Core->OnStateShooting(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_STATE_DRIVER:
|
|
|
|
_Core->OnStateDriver(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_STATE_PASSENGER:
|
|
|
|
_Core->OnStatePassenger(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_STATE_ENTERING_AS_DRIVER:
|
|
|
|
_Core->OnStateEnterDriver(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_STATE_ENTERING_AS_PASSENGER:
|
|
|
|
_Core->OnStateEnterPassenger(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_STATE_EXITING_VEHICLE:
|
|
|
|
_Core->OnStateExitVehicle(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_STATE_UNSPAWNED:
|
|
|
|
_Core->OnStateUnspawned(player, previous);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerAction(int player, int previous, int current)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerAction(player, previous, current);
|
|
|
|
|
|
|
|
switch (current)
|
|
|
|
{
|
|
|
|
case SQMOD_PLAYER_ACTION_NONE:
|
|
|
|
_Core->OnActionNone(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_NORMAL:
|
|
|
|
_Core->OnActionNormal(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_AIMING:
|
|
|
|
_Core->OnActionAiming(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_SHOOTING:
|
|
|
|
_Core->OnActionShooting(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_JUMPING:
|
|
|
|
_Core->OnActionJumping(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_LYING_ON_GROUND:
|
|
|
|
_Core->OnActionLieDown(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_GETTING_UP:
|
|
|
|
_Core->OnActionGettingUp(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_JUMPING_FROM_VEHICLE:
|
|
|
|
_Core->OnActionJumpVehicle(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_DRIVING:
|
|
|
|
_Core->OnActionDriving(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_DYING:
|
|
|
|
_Core->OnActionDying(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_WASTED:
|
|
|
|
_Core->OnActionWasted(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_ENTERING_VEHICLE:
|
|
|
|
_Core->OnActionEmbarking(player, previous);
|
|
|
|
break;
|
|
|
|
case SQMOD_PLAYER_ACTION_EXITING_VEHICLE:
|
|
|
|
_Core->OnActionDisembarking(player, previous);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerOnFire(int player, unsigned int state)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerBurning(player, static_cast<bool>(state));
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerCrouch(int player, unsigned int state)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerCrouching(player, static_cast<bool>(state));
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_PlayerGameKeys(int player, int previous, int current)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Core->OnPlayerGameKeys(player, previous, current);
|
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_OnCheckpointEntered(int checkpoint, int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-10-11 23:26:14 +02:00
|
|
|
_Core->OnCheckpointEntered(player, checkpoint);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_OnCheckpointExited(int checkpoint, int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-10-11 23:26:14 +02:00
|
|
|
_Core->OnCheckpointExited(player, checkpoint);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_OnSphereEntered(int sphere, int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-10-11 23:26:14 +02:00
|
|
|
_Core->OnSphereEntered(player, sphere);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
2015-11-01 04:48:01 +01:00
|
|
|
static void VC_OnSphereExited(int sphere, int player)
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
2015-10-11 23:26:14 +02:00
|
|
|
_Core->OnSphereExited(player, sphere);
|
2015-09-30 02:56:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
void BindCallbacks()
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
_Clbk->OnInitServer = VC_InitServer;
|
|
|
|
_Clbk->OnShutdownServer = VC_ShutdownServer;
|
|
|
|
_Clbk->OnFrame = VC_Frame;
|
|
|
|
_Clbk->OnPlayerConnect = VC_PlayerConnect;
|
|
|
|
_Clbk->OnPlayerDisconnect = VC_PlayerDisconnect;
|
|
|
|
_Clbk->OnPlayerBeginTyping = VC_PlayerBeginTyping;
|
|
|
|
_Clbk->OnPlayerEndTyping = VC_PlayerEndTyping;
|
|
|
|
_Clbk->OnPlayerRequestClass = VC_PlayerRequestClass;
|
|
|
|
_Clbk->OnPlayerRequestSpawn = VC_PlayerRequestSpawn;
|
|
|
|
_Clbk->OnPlayerSpawn = VC_PlayerSpawn;
|
|
|
|
_Clbk->OnPlayerDeath = VC_PlayerDeath;
|
|
|
|
_Clbk->OnPlayerUpdate = VC_PlayerUpdate;
|
|
|
|
_Clbk->OnPlayerRequestEnter = VC_PlayerRequestEnter;
|
|
|
|
_Clbk->OnPlayerEnterVehicle = VC_PlayerEnterVehicle;
|
|
|
|
_Clbk->OnPlayerExitVehicle = VC_PlayerExitVehicle;
|
|
|
|
_Clbk->OnPickupClaimPicked = VC_PickupClaimPicked;
|
|
|
|
_Clbk->OnPickupPickedUp = VC_PickupPickedUp;
|
|
|
|
_Clbk->OnPickupRespawn = VC_PickupRespawn;
|
|
|
|
_Clbk->OnVehicleUpdate = VC_VehicleUpdate;
|
|
|
|
_Clbk->OnVehicleExplode = VC_VehicleExplode;
|
|
|
|
_Clbk->OnVehicleRespawn = VC_VehicleRespawn;
|
|
|
|
_Clbk->OnObjectShot = VC_ObjectShot;
|
|
|
|
_Clbk->OnObjectBump = VC_ObjectBump;
|
|
|
|
_Clbk->OnPublicMessage = VC_PublicMessage;
|
|
|
|
_Clbk->OnCommandMessage = VC_CommandMessage;
|
|
|
|
_Clbk->OnPrivateMessage = VC_PrivateMessage;
|
|
|
|
_Clbk->OnInternalCommand = VC_InternalCommand;
|
|
|
|
_Clbk->OnLoginAttempt = VC_LoginAttempt;
|
|
|
|
_Clbk->OnEntityPoolChange = VC_EntityPool;
|
|
|
|
_Clbk->OnKeyBindDown = VC_KeyBindDown;
|
|
|
|
_Clbk->OnKeyBindUp = VC_KeyBindUp;
|
|
|
|
_Clbk->OnPlayerAwayChange = VC_PlayerAway;
|
|
|
|
_Clbk->OnPlayerSpectate = VC_PlayerSpectate;
|
|
|
|
_Clbk->OnPlayerCrashReport = VC_PlayerCrashReport;
|
|
|
|
_Clbk->OnServerPerformanceReport = VC_ServerPerformanceReport;
|
|
|
|
_Clbk->OnPlayerNameChange = VC_PlayerName;
|
|
|
|
_Clbk->OnPlayerStateChange = VC_PlayerState;
|
|
|
|
_Clbk->OnPlayerActionChange = VC_PlayerAction;
|
|
|
|
_Clbk->OnPlayerOnFireChange = VC_PlayerOnFire;
|
|
|
|
_Clbk->OnPlayerCrouchChange = VC_PlayerCrouch;
|
|
|
|
_Clbk->OnPlayerGameKeysChange = VC_PlayerGameKeys;
|
|
|
|
_Clbk->OnCheckpointEntered = VC_OnCheckpointEntered;
|
|
|
|
_Clbk->OnCheckpointExited = VC_OnCheckpointExited;
|
|
|
|
_Clbk->OnSphereEntered = VC_OnSphereEntered;
|
|
|
|
_Clbk->OnSphereExited = VC_OnSphereExited;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2015-11-01 04:48:01 +01:00
|
|
|
SqObj & NullData()
|
2015-09-30 02:56:11 +02:00
|
|
|
{
|
|
|
|
static SqObj d;
|
|
|
|
d.Release();
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|