1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/sourcemm/vsp_listener.cpp Sat Feb 10 00:31:34 2007 +0000
1.3 @@ -0,0 +1,123 @@
1.4 +/* ======== SourceMM ========
1.5 + * Copyright (C) 2004-2007 Metamod:Source Development Team
1.6 + * No warranties of any kind
1.7 + *
1.8 + * License: zlib/libpng
1.9 + *
1.10 + * Author(s): David "BAILOPAN" Anderson
1.11 + * ============================
1.12 + */
1.13 +
1.14 +#include "vsp_listener.h"
1.15 +
1.16 +VSPListener g_VspListener;
1.17 +
1.18 +VSPListener::VSPListener()
1.19 +{
1.20 + m_Loaded = false;
1.21 + m_Loadable = false;
1.22 +}
1.23 +
1.24 +void VSPListener::ClientActive(edict_t *pEntity)
1.25 +{
1.26 +}
1.27 +
1.28 +PLUGIN_RESULT VSPListener::ClientCommand(edict_t *pEntity)
1.29 +{
1.30 + return PLUGIN_CONTINUE;
1.31 +}
1.32 +
1.33 +PLUGIN_RESULT VSPListener::ClientConnect(bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
1.34 +{
1.35 + return PLUGIN_CONTINUE;
1.36 +}
1.37 +
1.38 +void VSPListener::ClientDisconnect(edict_t *pEntity)
1.39 +{
1.40 +}
1.41 +
1.42 +void VSPListener::ClientPutInServer(edict_t *pEntity, char const *playername)
1.43 +{
1.44 +}
1.45 +
1.46 +void VSPListener::ClientSettingsChanged(edict_t *pEdict)
1.47 +{
1.48 +}
1.49 +
1.50 +void VSPListener::SetCommandClient(int index)
1.51 +{
1.52 +}
1.53 +
1.54 +void VSPListener::GameFrame(bool simulating)
1.55 +{
1.56 +}
1.57 +
1.58 +const char *VSPListener::GetPluginDescription()
1.59 +{
1.60 + return "Metamod:Source Interface v" SOURCEMM_VERSION;
1.61 +}
1.62 +
1.63 +bool VSPListener::IsLoaded()
1.64 +{
1.65 + return m_Loaded;
1.66 +}
1.67 +
1.68 +void VSPListener::LevelInit(char const *pMapName)
1.69 +{
1.70 +}
1.71 +
1.72 +void VSPListener::LevelShutdown()
1.73 +{
1.74 +}
1.75 +
1.76 +PLUGIN_RESULT VSPListener::NetworkIDValidated(const char *pszUserName, const char *pszNetworkID)
1.77 +{
1.78 + return PLUGIN_CONTINUE;
1.79 +}
1.80 +
1.81 +void VSPListener::Pause()
1.82 +{
1.83 +}
1.84 +
1.85 +void VSPListener::UnPause()
1.86 +{
1.87 +}
1.88 +
1.89 +void VSPListener::ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
1.90 +{
1.91 +}
1.92 +
1.93 +void VSPListener::Unload()
1.94 +{
1.95 +}
1.96 +
1.97 +void VSPListener::SetLoadable(bool set)
1.98 +{
1.99 + m_Loadable = set;
1.100 +}
1.101 +
1.102 +bool VSPListener::Load(CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory)
1.103 +{
1.104 + if (!g_GameDll.loaded)
1.105 + {
1.106 + Error("Metamod:Source is not a Valve Server Plugin\n");
1.107 +
1.108 + return false;
1.109 + }
1.110 +
1.111 + if (!m_Loadable)
1.112 + {
1.113 + Warning("Do not manually load Metamod:Source as a Valve Server Plugin\n");
1.114 +
1.115 + return false;
1.116 + }
1.117 +
1.118 + if (m_Loaded)
1.119 + {
1.120 + return false;
1.121 + }
1.122 +
1.123 + m_Loaded = true;
1.124 +
1.125 + return true;
1.126 +}