mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Based on MrSteyk's dedicated patch. Additional patches targets the disabling of the client.dll library and VGUI. The disabling of the client.dll library initialization caused several issues to be investigated still (currently loops fine in _Host_RunFrame()). but executing a map command currently makes it only load the mp_common VPK before getting stuck somewhere. Setting hoststate to a valid map with HS_NEW_GAME (manually) does something to the engine but does not force the server to load anything yet. Added enums and classes from r5dev project.
423 lines
13 KiB
C
423 lines
13 KiB
C
#pragma once
|
|
|
|
/* Enumerations */
|
|
enum class D3D11DeviceVTbl : short
|
|
{
|
|
// IUnknown
|
|
QueryInterface = 0,
|
|
AddRef = 1,
|
|
Release = 2,
|
|
|
|
// ID3D11Device
|
|
CreateBuffer = 3,
|
|
CreateTexture1D = 4,
|
|
CreateTexture2D = 5,
|
|
CreateTexture3D = 6,
|
|
CreateShaderResourceView = 7,
|
|
CreateUnorderedAccessView = 8,
|
|
CreateRenderTargetView = 9,
|
|
CreateDepthStencilView = 10,
|
|
CreateInputLayout = 11,
|
|
CreateVertexShader = 12,
|
|
CreateGeometryShader = 13,
|
|
CreateGeometryShaderWithStreamOutput = 14,
|
|
CreatePixelShader = 15,
|
|
CreateHullShader = 16,
|
|
CreateDomainShader = 17,
|
|
CreateComputeShader = 18,
|
|
CreateClassLinkage = 19,
|
|
CreateBlendState = 20,
|
|
CreateDepthStencilState = 21,
|
|
CreateRasterizerState = 22,
|
|
CreateSamplerState = 23,
|
|
CreateQuery = 24,
|
|
CreatePredicate = 25,
|
|
CreateCounter = 26,
|
|
CreateDeferredContext = 27,
|
|
OpenSharedResource = 28,
|
|
CheckFormatSupport = 29,
|
|
CheckMultisampleQualityLevels = 30,
|
|
CheckCounterInfo = 31,
|
|
CheckCounter = 32,
|
|
CheckFeatureSupport = 33,
|
|
GetPrivateData = 34,
|
|
SetPrivateData = 35,
|
|
SetPrivateDataInterface = 36,
|
|
GetFeatureLevel = 37,
|
|
GetCreationFlags = 38,
|
|
GetDeviceRemovedReason = 39,
|
|
GetImmediateContext = 40,
|
|
SetExceptionMode = 41,
|
|
GetExceptionMode = 42,
|
|
};
|
|
|
|
enum class DXGISwapChainVTbl : short
|
|
{
|
|
// IUnknown
|
|
QueryInterface = 0,
|
|
AddRef = 1,
|
|
Release = 2,
|
|
|
|
// IDXGIObject
|
|
SetPrivateData = 3,
|
|
SetPrivateDataInterface = 4,
|
|
GetPrivateData = 5,
|
|
GetParent = 6,
|
|
|
|
// IDXGIDeviceSubObject
|
|
GetDevice = 7,
|
|
|
|
// IDXGISwapChain
|
|
Present = 8,
|
|
GetBuffer = 9,
|
|
SetFullscreenState = 10,
|
|
GetFullscreenState = 11,
|
|
GetDesc = 12,
|
|
ResizeBuffers = 13,
|
|
ResizeTarget = 14,
|
|
GetContainingOutput = 15,
|
|
GetFrameStatistics = 16,
|
|
GetLastPresentCount = 17,
|
|
};
|
|
|
|
#define MAX_SPLITSCREEN_CLIENT_BITS 2
|
|
#define MAX_SPLITSCREEN_CLIENTS ( 1 << MAX_SPLITSCREEN_CLIENT_BITS ) // 4
|
|
|
|
enum
|
|
{
|
|
MAX_JOYSTICKS = MAX_SPLITSCREEN_CLIENTS,
|
|
MOUSE_BUTTON_COUNT = 5,
|
|
};
|
|
|
|
enum JoystickAxis_t
|
|
{
|
|
JOY_AXIS_X = 0,
|
|
JOY_AXIS_Y,
|
|
JOY_AXIS_Z,
|
|
JOY_AXIS_R,
|
|
JOY_AXIS_U,
|
|
JOY_AXIS_V,
|
|
MAX_JOYSTICK_AXES,
|
|
};
|
|
|
|
enum
|
|
{
|
|
JOYSTICK_MAX_BUTTON_COUNT = 32,
|
|
JOYSTICK_POV_BUTTON_COUNT = 4,
|
|
JOYSTICK_AXIS_BUTTON_COUNT = MAX_JOYSTICK_AXES * 2,
|
|
};
|
|
|
|
#define JOYSTICK_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_BUTTON + ((_joystick) * JOYSTICK_MAX_BUTTON_COUNT) + (_button) )
|
|
#define JOYSTICK_POV_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_POV_BUTTON + ((_joystick) * JOYSTICK_POV_BUTTON_COUNT) + (_button) )
|
|
#define JOYSTICK_AXIS_BUTTON_INTERNAL( _joystick, _button ) ( JOYSTICK_FIRST_AXIS_BUTTON + ((_joystick) * JOYSTICK_AXIS_BUTTON_COUNT) + (_button) )
|
|
|
|
#define JOYSTICK_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_BUTTON_INTERNAL( _joystick, _button ) )
|
|
#define JOYSTICK_POV_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_POV_BUTTON_INTERNAL( _joystick, _button ) )
|
|
#define JOYSTICK_AXIS_BUTTON( _joystick, _button ) ( (ButtonCode_t)JOYSTICK_AXIS_BUTTON_INTERNAL( _joystick, _button ) )
|
|
|
|
enum ButtonCode_t
|
|
{
|
|
BUTTON_CODE_INVALID = -1,
|
|
BUTTON_CODE_NONE = 0,
|
|
|
|
KEY_FIRST = 0,
|
|
|
|
KEY_NONE = KEY_FIRST,
|
|
KEY_0,
|
|
KEY_1,
|
|
KEY_2,
|
|
KEY_3,
|
|
KEY_4,
|
|
KEY_5,
|
|
KEY_6,
|
|
KEY_7,
|
|
KEY_8,
|
|
KEY_9,
|
|
KEY_A,
|
|
KEY_B,
|
|
KEY_C,
|
|
KEY_D,
|
|
KEY_E,
|
|
KEY_F,
|
|
KEY_G,
|
|
KEY_H,
|
|
KEY_I,
|
|
KEY_J,
|
|
KEY_K,
|
|
KEY_L,
|
|
KEY_M,
|
|
KEY_N,
|
|
KEY_O,
|
|
KEY_P,
|
|
KEY_Q,
|
|
KEY_R,
|
|
KEY_S,
|
|
KEY_T,
|
|
KEY_U,
|
|
KEY_V,
|
|
KEY_W,
|
|
KEY_X,
|
|
KEY_Y,
|
|
KEY_Z,
|
|
KEY_PAD_0,
|
|
KEY_PAD_1,
|
|
KEY_PAD_2,
|
|
KEY_PAD_3,
|
|
KEY_PA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OCKTOGGLE,
|
|
KEY_COUNT = KEY_LAST - KEY_FIRST + 1,
|
|
|
|
// Mouse
|
|
MOUSE_FIRST = KEY_LAST + 1,
|
|
|
|
MOUSE_LEFT = MOUSE_FIRST,
|
|
MOUSE_RIGHT,
|
|
MOUSE_MIDDLE,
|
|
MOUSE_4,
|
|
MOUSE_5,
|
|
MOUSE_WHEEL_UP, // A fake button which is 'pressed' and 'released' when the wheel is moved up
|
|
MOUSE_WHEEL_DOWN, // A fake button which is 'pressed' and 'released' when the wheel is moved down
|
|
|
|
MOUSE_LAST = MOUSE_WHEEL_DOWN,
|
|
MOUSE_COUNT = MOUSE_LAST - MOUSE_FIRST + 1,
|
|
|
|
// Joystick
|
|
JOYSTICK_FIRST = MOUSE_LAST + 1,
|
|
|
|
JOYSTICK_FIRST_BUTTON = JOYSTICK_FIRST,
|
|
JOYSTICK_LAST_BUTTON = JOYSTICK_BUTTON_INTERNAL(MAX_JOYSTICKS - 1, JOYSTICK_MAX_BUTTON_COUNT - 1),
|
|
JOYSTICK_FIRST_POV_BUTTON,
|
|
JOYSTICK_LAST_POV_BUTTON = JOYSTICK_POV_BUTTON_INTERNAL(MAX_JOYSTICKS - 1, JOYSTICK_POV_BUTTON_COUNT - 1),
|
|
JOYSTICK_FIRST_AXIS_BUTTON,
|
|
JOYSTICK_LAST_AXIS_BUTTON = JOYSTICK_AXIS_BUTTON_INTERNAL(MAX_JOYSTICKS - 1, JOYSTICK_AXIS_BUTTON_COUNT - 1),
|
|
|
|
JOYSTICK_LAST = JOYSTICK_LAST_AXIS_BUTTON,
|
|
|
|
BUTTON_CODE_LAST,
|
|
BUTTON_CODE_COUNT = BUTTON_CODE_LAST - KEY_FIRST + 1,
|
|
|
|
// Helpers for XBox 360
|
|
KEY_XBUTTON_UP = JOYSTICK_FIRST_POV_BUTTON, // POV buttons
|
|
KEY_XBUTTON_RIGHT,
|
|
KEY_XBUTTON_DOWN,
|
|
KEY_XBUTTON_LEFT,
|
|
|
|
KEY_XBUTTON_A = JOYSTICK_FIRST_BUTTON, // Buttons
|
|
KEY_XBUTTON_B,
|
|
KEY_XBUTTON_X,
|
|
KEY_XBUTTON_Y,
|
|
KEY_XBUTTON_LEFT_SHOULDER,
|
|
KEY_XBUTTON_RIGHT_SHOULDER,
|
|
KEY_XBUTTON_BACK,
|
|
KEY_XBUTTON_START,
|
|
KEY_XBUTTON_STICK1,
|
|
KEY_XBUTTON_STICK2,
|
|
KEY_XBUTTON_INACTIVE_START,
|
|
|
|
KEY_XSTICK1_RIGHT = JOYSTICK_FIRST_AXIS_BUTTON, // XAXIS POSITIVE
|
|
KEY_XSTICK1_LEFT, // XAXIS NEGATIVE
|
|
KEY_XSTICK1_DOWN, // YAXIS POSITIVE
|
|
KEY_XSTICK1_UP, // YAXIS NEGATIVE
|
|
KEY_XBUTTON_LTRIGGER, // ZAXIS POSITIVE
|
|
KEY_XBUTTON_RTRIGGER, // ZAXIS NEGATIVE
|
|
KEY_XSTICK2_RIGHT, // UAXIS POSITIVE
|
|
KEY_XSTICK2_LEFT, // UAXIS NEGATIVE
|
|
KEY_XSTICK2_DOWN, // VAXIS POSITIVE
|
|
KEY_XSTICK2_UP, // VAXIS NEGATIVE
|
|
};
|
|
|
|
// Buttons are not confirmed to be the same. They have been always the same throughout the source engine. Lets hope they did not change them.
|
|
|
|
enum KeyValuesTypes
|
|
{
|
|
TYPE_NONE = 0x0,
|
|
TYPE_STRING = 0x1,
|
|
TYPE_INT = 0x2,
|
|
TYPE_FLOAT = 0x3,
|
|
TYPE_PTR = 0x4,
|
|
TYPE_WSTRING = 0x5,
|
|
TYPE_COLOR = 0x6,
|
|
TYPE_UINT64 = 0x7,
|
|
TYPE_COMPILED_INT_BYTE = 0x8,
|
|
TYPE_COMPILED_INT_0 = 0x9,
|
|
TYPE_COMPILED_INT_1 = 0xA,
|
|
TYPE_NUMTYPES = 0xB,
|
|
};
|
|
|
|
enum ClientFrameStage_t
|
|
{
|
|
FRAME_UNDEFINED = -1, // (haven't run any frames yet)
|
|
FRAME_START,
|
|
|
|
// A network packet is being recieved
|
|
FRAME_NET_UPDATE_START,
|
|
// Data has been received and we're going to start calling PostDataUpdate
|
|
FRAME_NET_UPDATE_POSTDATAUPDATE_START,
|
|
// Data has been received and we've called PostDataUpdate on all data recipients
|
|
FRAME_NET_UPDATE_POSTDATAUPDATE_END,
|
|
// We've received all packets, we can now do interpolation, prediction, etc..
|
|
FRAME_NET_UPDATE_END,
|
|
|
|
// We're about to start rendering the scene
|
|
FRAME_RENDER_START,
|
|
// We've finished rendering the scene.
|
|
FRAME_RENDER_END,
|
|
|
|
FRAME_NET_FULL_FRAME_UPDATE_ON_REMOVE
|
|
};
|
|
|
|
enum HostStates_t
|
|
{
|
|
HS_NEW_GAME = 0x0,
|
|
HS_LOAD_GAME = 0x1,
|
|
HS_CHANGE_LEVEL_SP = 0x2,
|
|
HS_CHANGE_LEVEL_MP = 0x3,
|
|
HS_RUN = 0x4,
|
|
HS_GAME_SHUTDOWN = 0x5,
|
|
HS_SHUTDOWN = 0x6,
|
|
HS_RESTART = 0x7,
|
|
};
|
|
|
|
enum SIGNONSTATE
|
|
{
|
|
SIGNONSTATE_NONE = 0, // no state yet; about to connect
|
|
SIGNONSTATE_CHALLENGE = 1, // client challenging server; all OOB packets
|
|
SIGNONSTATE_CONNECTED = 2, // client is connected to server; netchans ready
|
|
SIGNONSTATE_NEW = 3, // just got serverinfo and string tables
|
|
SIGNONSTATE_PRESPAWN = 4, // received signon buffers
|
|
SIGNONSTATE_GETTING_DATA = 5, // getting persistence data I assume?
|
|
SIGNONSTATE_SPAWN = 6, // ready to receive entity packets
|
|
SIGNONSTATE_FIRST_SNAP = 7, // ???
|
|
SIGNONSTATE_FULL = 8, // we are fully connected; first non-delta packet received
|
|
SIGNONSTATE_CHANGELEVEL = 9, // server is changing level; please wait
|
|
};
|
|
|
|
enum FileWarningLevel_t
|
|
{
|
|
FILESYSTEM_WARNING = -1,
|
|
FILESYSTEM_WARNING_QUIET = 0,
|
|
FILESYSTEM_WARNING_REPORTUNCLOSED,
|
|
FILESYSTEM_WARNING_REPORTUSAGE,
|
|
FILESYSTEM_WARNING_REPORTALLACCESSES,
|
|
FILESYSTEM_WARNING_REPORTALLACCESSES_READ,
|
|
FILESYSTEM_WARNING_REPORTALLACCESSES_READWRITE,
|
|
FILESYSTEM_WARNING_REPORTALLACCESSES_ASYNC
|
|
};
|
|
|
|
#define FCVAR_NONE 0
|
|
|
|
// Command to ConVars and ConCommands
|
|
// ConVar Systems
|
|
#define FCVAR_UNREGISTERED (1<<0) // If this is set, don't add to linked list, etc.
|
|
#define FCVAR_DEVELOPMENTONLY (1<<1) // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
|
|
#define FCVAR_GAMEDLL (1<<2) // defined by the game DLL
|
|
#define FCVAR_CLIENTDLL (1<<3) // defined by the client DLL
|
|
#define FCVAR_HIDDEN (1<<4) // Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out.
|
|
|
|
// ConVar only
|
|
#define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
|
|
#define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server.
|
|
#define FCVAR_ARCHIVE (1<<7) // set to cause it to be saved to vars.rc
|
|
#define FCVAR_NOTIFY (1<<8) // notifies players when changed
|
|
#define FCVAR_USERINFO (1<<9) // changes the client's info string
|
|
|
|
#define FCVAR_PRINTABLEONLY (1<<10) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
|
|
|
|
#define FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS (1<<10) // When on concommands this allows remote clients to execute this cmd on the server.
|
|
// We are changing the default behavior of concommands to disallow execution by remote clients without
|
|
// this flag due to the number existing concommands that can lag or crash the server when clients abuse them.
|
|
|
|
#define FCVAR_UNLOGGED (1<<11) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
|
|
#define FCVAR_NEVER_AS_STRING (1<<12) // never try to print that cvar
|
|
|
|
// It's a ConVar that's shared between the client and the server.
|
|
// At signon, the values of all such ConVars are sent from the server to the client (skipped for local
|
|
// client, of course )
|
|
// If a change is requested it must come from the console (i.e., no remote client changes)
|
|
// If a value is changed while a server is active, it's replicated to all connected clients
|
|
#define FCVAR_REPLICATED (1<<13) // server setting enforced on clients, TODO rename to FCAR_SERVER at some time
|
|
#define FCVAR_CHEAT (1<<14) // Only useable in singleplayer / debug / multiplayer & sv_cheats
|
|
#define FCVAR_SS (1<<15) // causes varnameN where N == 2 through max splitscreen slots for mod to be autogenerated
|
|
#define FCVAR_DEMO (1<<16) // record this cvar when starting a demo file
|
|
#define FCVAR_DONTRECORD (1<<17) // don't record these command in demofiles
|
|
#define FCVAR_SS_ADDED (1<<18) // This is one of the "added" FCVAR_SS variables for the splitscreen players
|
|
#define FCVAR_RELEASE (1<<19) // Cvars tagged with this are the only cvars avaliable to customers
|
|
#define FCVAR_RELOAD_MATERIALS (1<<20) // If this cvar changes, it forces a material reload
|
|
#define FCVAR_RELOAD_TEXTURES (1<<21) // If this cvar changes, if forces a texture reload
|
|
|
|
#define FCVAR_NOT_CONNECTED (1<<22) // cvar cannot be changed by a client that is connected to a server
|
|
#define FCVAR_MATERIAL_SYSTEM_THREAD (1<<23) // Indicates this cvar is read from the material system thread
|
|
#define FCVAR_ARCHIVE_GAMECONSOLE (1<<24) // cvar written to config.cfg on the Xbox
|
|
|
|
#define FCVAR_SERVER_CAN_EXECUTE (1<<28)// the server is allowed to execute this command on clients via ClientCommand/NET_StringCmd/CBaseClientState::ProcessStringCmd.
|
|
#define FCVAR_SERVER_CANNOT_QUERY (1<<29)// If this is set, then the server is not allowed to query this cvar's value (via IServerPluginHelpers::StartQueryCvarValue).
|
|
#define FCVAR_CLIENTCMD_CAN_EXECUTE (1<<30) // IVEngineClient::ClientCmd is allowed to execute this command.
|
|
|
|
#define MAX_PLAYERS 128 // Max R5 players.
|