Cassandra/cassandra.h

68 lines
1.9 KiB
C
Raw Permalink Normal View History

2019-09-25 11:36:02 +02:00
/**
* vim: set ts=4 sw=4 tw=99 noet :
* ======================================================
* Metamod:Source Stub Plugin
* Written by AlliedModders LLC.
* ======================================================
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from
* the use of this software.
*
* This stub plugin is public domain.
*/
#ifndef _INCLUDE_METAMOD_SOURCE_CASSANDRA_PLUGIN_H_
#define _INCLUDE_METAMOD_SOURCE_CASSANDRA_PLUGIN_H_
#include <ISmmPlugin.h>
#include "engine_wrappers.h"
#include <playerinfomanager.h>
#include <eiface.h>
#include <inetchannel.h>
#include <unistd.h>
#include <signal.h>
#if defined WIN32 && !defined snprintf
#define snprintf _snprintf
#endif
class Cassandra : public ISmmPlugin
{
public:
bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
bool Unload(char *error, size_t maxlen);
public:
const char *GetAuthor();
const char *GetName();
const char *GetDescription();
const char *GetURL();
const char *GetLicense();
const char *GetVersion();
const char *GetDate();
const char *GetLogTag();
public:
bool LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background);
void OnGameFrame(bool simulating);
public:
void InstallSignalHandler(void);
void RemoveSignalHandler(void);
void Hooped(void);
void TakeStackTrace(const char *pInput);
private:
int m_iGameFrameHook;
int m_iLevelInitHook;
unsigned m_iCounter;
};
extern Cassandra g_Cassandra;
PLUGIN_GLOBALVARS();
void SignalAction(int sig, siginfo_t *pInfo, void *pData);
int RecvFrom(int s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen);
#endif //_INCLUDE_METAMOD_SOURCE_CASSANDRA_PLUGIN_H_