2023-10-20 08:31:31 +08:00
|
|
|
|
|
|
|
#ifndef SAMPSRV_MAIN_H
|
|
|
|
#define SAMPSRV_MAIN_H
|
|
|
|
|
2023-11-17 23:54:20 +08:00
|
|
|
// -------
|
|
|
|
// DEFINES
|
|
|
|
// -------
|
|
|
|
|
2024-04-11 22:47:05 +08:00
|
|
|
#define MAX_PLAYER_NAME 24
|
2023-11-17 23:54:20 +08:00
|
|
|
#define MAX_PLAYERS 1000
|
2023-11-22 23:39:02 +08:00
|
|
|
#define MAX_VEHICLES 2000
|
2024-01-20 23:16:31 +08:00
|
|
|
#define MAX_FILTER_SCRIPTS 16
|
2024-01-05 23:17:39 +08:00
|
|
|
#define MAX_OBJECTS 1000
|
2023-11-25 23:49:51 +08:00
|
|
|
#define MAX_MENUS 128
|
2023-11-25 23:10:24 +08:00
|
|
|
#define MAX_TEXT_DRAWS 2048
|
2023-11-25 23:49:51 +08:00
|
|
|
#define MAX_GANG_ZONES 1024
|
2023-12-01 20:45:27 +08:00
|
|
|
#define MAX_LABELS 1024
|
2023-12-01 20:39:48 +08:00
|
|
|
#define MAX_ACTORS 1000
|
2023-11-17 23:54:20 +08:00
|
|
|
|
2023-10-28 23:37:40 +08:00
|
|
|
#define DEFAULT_MAX_PLAYERS 50
|
|
|
|
#define DEFAULT_LISTEN_PORT 8192
|
|
|
|
|
2023-11-01 21:30:19 +08:00
|
|
|
#define ARRAY_SIZE(a) ( sizeof((a)) / sizeof(*(a)) )
|
2024-01-20 23:18:34 +08:00
|
|
|
#define SAFE_DELETE(p) { if (p) { delete (p); (p) = NULL; } }
|
2023-11-01 21:30:19 +08:00
|
|
|
|
2023-10-20 08:31:31 +08:00
|
|
|
// ------------
|
|
|
|
// VERSION INFO
|
|
|
|
// ------------
|
|
|
|
|
|
|
|
#define SAMP_VERSION "0.3.7-R2"
|
|
|
|
|
|
|
|
// ------------
|
|
|
|
// OS SPECIFICS
|
|
|
|
// ------------
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
2023-11-14 22:24:57 +08:00
|
|
|
#define SLEEP(x) { Sleep(x); }
|
2023-10-20 08:31:31 +08:00
|
|
|
|
|
|
|
#include <windows.h>
|
2023-11-17 23:25:37 +08:00
|
|
|
#include <mmsystem.h>
|
2023-10-20 08:31:31 +08:00
|
|
|
#include <time.h>
|
|
|
|
#else
|
2023-11-14 22:24:57 +08:00
|
|
|
#define SLEEP(x) { usleep(x * 1000); }
|
|
|
|
|
2023-11-01 21:30:19 +08:00
|
|
|
#ifndef stricmp
|
|
|
|
#define stricmp strcasecmp
|
|
|
|
#endif
|
2023-10-20 08:31:31 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// --------
|
|
|
|
// INCLUDES
|
|
|
|
// --------
|
|
|
|
|
|
|
|
// Regular crap
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2023-10-25 00:01:33 +08:00
|
|
|
// Std
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
2023-11-14 22:29:20 +08:00
|
|
|
// Raknet
|
2023-11-17 23:54:20 +08:00
|
|
|
#include "../raknet/RakServer.h"
|
|
|
|
#include "../raknet/RakNetworkFactory.h"
|
2024-02-14 22:51:29 +08:00
|
|
|
#include "../raknet/PacketEnumerations.h"
|
2024-01-04 23:40:00 +08:00
|
|
|
#include "../raknet/SAMPRPC.h"
|
2023-11-14 22:29:20 +08:00
|
|
|
#include "../raknet/GetTime.h"
|
|
|
|
|
2023-11-16 22:36:25 +08:00
|
|
|
// amx
|
|
|
|
#include "amx/amx.h"
|
|
|
|
|
2023-11-22 23:38:00 +08:00
|
|
|
// SA-MP
|
|
|
|
|
|
|
|
typedef unsigned short PLAYERID;
|
2023-12-01 20:39:48 +08:00
|
|
|
typedef unsigned short ACTORID;
|
2023-11-22 23:39:02 +08:00
|
|
|
typedef unsigned short VEHICLEID;
|
|
|
|
|
2024-01-05 23:26:32 +08:00
|
|
|
#include "system.h"
|
2023-10-25 00:01:33 +08:00
|
|
|
#include "console.h"
|
2023-10-30 00:27:01 +08:00
|
|
|
#include "scrhttps.h"
|
|
|
|
#include "scrtimers.h"
|
|
|
|
#include "gamemodes.h"
|
|
|
|
#include "filterscripts.h"
|
2024-01-04 23:40:00 +08:00
|
|
|
#include "netrpc.h"
|
2024-04-11 22:47:05 +08:00
|
|
|
#include "player.h"
|
2023-10-30 00:27:01 +08:00
|
|
|
#include "playerpool.h"
|
|
|
|
#include "vehiclepool.h"
|
|
|
|
#include "pickuppool.h"
|
|
|
|
#include "objectpool.h"
|
|
|
|
#include "menupool.h"
|
|
|
|
#include "textdrawpool.h"
|
|
|
|
#include "labelpool.h"
|
|
|
|
#include "gangzonepool.h"
|
|
|
|
#include "actorpool.h"
|
2023-10-29 00:00:36 +08:00
|
|
|
#include "netgame.h"
|
|
|
|
#include "plugins.h"
|
2023-10-25 00:01:33 +08:00
|
|
|
|
2023-11-17 23:42:39 +08:00
|
|
|
// ---------
|
|
|
|
// EXTERNALS
|
|
|
|
// ---------
|
|
|
|
|
|
|
|
extern CConsole* pConsole;
|
2024-04-11 22:47:05 +08:00
|
|
|
extern CNetGame* pNetGame;
|
2023-11-17 23:42:39 +08:00
|
|
|
|
2024-04-12 22:20:30 +08:00
|
|
|
extern PLAYERID RconUser;
|
|
|
|
|
2023-11-17 23:42:39 +08:00
|
|
|
// -------------------
|
|
|
|
// FUNCTION PROTOTYPES
|
|
|
|
// -------------------
|
|
|
|
|
2023-10-20 08:31:31 +08:00
|
|
|
void logprintf(char* format, ...);
|
2023-11-17 23:23:17 +08:00
|
|
|
void flogprintf(char* format, ...);
|
2023-12-01 20:42:38 +08:00
|
|
|
void LoadLogFile();
|
2023-10-20 08:31:31 +08:00
|
|
|
|
2023-10-25 00:01:33 +08:00
|
|
|
#ifdef LINUX
|
|
|
|
char* strlwr(char* str);
|
|
|
|
#endif
|
|
|
|
|
2023-10-20 08:31:31 +08:00
|
|
|
#endif // SAMPSRV_MAIN_H
|