├── Builded - Injector ├── RobinLoader.ini ├── RobinBot.dll └── RobinLoader.exe ├── RobinBot ├── Client.cpp ├── detours.lib ├── RobinBot.v11.suo ├── SvcMessage.cpp ├── ValveSDK │ ├── misc │ │ ├── com_model.h │ │ ├── parsemsg.h │ │ └── parsemsg.cpp │ ├── common │ │ ├── itrackeruser.h │ │ ├── ivoicetweak.h │ │ ├── nowin.h │ │ ├── dll_state.h │ │ ├── screenfade.h │ │ ├── studio_event.h │ │ ├── entity_types.h │ │ ├── demo_api.h │ │ ├── dlight.h │ │ ├── con_nprint.h │ │ ├── netadr.h │ │ ├── qfont.h │ │ ├── exefuncs.h │ │ ├── event_args.h │ │ ├── in_buttons.h │ │ ├── weaponinfo.h │ │ ├── usercmd.h │ │ ├── pmtrace.h │ │ ├── director_cmds.h │ │ ├── particledef.h │ │ ├── hltv.h │ │ ├── cvardef.h │ │ ├── event_flags.h │ │ ├── crc.h │ │ ├── beamdef.h │ │ ├── triangleapi.h │ │ ├── ref_params.h │ │ ├── event_api.h │ │ ├── net_api.h │ │ ├── cl_entity.h │ │ ├── interface.cpp │ │ ├── engine_launcher_api.h │ │ ├── mathlib.h │ │ ├── interface.h │ │ ├── entity_state.h │ │ └── com_model.h │ └── engine │ │ ├── wrect.h │ │ ├── edict.h │ │ ├── pm_info.h │ │ ├── studio_event.h │ │ ├── entity_types.h │ │ ├── dlight.h │ │ ├── customentity.h │ │ ├── event_args.h │ │ ├── in_buttons.h │ │ ├── cl_dll.h │ │ ├── cdll_dll.h │ │ ├── cdll_engine_dll.h │ │ ├── weaponinfo.h │ │ ├── usercmd.h │ │ ├── pmtrace.h │ │ ├── particledef.h │ │ ├── cvardef.h │ │ ├── event_flags.h │ │ ├── triangleapi.h │ │ ├── beamdef.h │ │ ├── crc.h │ │ ├── shake.h │ │ ├── progs.h │ │ ├── keydefs.h │ │ ├── cl_entity.h │ │ ├── custom.h │ │ ├── r_studioint.h │ │ ├── entity_state.h │ │ ├── util_vector.h │ │ ├── progdefs.h │ │ ├── anorms.h │ │ ├── pm_defs.h │ │ └── studio.h ├── RobinBot.vcxproj.user ├── ModuleSecurity.h ├── Command.h ├── stringfinder.h ├── cvar.h ├── drawing.h ├── SetupHooks.h ├── Command.cpp ├── Client.h ├── SvcMessage.h ├── usermsg.cpp ├── stringfinder.cpp ├── AutoOffset.h ├── Main.cpp ├── interpreter.h ├── drawing.cpp ├── SetupHooks.cpp ├── cvar.cpp ├── players.h ├── interpreter.cpp └── players.cpp └── README.md /Builded - Injector/RobinLoader.ini: -------------------------------------------------------------------------------- 1 | [Injecting] 2 | EXE_NAME=hl.exe 3 | DLL_NAME=RobinBot.dll -------------------------------------------------------------------------------- /RobinBot/Client.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/RobinBot/Client.cpp -------------------------------------------------------------------------------- /RobinBot/detours.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/RobinBot/detours.lib -------------------------------------------------------------------------------- /RobinBot/RobinBot.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/RobinBot/RobinBot.v11.suo -------------------------------------------------------------------------------- /RobinBot/SvcMessage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/RobinBot/SvcMessage.cpp -------------------------------------------------------------------------------- /Builded - Injector/RobinBot.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/Builded - Injector/RobinBot.dll -------------------------------------------------------------------------------- /Builded - Injector/RobinLoader.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/Builded - Injector/RobinLoader.exe -------------------------------------------------------------------------------- /RobinBot/ValveSDK/misc/com_model.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/RobinBot/ValveSDK/misc/com_model.h -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/itrackeruser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/RobinBot/ValveSDK/common/itrackeruser.h -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/ivoicetweak.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xsiravia/RobinBot/HEAD/RobinBot/ValveSDK/common/ivoicetweak.h -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/nowin.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef INC_NOWIN_H 3 | #define INC_NOWIN_H 4 | #ifndef _WIN32 5 | 6 | #include 7 | 8 | #endif //!_WIN32 9 | #endif //INC_NOWIN_H -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/wrect.h: -------------------------------------------------------------------------------- 1 | #if !defined( WRECTH ) 2 | #define WRECTH 3 | 4 | typedef struct rect_s 5 | { 6 | int left, right, top, bottom; 7 | } wrect_t; 8 | 9 | #endif -------------------------------------------------------------------------------- /RobinBot/RobinBot.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /RobinBot/ModuleSecurity.h: -------------------------------------------------------------------------------- 1 | #ifndef __MOD_SEC_H__ 2 | #define __MOD_SEC_H__ 3 | 4 | void HideModuleFromPEB(HINSTANCE hInstance); 5 | void RemovePeHeader(DWORD ModuleBase); 6 | void HideModule( HANDLE hModule ); 7 | void HideModuleXta( HINSTANCE hModule ); 8 | bool DestroyModuleHeader(HMODULE hModule); 9 | 10 | #endif -------------------------------------------------------------------------------- /RobinBot/Command.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | typedef struct cmd_s 6 | { 7 | struct cmd_s *pNext; 8 | PCHAR pszName; 9 | DWORD pfnFunc; 10 | BYTE bCrap[20]; 11 | } cmd_t, *pcmd_t; 12 | 13 | class Command 14 | { 15 | public: 16 | pcmd_t CommandByName(char* szName); 17 | void EnDsCommand(pcmd_t cmd,bool enabled); 18 | }; -------------------------------------------------------------------------------- /RobinBot/stringfinder.h: -------------------------------------------------------------------------------- 1 | #ifndef STRINGFINDER_H 2 | #define STRINGFINDER_H 3 | 4 | class StringFinder 5 | { 6 | public: 7 | void clear(); 8 | void add(const char* the_string, int the_number); 9 | void erase( const char* str ); 10 | bool find(const char* str); 11 | int num; 12 | const char* str; 13 | void it_start (); 14 | bool it_running(); 15 | void it_next (); 16 | private: 17 | void* data; 18 | public: 19 | StringFinder(); 20 | ~StringFinder(); 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/dll_state.h: -------------------------------------------------------------------------------- 1 | //DLL State Flags 2 | 3 | #define DLL_INACTIVE 0 // no dll 4 | #define DLL_ACTIVE 1 // dll is running 5 | #define DLL_PAUSED 2 // dll is paused 6 | #define DLL_CLOSE 3 // closing down dll 7 | #define DLL_TRANS 4 // Level Transition 8 | 9 | // DLL Pause reasons 10 | 11 | #define DLL_NORMAL 0 // User hit Esc or something. 12 | #define DLL_QUIT 4 // Quit now 13 | 14 | // DLL Substate info ( not relevant ) 15 | #define ENG_NORMAL (1<<0) 16 | -------------------------------------------------------------------------------- /RobinBot/cvar.h: -------------------------------------------------------------------------------- 1 | #ifndef CVAR_H 2 | #define CVAR_H 3 | 4 | class CVARlist 5 | { 6 | public: 7 | void init(); 8 | public: 9 | int aim_active; 10 | int aim_target; 11 | float aim_height; 12 | int aim_autowall; 13 | int aim_fov; 14 | int aim_distancebasedfov; 15 | int aim_avdraw; 16 | int aim_prediction; 17 | int aim_time; 18 | int aim_delay; 19 | int aim_smoothness; 20 | int bhop; 21 | //int esp_barel; 22 | int aim_triggerbot; 23 | int aim_triggerbot_fov; 24 | }; 25 | 26 | extern CVARlist cvar; 27 | 28 | #endif -------------------------------------------------------------------------------- /RobinBot/drawing.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CDrawing 6 | { 7 | public: 8 | void FillArea( int x, int y, int w, int h, int r, int g, int b, int a ); 9 | void DrawBox( int x, int y, int w, int h, int linewidth, int r, int g, int b, int a ); 10 | int iStringLen( const char *fmt, ... ); 11 | int iStringHeight( void ); 12 | void DrawString( int x, int y, int r, int g, int b, const char *fmt, ... ); 13 | void DrawStringCenter( int x, int y, int r, int g, int b, const char *fmt, ... ); 14 | }; 15 | 16 | extern CDrawing g_Drawing; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RobinBot 2 | Counter-Strike 1.6 Hack Source 3 | -------------------------------- 4 | Author: Seukaiwokeo & HLRTeam
5 | Created: HLRTeam
6 | Updated: Seukaiwokeo & 10.12.2017
7 | Extras: RobinLoader [DLL Injector] by Seukaiwokeo
8 | Version 1: Trigger Bot, ESP Box (HLRTeam)
9 | Version 2: Aimbot, Trigger Bot, ESP Box, Name ESP, No Recoil, Menu (Seukaiwokeo)
10 | Special Thanks to: HLRTeam for ValveSDK & Source Base
11 | Category: Game Hacking
12 | Description: Counter-Strike - Engine SDK Hack
13 | ![alt text](https://i.hizliresim.com/bLWVWZ.png) 14 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/screenfade.h: -------------------------------------------------------------------------------- 1 | #if !defined( SCREENFADEH ) 2 | #define SCREENFADEH 3 | #ifdef _WIN32 4 | #pragma once 5 | #endif 6 | 7 | typedef struct screenfade_s 8 | { 9 | float fadeSpeed; // How fast to fade (tics / second) (+ fade in, - fade out) 10 | float fadeEnd; // When the fading hits maximum 11 | float fadeTotalEnd; // Total End Time of the fade (used for FFADE_OUT) 12 | float fadeReset; // When to reset to not fading (for fadeout and hold) 13 | byte fader, fadeg, fadeb, fadealpha; // Fade color 14 | int fadeFlags; // Fading flags 15 | } screenfade_t; 16 | 17 | #endif // !SCREENFADEH 18 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/edict.h: -------------------------------------------------------------------------------- 1 | #if !defined EDICT_H 2 | #define EDICT_H 3 | #ifdef _WIN32 4 | #pragma once 5 | #endif 6 | #define MAX_ENT_LEAFS 48 7 | 8 | #include "progdefs.h" 9 | 10 | struct edict_s 11 | { 12 | qboolean free; 13 | int serialnumber; 14 | link_t area; // linked to a division node or leaf 15 | 16 | int headnode; // -1 to use normal leaf check 17 | int num_leafs; 18 | short leafnums[MAX_ENT_LEAFS]; 19 | 20 | float freetime; // sv.time when the object was freed 21 | 22 | void* pvPrivateData; // Alloced and freed by engine, used by DLLs 23 | 24 | entvars_t v; // C exported fields from progs 25 | 26 | // other fields from progs come immediately after 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/pm_info.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // Physics info string definition 16 | #if !defined( PM_INFOH ) 17 | #define PM_INFOH 18 | #pragma once 19 | 20 | #define MAX_PHYSINFO_STRING 256 21 | 22 | #endif // PM_INFOH -------------------------------------------------------------------------------- /RobinBot/SetupHooks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Main.h" 4 | #include "AutoOffset.h" 5 | 6 | class SetupHooks; 7 | typedef DWORD (SetupHooks::*LPTHREAD_METHOD)(LPVOID pParam); 8 | 9 | typedef struct STARTUP_PARAM 10 | { 11 | SetupHooks* pClass; 12 | LPTHREAD_METHOD pMethod; 13 | LPVOID pParam; 14 | } *LPSTARTUP_PARAM; 15 | 16 | class SetupHooks 17 | { 18 | private: 19 | static int AddCommand (char *cmd_name,void (*function)(void)); 20 | static cvar_t* RegisterVariable (char *szName,char *szValue,int flags); 21 | public: 22 | DWORD Initialize(LPVOID pParam); 23 | static DWORD StartFunc (LPSTARTUP_PARAM pStartup); 24 | void StartThread (LPTHREAD_METHOD pMethod, LPVOID pParam,LPDWORD pdwThreadID = NULL, 25 | LPSECURITY_ATTRIBUTES pSecurity = NULL, 26 | DWORD dwStackSize = NULL, 27 | DWORD dwFlags = 0); 28 | }; -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/studio_event.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( STUDIO_EVENTH ) 16 | #define STUDIO_EVENTH 17 | #pragma once 18 | 19 | typedef struct mstudioevent_s 20 | { 21 | int frame; 22 | int event; 23 | int type; 24 | char options[64]; 25 | } mstudioevent_t; 26 | 27 | #endif // STUDIO_EVENTH -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/studio_event.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( STUDIO_EVENTH ) 16 | #define STUDIO_EVENTH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct mstudioevent_s 22 | { 23 | int frame; 24 | int event; 25 | int type; 26 | char options[64]; 27 | } mstudioevent_t; 28 | 29 | #endif // STUDIO_EVENTH 30 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/entity_types.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // entity_types.h 16 | #if !defined( ENTITY_TYPESH ) 17 | #define ENTITY_TYPESH 18 | 19 | #define ET_NORMAL 0 20 | #define ET_PLAYER 1 21 | #define ET_TEMPENTITY 2 22 | #define ET_BEAM 3 23 | // BMODEL or SPRITE that was split across BSP nodes 24 | #define ET_FRAGMENTED 4 25 | 26 | #endif // !ENTITY_TYPESH -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/entity_types.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // entity_types.h 16 | #if !defined( ENTITY_TYPESH ) 17 | #define ENTITY_TYPESH 18 | 19 | #define ET_NORMAL 0 20 | #define ET_PLAYER 1 21 | #define ET_TEMPENTITY 2 22 | #define ET_BEAM 3 23 | // BMODEL or SPRITE that was split across BSP nodes 24 | #define ET_FRAGMENTED 4 25 | 26 | #endif // !ENTITY_TYPESH 27 | -------------------------------------------------------------------------------- /RobinBot/Command.cpp: -------------------------------------------------------------------------------- 1 | #include "Command.h" 2 | #include "Main.h" 3 | 4 | pcmd_t Command::CommandByName(char* szName) 5 | { 6 | pcmd_t pCmd = g_Engine.pfnGetCmdList(); 7 | while( pCmd ) 8 | { 9 | if( !strcmp( pCmd->pszName, szName) ) 10 | return pCmd; 11 | pCmd = pCmd->pNext; 12 | } 13 | return 0; 14 | } 15 | 16 | void Command::EnDsCommand(pcmd_t cmd,bool enabled) 17 | { 18 | DWORD OldProtect; 19 | static BYTE OLD[4] = { 0x00,0x00,0x00,0x00 }; 20 | BYTE nops[4] = { 0xC3,0x90,0x90,0x90 }; 21 | VirtualProtect((DWORD*)cmd->pfnFunc,sizeof(OLD),PAGE_EXECUTE_READWRITE,&OldProtect); // steam fix 22 | if ( enabled == true && OLD[0] != 0x00 ) 23 | { 24 | *(DWORD*)(DWORD*)cmd->pfnFunc = *(DWORD*)OLD; 25 | memset(&OLD,0,sizeof(OLD)); 26 | } 27 | else if ( enabled == false ) 28 | { 29 | if ( OLD[0] == 0x00 ) 30 | { 31 | *(DWORD*)OLD = *(DWORD*)(DWORD*)cmd->pfnFunc; 32 | *(DWORD*)(DWORD*)cmd->pfnFunc = *(DWORD*)nops; 33 | } 34 | } 35 | } 36 | 37 | extern Command* pCmd; -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/demo_api.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( DEMO_APIH ) 16 | #define DEMO_APIH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct demo_api_s 22 | { 23 | int ( *IsRecording ) ( void ); 24 | int ( *IsPlayingback ) ( void ); 25 | int ( *IsTimeDemo ) ( void ); 26 | void ( *WriteBuffer ) ( int size, unsigned char *buffer ); 27 | } demo_api_t; 28 | 29 | extern demo_api_t demoapi; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/dlight.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( DLIGHTH ) 16 | #define DLIGHTH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct 22 | { 23 | vec3_t origin; 24 | float radius; 25 | color24 color; 26 | float die; // stop lighting after this time 27 | float decay; // drop this each second 28 | float minlight; // don't add when contributing less 29 | int key; 30 | qboolean dark; // subtracts light instead of adding 31 | } dlight_t; 32 | 33 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/dlight.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( DLIGHTH ) 16 | #define DLIGHTH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct 22 | { 23 | vec3_t origin; 24 | float radius; 25 | color24 color; 26 | float die; // stop lighting after this time 27 | float decay; // drop this each second 28 | float minlight; // don't add when contributing less 29 | int key; 30 | qboolean dark; // subtracts light instead of adding 31 | } dlight_t; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/con_nprint.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( CON_NPRINTH ) 16 | #define CON_NPRINTH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct con_nprint_s 22 | { 23 | int index; // Row # 24 | float time_to_live; // # of seconds before it dissappears 25 | float color[ 3 ]; // RGB colors ( 0.0 -> 1.0 scale ) 26 | } con_nprint_t; 27 | 28 | void Con_NPrintf( int idx, char *fmt, ... ); 29 | void Con_NXPrintf( struct con_nprint_s *info, char *fmt, ... ); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/netadr.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // netadr.h 16 | #ifndef NETADR_H 17 | #define NETADR_H 18 | #ifdef _WIN32 19 | #pragma once 20 | #endif 21 | 22 | typedef enum 23 | { 24 | NA_UNUSED, 25 | NA_LOOPBACK, 26 | NA_BROADCAST, 27 | NA_IP, 28 | NA_IPX, 29 | NA_BROADCAST_IPX, 30 | } netadrtype_t; 31 | 32 | typedef struct netadr_s 33 | { 34 | netadrtype_t type; 35 | unsigned char ip[4]; 36 | unsigned char ipx[10]; 37 | unsigned short port; 38 | } netadr_t; 39 | 40 | #endif // NETADR_H 41 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/misc/parsemsg.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // 16 | // parsemsg.h 17 | // 18 | 19 | #define ASSERT( x ) 20 | 21 | void BEGIN_READ( void *buf, int size ); 22 | int READ_CHAR( void ); 23 | int READ_BYTE( void ); 24 | int READ_SHORT( void ); 25 | int READ_WORD( void ); 26 | int READ_LONG( void ); 27 | float READ_FLOAT( void ); 28 | char* READ_STRING( void ); 29 | float READ_COORD( void ); 30 | float READ_ANGLE( void ); 31 | float READ_HIRESANGLE( void ); 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/qfont.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( QFONTH ) 16 | #define QFONTH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Font stuff 22 | 23 | #define NUM_GLYPHS 256 24 | 25 | typedef struct 26 | { 27 | short startoffset; 28 | short charwidth; 29 | } charinfo; 30 | 31 | typedef struct qfont_s 32 | { 33 | int width, height; 34 | int rowcount; 35 | int rowheight; 36 | charinfo fontinfo[ NUM_GLYPHS ]; 37 | byte data[4]; 38 | } qfont_t; 39 | 40 | #endif // qfont.h 41 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/customentity.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef CUSTOMENTITY_H 16 | #define CUSTOMENTITY_H 17 | 18 | // Custom Entities 19 | 20 | // Start/End Entity is encoded as 12 bits of entity index, and 4 bits of attachment (4:12) 21 | #define BEAMENT_ENTITY(x) ((x)&0xFFF) 22 | #define BEAMENT_ATTACHMENT(x) (((x)>>12)&0xF) 23 | 24 | // Beam types, encoded as a byte 25 | enum 26 | { 27 | BEAM_POINTS = 0, 28 | BEAM_ENTPOINT, 29 | BEAM_ENTS, 30 | BEAM_HOSE, 31 | }; 32 | 33 | #define BEAM_FSINE 0x10 34 | #define BEAM_FSOLID 0x20 35 | #define BEAM_FSHADEIN 0x40 36 | #define BEAM_FSHADEOUT 0x80 37 | 38 | #endif //CUSTOMENTITY_H 39 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/exefuncs.h: -------------------------------------------------------------------------------- 1 | // exefuncs.h 2 | #ifndef EXEFUNCS_H 3 | #define EXEFUNCS_H 4 | 5 | // Engine hands this to DLLs for functionality callbacks 6 | typedef struct exefuncs_s 7 | { 8 | int fMMX; 9 | int iCPUMhz; 10 | void (*unused1)(void); 11 | void (*unused2)(void); 12 | void (*unused3)(void); 13 | void (*unused4)(void); 14 | void (*VID_ForceLockState)(int lk); 15 | int (*VID_ForceUnlockedAndReturnState)(void); 16 | void (*unused5)(void); 17 | void (*unused6)(void); 18 | void (*unused7)(void); 19 | void (*unused8)(void); 20 | void (*unused9)(void); 21 | void (*unused10)(void); 22 | void (*unused11)(void); 23 | void (*unused12)(void); 24 | void (*unused13)(void); 25 | void (*unused14)(void); 26 | void (*unused15)(void); 27 | void (*ErrorMessage)(int nLevel, const char *pszErrorMessage); 28 | void (*unused16)(void); 29 | void (*Sys_Printf)(char *fmt, ...); 30 | void (*unused17)(void); 31 | void (*unused18)(void); 32 | void (*unused19)(void); 33 | void (*unused20)(void); 34 | void (*unused21)(void); 35 | void (*unused22)(void); 36 | void (*unused23)(void); 37 | void (*unused24)(void); 38 | void (*unused25)(void); 39 | } exefuncs_t; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/event_args.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( EVENT_ARGSH ) 16 | #define EVENT_ARGSH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Event was invoked with stated origin 22 | #define FEVENT_ORIGIN ( 1<<0 ) 23 | 24 | // Event was invoked with stated angles 25 | #define FEVENT_ANGLES ( 1<<1 ) 26 | 27 | typedef struct event_args_s 28 | { 29 | int flags; 30 | 31 | // Transmitted 32 | int entindex; 33 | 34 | float origin[3]; 35 | float angles[3]; 36 | float velocity[3]; 37 | 38 | int ducking; 39 | 40 | float fparam1; 41 | float fparam2; 42 | 43 | int iparam1; 44 | int iparam2; 45 | 46 | int bparam1; 47 | int bparam2; 48 | } event_args_t; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/event_args.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( EVENT_ARGSH ) 16 | #define EVENT_ARGSH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Event was invoked with stated origin 22 | #define FEVENT_ORIGIN ( 1<<0 ) 23 | 24 | // Event was invoked with stated angles 25 | #define FEVENT_ANGLES ( 1<<1 ) 26 | 27 | typedef struct event_args_s 28 | { 29 | int flags; 30 | 31 | // Transmitted 32 | int entindex; 33 | 34 | float origin[3]; 35 | float angles[3]; 36 | float velocity[3]; 37 | 38 | int ducking; 39 | 40 | float fparam1; 41 | float fparam2; 42 | 43 | int iparam1; 44 | int iparam2; 45 | 46 | int bparam1; 47 | int bparam2; 48 | } event_args_t; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/in_buttons.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef IN_BUTTONS_H 16 | #define IN_BUTTONS_H 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | #define IN_ATTACK (1 << 0) 22 | #define IN_JUMP (1 << 1) 23 | #define IN_DUCK (1 << 2) 24 | #define IN_FORWARD (1 << 3) 25 | #define IN_BACK (1 << 4) 26 | #define IN_USE (1 << 5) 27 | #define IN_CANCEL (1 << 6) 28 | #define IN_LEFT (1 << 7) 29 | #define IN_RIGHT (1 << 8) 30 | #define IN_MOVELEFT (1 << 9) 31 | #define IN_MOVERIGHT (1 << 10) 32 | #define IN_ATTACK2 (1 << 11) 33 | #define IN_RUN (1 << 12) 34 | #define IN_RELOAD (1 << 13) 35 | #define IN_ALT1 (1 << 14) 36 | #define IN_SCORE (1 << 15) // Used by client.dll for when scoreboard is held down 37 | 38 | #endif // IN_BUTTONS_H -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/in_buttons.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef IN_BUTTONS_H 16 | #define IN_BUTTONS_H 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | #define IN_ATTACK (1 << 0) 22 | #define IN_JUMP (1 << 1) 23 | #define IN_DUCK (1 << 2) 24 | #define IN_FORWARD (1 << 3) 25 | #define IN_BACK (1 << 4) 26 | #define IN_USE (1 << 5) 27 | #define IN_CANCEL (1 << 6) 28 | #define IN_LEFT (1 << 7) 29 | #define IN_RIGHT (1 << 8) 30 | #define IN_MOVELEFT (1 << 9) 31 | #define IN_MOVERIGHT (1 << 10) 32 | #define IN_ATTACK2 (1 << 11) 33 | #define IN_RUN (1 << 12) 34 | #define IN_RELOAD (1 << 13) 35 | #define IN_ALT1 (1 << 14) 36 | #define IN_SCORE (1 << 15) // Used by client.dll for when scoreboard is held down 37 | 38 | #endif // IN_BUTTONS_H 39 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/cl_dll.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // 16 | // cl_dll.h 17 | // 18 | 19 | // 4-23-98 JOHN 20 | 21 | // 22 | // This DLL is linked by the client when they first initialize. 23 | // This DLL is responsible for the following tasks: 24 | // - Loading the HUD graphics upon initialization 25 | // - Drawing the HUD graphics every frame 26 | // - Handling the custum HUD-update packets 27 | // 28 | typedef unsigned char byte; 29 | typedef unsigned short word; 30 | typedef float vec_t; 31 | typedef int (*pfnUserMsgHook)(const char *pszName, int iSize, void *pbuf); 32 | 33 | #include "util_vector.h" 34 | #define EXPORT _declspec( dllexport ) 35 | 36 | #include "../engine/cdll_int.h" 37 | #include "cdll_dll.h" 38 | 39 | extern cl_enginefunc_t gEngfuncs; 40 | -------------------------------------------------------------------------------- /RobinBot/Client.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef void (*PreS_DynamicSound_t)(int, DWORD, char *, float *, DWORD, DWORD, DWORD, DWORD); 4 | 5 | class Client 6 | { 7 | private: 8 | static void StudioEntityLight(struct alight_s *plight); 9 | static void InitHack(void); 10 | static bool IsInFOV(float *fScreen, float fFov); 11 | static void PredictEntity(cl_entity_s *pEntity, Vector *vOutput, unsigned int fAmount); 12 | static int HUD_Reset(void); 13 | static void HUD_Frame(double time); 14 | static void FarAim(); 15 | static void HackMenu(); 16 | static void HUD_Redraw(float time, int intermission); 17 | static void HUD_PlayerMove(struct playermove_s *ppmove, int server); 18 | static void SmoothAimAngles(Vector *vStart, Vector *vTarget, Vector *vOutput, float fSmoothness); 19 | static void Bhop(float frametime, struct usercmd_s *cmd); 20 | static void weaponSettings(); 21 | static int HUD_Key_Event(int down, int keynum, const char *pszCurrentBinding); 22 | static void CL_CreateMove(float frametime, struct usercmd_s *cmd, int active); 23 | public: 24 | static void PreS_DynamicSound(int entid, DWORD u, char *szSoundFile, float *fOrigin, DWORD dont, DWORD know, DWORD ja, DWORD ck); 25 | void HookEngine(void); 26 | void HookStudio(void); 27 | void HookClient(void); 28 | }; 29 | 30 | extern PreS_DynamicSound_t PreS_DynamicSound_s; -------------------------------------------------------------------------------- /RobinBot/SvcMessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // SVC Hook by _or_75 4 | 5 | #include 6 | #include 7 | #include "AutoOffset.h" 8 | #include "Main.h" 9 | 10 | extern int* MSG_ReadCount; 11 | extern int* MSG_CurrentSize; 12 | extern int* MSG_BadRead; 13 | extern void* MSG_Base; 14 | extern int MSG_SavedReadCount; 15 | 16 | typedef void (*TEmptyCallback)(); 17 | 18 | typedef int (*HL_MSG_ReadByte)(); 19 | typedef int (*HL_MSG_ReadShort)(); 20 | typedef int (*HL_MSG_ReadLong)(); 21 | typedef char* (*HL_MSG_ReadString)(); 22 | 23 | typedef void (*HL_MSG_CBuf_AddText)(char* text); 24 | 25 | extern HL_MSG_ReadByte MSG_ReadByte; 26 | extern HL_MSG_ReadShort MSG_ReadShort; 27 | extern HL_MSG_ReadLong MSG_ReadLong; 28 | extern HL_MSG_ReadString MSG_ReadString; 29 | 30 | extern HL_MSG_CBuf_AddText CBuf_AddText_Orign; 31 | 32 | extern TEmptyCallback SVC_StuffText_Orign; 33 | extern TEmptyCallback SVC_SendCvarValue_Orign; 34 | extern TEmptyCallback SVC_SendCvarValue2_Orign; 35 | 36 | void MSG_SaveReadCount(); 37 | void MSG_RestoreReadCount(); 38 | 39 | TEmptyCallback HookServerMsg(const unsigned Index, void* CallBack,AutoOffset* Offset); 40 | 41 | bool IsCvarGood(const char *str); 42 | bool IsCommandGood(const char *str); 43 | bool SanitizeCommands(char *str,char* name); 44 | 45 | void CBuf_AddText(char* text); 46 | void SVC_StuffText(); 47 | void SVC_SendCvarValue(); 48 | void SVC_SendCvarValue2(); -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/cdll_dll.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // 16 | // cdll_dll.h 17 | 18 | // this file is included by both the game-dll and the client-dll, 19 | 20 | #ifndef CDLL_DLL_H 21 | #define CDLL_DLL_H 22 | 23 | #define MAX_WEAPONS 32 // ??? 24 | 25 | #define MAX_WEAPON_SLOTS 5 // hud item selection slots 26 | #define MAX_ITEM_TYPES 6 // hud item selection slots 27 | 28 | #define MAX_ITEMS 5 // hard coded item types 29 | 30 | #define HIDEHUD_WEAPONS ( 1<<0 ) 31 | #define HIDEHUD_FLASHLIGHT ( 1<<1 ) 32 | #define HIDEHUD_ALL ( 1<<2 ) 33 | #define HIDEHUD_HEALTH ( 1<<3 ) 34 | 35 | #define MAX_AMMO_TYPES 32 // ??? 36 | #define MAX_AMMO_SLOTS 32 // not really slots 37 | 38 | #define HUD_PRINTNOTIFY 1 39 | #define HUD_PRINTCONSOLE 2 40 | #define HUD_PRINTTALK 3 41 | #define HUD_PRINTCENTER 4 42 | 43 | 44 | #define WEAPON_SUIT 31 45 | 46 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/cdll_engine_dll.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000 Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // 16 | // cdll_dll.h 17 | 18 | // this file is included by both the game-dll and the client-dll, 19 | 20 | #ifndef CDLL_DLL_H 21 | #define CDLL_DLL_H 22 | 23 | #define MAX_WEAPONS 32 // ??? 24 | 25 | #define MAX_WEAPON_SLOTS 5 // hud item selection slots 26 | #define MAX_ITEM_TYPES 6 // hud item selection slots 27 | 28 | #define MAX_ITEMS 5 // hard coded item types 29 | 30 | #define HIDEHUD_WEAPONS ( 1<<0 ) 31 | #define HIDEHUD_FLASHLIGHT ( 1<<1 ) 32 | #define HIDEHUD_ALL ( 1<<2 ) 33 | #define HIDEHUD_HEALTH ( 1<<3 ) 34 | 35 | #define MAX_AMMO_TYPES 32 // ??? 36 | #define MAX_AMMO_SLOTS 32 // not really slots 37 | 38 | #define HUD_PRINTNOTIFY 1 39 | #define HUD_PRINTCONSOLE 2 40 | #define HUD_PRINTTALK 3 41 | #define HUD_PRINTCENTER 4 42 | 43 | 44 | #define WEAPON_SUIT 31 45 | 46 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/weaponinfo.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( WEAPONINFOH ) 16 | #define WEAPONINFOH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Info about weapons player might have in his/her possession 22 | typedef struct weapon_data_s 23 | { 24 | int m_iId; 25 | int m_iClip; 26 | 27 | float m_flNextPrimaryAttack; 28 | float m_flNextSecondaryAttack; 29 | float m_flTimeWeaponIdle; 30 | 31 | int m_fInReload; 32 | int m_fInSpecialReload; 33 | float m_flNextReload; 34 | float m_flPumpTime; 35 | float m_fReloadTime; 36 | 37 | float m_fAimedDamage; 38 | float m_fNextAimBonus; 39 | int m_fInZoom; 40 | int m_iWeaponState; 41 | 42 | int iuser1; 43 | int iuser2; 44 | int iuser3; 45 | int iuser4; 46 | float fuser1; 47 | float fuser2; 48 | float fuser3; 49 | float fuser4; 50 | } weapon_data_t; 51 | 52 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/usercmd.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000 Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef USERCMD_H 16 | #define USERCMD_H 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct usercmd_s 22 | { 23 | short lerp_msec; // Interpolation time on client 24 | byte msec; // Duration in ms of command 25 | vec3_t viewangles; // Command view angles. 26 | 27 | // intended velocities 28 | float forwardmove; // Forward velocity. 29 | float sidemove; // Sideways velocity. 30 | float upmove; // Upward velocity. 31 | byte lightlevel; // Light level at spot where we are standing. 32 | unsigned short buttons; // Attack buttons 33 | byte impulse; // Impulse command issued. 34 | byte weaponselect; // Current weapon id 35 | 36 | // Experimental player impact stuff. 37 | int impact_index; 38 | vec3_t impact_position; 39 | } usercmd_t; 40 | 41 | #endif // USERCMD_H -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/weaponinfo.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( WEAPONINFOH ) 16 | #define WEAPONINFOH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Info about weapons player might have in his/her possession 22 | typedef struct weapon_data_s 23 | { 24 | int m_iId; 25 | int m_iClip; 26 | 27 | float m_flNextPrimaryAttack; 28 | float m_flNextSecondaryAttack; 29 | float m_flTimeWeaponIdle; 30 | 31 | int m_fInReload; 32 | int m_fInSpecialReload; 33 | float m_flNextReload; 34 | float m_flPumpTime; 35 | float m_fReloadTime; 36 | 37 | float m_fAimedDamage; 38 | float m_fNextAimBonus; 39 | int m_fInZoom; 40 | int m_iWeaponState; 41 | 42 | int iuser1; 43 | int iuser2; 44 | int iuser3; 45 | int iuser4; 46 | float fuser1; 47 | float fuser2; 48 | float fuser3; 49 | float fuser4; 50 | } weapon_data_t; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/usercmd.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef USERCMD_H 16 | #define USERCMD_H 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct usercmd_s 22 | { 23 | short lerp_msec; // Interpolation time on client 24 | byte msec; // Duration in ms of command 25 | vec3_t viewangles; // Command view angles. 26 | 27 | // intended velocities 28 | float forwardmove; // Forward velocity. 29 | float sidemove; // Sideways velocity. 30 | float upmove; // Upward velocity. 31 | byte lightlevel; // Light level at spot where we are standing. 32 | unsigned short buttons; // Attack buttons 33 | byte impulse; // Impulse command issued. 34 | byte weaponselect; // Current weapon id 35 | 36 | // Experimental player impact stuff. 37 | int impact_index; 38 | vec3_t impact_position; 39 | } usercmd_t; 40 | 41 | #endif // USERCMD_H 42 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/pmtrace.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000 Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( PMTRACEH ) 16 | #define PMTRACEH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct 22 | { 23 | vec3_t normal; 24 | float dist; 25 | } pmplane_t; 26 | 27 | typedef struct pmtrace_s pmtrace_t; 28 | 29 | struct pmtrace_s 30 | { 31 | qboolean allsolid; // if true, plane is not valid 32 | qboolean startsolid; // if true, the initial point was in a solid area 33 | qboolean inopen, inwater; // End point is in empty space or in water 34 | float fraction; // time completed, 1.0 = didn't hit anything 35 | vec3_t endpos; // final position 36 | pmplane_t plane; // surface normal at impact 37 | int ent; // entity at impact 38 | vec3_t deltavelocity; // Change in player's velocity caused by impact. 39 | // Only run on server. 40 | int hitgroup; 41 | }; 42 | 43 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/pmtrace.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( PMTRACEH ) 16 | #define PMTRACEH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct 22 | { 23 | vec3_t normal; 24 | float dist; 25 | } pmplane_t; 26 | 27 | typedef struct pmtrace_s pmtrace_t; 28 | 29 | struct pmtrace_s 30 | { 31 | qboolean allsolid; // if true, plane is not valid 32 | qboolean startsolid; // if true, the initial point was in a solid area 33 | qboolean inopen, inwater; // End point is in empty space or in water 34 | float fraction; // time completed, 1.0 = didn't hit anything 35 | vec3_t endpos; // final position 36 | pmplane_t plane; // surface normal at impact 37 | int ent; // entity at impact 38 | vec3_t deltavelocity; // Change in player's velocity caused by impact. 39 | // Only run on server. 40 | int hitgroup; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/director_cmds.h: -------------------------------------------------------------------------------- 1 | // director_cmds.h 2 | // sub commands for svc_director 3 | 4 | #define DRC_ACTIVE 0 // tells client that he's an spectator and will get director command 5 | #define DRC_STATUS 1 // send status infos about proxy 6 | #define DRC_CAMERA 2 // set the actual director camera position 7 | #define DRC_EVENT 3 // informs the dircetor about ann important game event 8 | 9 | 10 | #define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important) 11 | #define DRC_FLAG_SIDE (1<<4) 12 | #define DRC_FLAG_DRAMATIC (1<<5) 13 | 14 | 15 | 16 | // commands of the director API function CallDirectorProc(...) 17 | 18 | #define DRCAPI_NOP 0 // no operation 19 | #define DRCAPI_ACTIVE 1 // de/acivates director mode in engine 20 | #define DRCAPI_STATUS 2 // request proxy information 21 | #define DRCAPI_SETCAM 3 // set camera n to given position and angle 22 | #define DRCAPI_GETCAM 4 // request camera n position and angle 23 | #define DRCAPI_DIRPLAY 5 // set director time and play with normal speed 24 | #define DRCAPI_DIRFREEZE 6 // freeze directo at this time 25 | #define DRCAPI_SETVIEWMODE 7 // overview or 4 cameras 26 | #define DRCAPI_SETOVERVIEWPARAMS 8 // sets parameter for overview mode 27 | #define DRCAPI_SETFOCUS 9 // set the camera which has the input focus 28 | #define DRCAPI_GETTARGETS 10 // queries engine for player list 29 | #define DRCAPI_SETVIEWPOINTS 11 // gives engine all waypoints 30 | 31 | 32 | -------------------------------------------------------------------------------- /RobinBot/usermsg.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | 3 | pfnUserMsgHook pTeamInfo = NULL; 4 | pfnUserMsgHook pCurWeapon = NULL; 5 | 6 | int TeamInfo( const char *pszName, int iSize, void *pbuf ) 7 | { 8 | //add_log("pTeamInfo"); 9 | BEGIN_READ( pbuf, iSize ); 10 | int iIndex = READ_BYTE(); 11 | char *szTeam = READ_STRING(); 12 | _strlwr( szTeam ); 13 | if( !strcmp( szTeam, "terrorist" ) ) 14 | { 15 | if( iIndex == g_Local.iIndex ) { g_Local.iTeam = 1; } 16 | g_Player[iIndex].iTeam = 1; 17 | } 18 | else if( !strcmp( szTeam, "ct" ) ) 19 | { 20 | if( iIndex == g_Local.iIndex ) { g_Local.iTeam = 2; } 21 | g_Player[iIndex].iTeam = 2; 22 | } 23 | else 24 | { 25 | if( iIndex == g_Local.iIndex ) { g_Local.iTeam = 0; } 26 | g_Player[iIndex].iTeam = 0; 27 | } 28 | return (*pTeamInfo)( pszName, iSize, pbuf ); 29 | } 30 | 31 | int CurWeapon(const char *pszName, int iSize, void *pbuf) 32 | { 33 | //add_log("CurWeapon"); 34 | BEGIN_READ( pbuf, iSize ); 35 | int iState = READ_BYTE(); 36 | int iWeaponID = READ_CHAR(); 37 | if( iState ) 38 | { 39 | g_Local.iWeaponID = iWeaponID; 40 | } 41 | return pCurWeapon(pszName, iSize, pbuf); 42 | } 43 | 44 | int pfnHookUserMsg( char *szMsgName, pfnUserMsgHook pfn ) 45 | { 46 | #define HOOK_MSG(name) \ 47 | if( !strcmp( szMsgName, #name ) ) \ 48 | { \ 49 | p##name = pfn; \ 50 | return g_Engine.pfnHookUserMsg( szMsgName, ##name ); \ 51 | } 52 | 53 | HOOK_MSG(TeamInfo) 54 | HOOK_MSG(CurWeapon) 55 | 56 | return g_Engine.pfnHookUserMsg( szMsgName, pfn ); 57 | } -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/particledef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( PARTICLEDEFH ) 16 | #define PARTICLEDEFH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef enum { 22 | pt_static, 23 | pt_grav, 24 | pt_slowgrav, 25 | pt_fire, 26 | pt_explode, 27 | pt_explode2, 28 | pt_blob, 29 | pt_blob2, 30 | pt_vox_slowgrav, 31 | pt_vox_grav, 32 | pt_clientcustom // Must have callback function specified 33 | } ptype_t; 34 | 35 | // !!! if this is changed, it must be changed in d_ifacea.h too !!! 36 | typedef struct particle_s 37 | { 38 | // driver-usable fields 39 | vec3_t org; 40 | short color; 41 | short packedColor; 42 | // drivers never touch the following fields 43 | struct particle_s *next; 44 | vec3_t vel; 45 | float ramp; 46 | float die; 47 | ptype_t type; 48 | void (*deathfunc)( struct particle_s *particle ); 49 | 50 | // for pt_clientcusttom, we'll call this function each frame 51 | void (*callback)( struct particle_s *particle, float frametime ); 52 | 53 | // For deathfunc, etc. 54 | unsigned char context; 55 | } particle_t; 56 | 57 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/particledef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( PARTICLEDEFH ) 16 | #define PARTICLEDEFH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef enum { 22 | pt_static, 23 | pt_grav, 24 | pt_slowgrav, 25 | pt_fire, 26 | pt_explode, 27 | pt_explode2, 28 | pt_blob, 29 | pt_blob2, 30 | pt_vox_slowgrav, 31 | pt_vox_grav, 32 | pt_clientcustom // Must have callback function specified 33 | } ptype_t; 34 | 35 | // !!! if this is changed, it must be changed in d_ifacea.h too !!! 36 | typedef struct particle_s 37 | { 38 | // driver-usable fields 39 | vec3_t org; 40 | short color; 41 | short packedColor; 42 | // drivers never touch the following fields 43 | struct particle_s *next; 44 | vec3_t vel; 45 | float ramp; 46 | float die; 47 | ptype_t type; 48 | void (*deathfunc)( struct particle_s *particle ); 49 | 50 | // for pt_clientcusttom, we'll call this function each frame 51 | void (*callback)( struct particle_s *particle, float frametime ); 52 | 53 | // For deathfunc, etc. 54 | unsigned char context; 55 | } particle_t; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/cvardef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef CVARDEF_H 16 | #define CVARDEF_H 17 | 18 | #define FCVAR_ARCHIVE (1<<0) // set to cause it to be saved to vars.rc 19 | #define FCVAR_USERINFO (1<<1) // changes the client's info string 20 | #define FCVAR_SERVER (1<<2) // notifies players when changed 21 | #define FCVAR_EXTDLL (1<<3) // defined by external DLL 22 | #define FCVAR_CLIENTDLL (1<<4) // defined by the client dll 23 | #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 24 | #define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server. 25 | #define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). 26 | #define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log 27 | 28 | typedef struct cvar_s 29 | { 30 | char *name; 31 | char *string; 32 | int flags; 33 | float value; 34 | struct cvar_s *next; 35 | } cvar_t; 36 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/hltv.h: -------------------------------------------------------------------------------- 1 | // hltv.h 2 | // all shared consts between server, clients and proxy 3 | 4 | #define TYPE_CLIENT 0 // client is a normal HL client (default) 5 | #define TYPE_PROXY 1 // client is another proxy 6 | #define TYPE_DIRECTOR 2 // client is a director 7 | #define TYPE_COMMENTATOR 3 // client is a commentator 8 | 9 | 10 | #define HLTV_ACTIVE 0 // tells client that he's an spectator and will get director command 11 | #define HLTV_STATUS 1 // send status infos about proxy 12 | #define HLTV_CAMERA 2 // set the actual director camera position 13 | #define HLTV_EVENT 3 // informs the dircetor about ann important game event 14 | 15 | 16 | #define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important) 17 | #define DRC_FLAG_SIDE (1<<4) 18 | #define DRC_FLAG_DRAMATIC (1<<5) 19 | 20 | 21 | 22 | // commands of the director API function CallDirectorProc(...) 23 | 24 | #define DRCAPI_NOP 0 // no operation 25 | #define DRCAPI_ACTIVE 1 // de/acivates director mode in engine 26 | #define DRCAPI_STATUS 2 // request proxy information 27 | #define DRCAPI_SETCAM 3 // set camera n to given position and angle 28 | #define DRCAPI_GETCAM 4 // request camera n position and angle 29 | #define DRCAPI_DIRTIME 5 // set director time 30 | #define DRCAPI_DIRSCALE 6 // set time scale 31 | #define DRCAPI_SETVIEWMODE 7 // overview or 4 cameras 32 | #define DRCAPI_SETOVERVIEWPARAMS 8 // sets parameter for overview mode 33 | #define DRCAPI_SETFOCUS 9 // set the camera which has the input focus 34 | #define DRCAPI_GETTARGETS 10 // queries engine for player list 35 | #define DRCAPI_SETVIEWPOINTS 11 // gives engine all waypoints 36 | 37 | 38 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/cvardef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef CVARDEF_H 16 | #define CVARDEF_H 17 | 18 | #define FCVAR_ARCHIVE (1<<0) // set to cause it to be saved to vars.rc 19 | #define FCVAR_USERINFO (1<<1) // changes the client's info string 20 | #define FCVAR_SERVER (1<<2) // notifies players when changed 21 | #define FCVAR_EXTDLL (1<<3) // defined by external DLL 22 | #define FCVAR_CLIENTDLL (1<<4) // defined by the client dll 23 | #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 24 | #define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server. 25 | #define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). 26 | #define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log 27 | 28 | typedef struct cvar_s 29 | { 30 | char *name; 31 | char *string; 32 | int flags; 33 | float value; 34 | struct cvar_s *next; 35 | } cvar_t; 36 | #endif 37 | -------------------------------------------------------------------------------- /RobinBot/stringfinder.cpp: -------------------------------------------------------------------------------- 1 | #include "Main.h" 2 | 3 | typedef map > MapStringInt; 4 | 5 | struct Private_Data 6 | { 7 | MapStringInt theMap; 8 | MapStringInt::iterator pos; 9 | }; 10 | 11 | #define THE_MAP ( (*((Private_Data*)data)).theMap) 12 | #define THE_POS ( (*((Private_Data*)data)).pos) 13 | 14 | StringFinder::StringFinder() 15 | { 16 | data = new Private_Data; 17 | } 18 | 19 | StringFinder::~StringFinder() 20 | { 21 | delete (Private_Data*)data; 22 | } 23 | 24 | void StringFinder::clear() 25 | { 26 | THE_MAP.clear(); 27 | } 28 | 29 | void StringFinder::add(const char* str, int num) 30 | { 31 | if(!str || !*str){ return;} 32 | typedef MapStringInt::value_type Entry; 33 | THE_MAP.insert(Entry(str,num)); 34 | } 35 | 36 | void StringFinder::erase( const char* str ) 37 | { 38 | MapStringInt::iterator foundPos = THE_MAP.find( std::string(str) ); 39 | if(foundPos!=THE_MAP.end()) 40 | { 41 | THE_MAP.erase(foundPos); 42 | } 43 | } 44 | 45 | bool StringFinder::find(const char* str) 46 | { 47 | if(!str || !*str){ return false; } 48 | 49 | MapStringInt::iterator foundPos = THE_MAP.find( std::string(str) ); 50 | 51 | if(foundPos==THE_MAP.end()) 52 | { 53 | return false; 54 | } 55 | 56 | else 57 | { 58 | num = (*foundPos).second; 59 | return true; 60 | } 61 | } 62 | 63 | void StringFinder::it_start() 64 | { 65 | THE_POS = THE_MAP.begin(); 66 | num = THE_POS->second; 67 | str = THE_POS->first.c_str(); 68 | } 69 | 70 | bool StringFinder::it_running() 71 | { 72 | return (THE_POS!=THE_MAP.end()); 73 | } 74 | 75 | void StringFinder::it_next() 76 | { 77 | ++THE_POS; 78 | num = THE_POS->second; 79 | str = THE_POS->first.c_str(); 80 | } -------------------------------------------------------------------------------- /RobinBot/AutoOffset.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "Main.h" 6 | 7 | #define CompareMemory(Buff1, Buff2, Size) __comparemem((const UCHAR *)Buff1, (const UCHAR *)Buff2, (UINT)Size) 8 | #define FindMemoryClone(Start, End, Clone, Size) __findmemoryclone((const ULONG)Start, (const ULONG)End, (const ULONG)Clone, (UINT)Size) 9 | #define FindReference(Start, End, Address) __findreference((const ULONG)Start, (const ULONG)End, (const ULONG)Address) 10 | 11 | class AutoOffset 12 | { 13 | public: 14 | bool SW; 15 | BYTE HLType; 16 | DWORD SpeedPtr; 17 | DWORD HwBase, HwSize, HwEnd; 18 | 19 | DWORD pCBuf_AddText; 20 | server_msg_array_s SVCBase; 21 | void* SVCBase_End; 22 | unsigned int SVCCount; 23 | 24 | void MsgDump(DWORD Address); 25 | DWORD MessagePtr(char Message[],BYTE size); 26 | bool GetRendererInfo(void); 27 | void Error(const PCHAR Msg); 28 | DWORD GetModuleSize(const DWORD Address); 29 | DWORD FarProc(const DWORD Address, DWORD LB, DWORD HB); 30 | void *SpeedHackPtr(void); 31 | void *ClientFuncs(void); 32 | void *EngineFuncs(void); 33 | DWORD EngineStudio(); 34 | 35 | unsigned Relative(const unsigned Addr,const unsigned NewFunc); 36 | unsigned Absolute(DWORD Addr); 37 | bool CheckByte(DWORD Address,BYTE Value,int Offset); 38 | DWORD GetCallback(unsigned Index); 39 | 40 | void GameInfo(void); 41 | void Find_SVCBase(void); 42 | void Find_MSGInterface(void); 43 | void Find_CBuf_AddText(void); 44 | void Patch_CL_ConnectionlessPacket(void); 45 | void *Sound(void); 46 | 47 | BOOL __comparemem(const UCHAR *buff1, const UCHAR *buff2, UINT size); 48 | ULONG __findmemoryclone(const ULONG start, const ULONG end, const ULONG clone, UINT size); 49 | ULONG __findreference(const ULONG start, const ULONG end, const ULONG address); 50 | }; -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/event_flags.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( EVENT_FLAGSH ) 16 | #define EVENT_FLAGSH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Skip local host for event send. 22 | #define FEV_NOTHOST (1<<0) 23 | 24 | // Send the event reliably. You must specify the origin and angles and use 25 | // PLAYBACK_EVENT_FULL for this to work correctly on the server for anything 26 | // that depends on the event origin/angles. I.e., the origin/angles are not 27 | // taken from the invoking edict for reliable events. 28 | #define FEV_RELIABLE (1<<1) 29 | 30 | // Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC 31 | // sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ). 32 | #define FEV_GLOBAL (1<<2) 33 | 34 | // If this client already has one of these events in its queue, just update the event instead of sending it as a duplicate 35 | // 36 | #define FEV_UPDATE (1<<3) 37 | 38 | // Only send to entity specified as the invoker 39 | #define FEV_HOSTONLY (1<<4) 40 | 41 | // Only send if the event was created on the server. 42 | #define FEV_SERVER (1<<5) 43 | 44 | // Only issue event client side ( from shared code ) 45 | #define FEV_CLIENT (1<<6) 46 | 47 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/event_flags.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( EVENT_FLAGSH ) 16 | #define EVENT_FLAGSH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Skip local host for event send. 22 | #define FEV_NOTHOST (1<<0) 23 | 24 | // Send the event reliably. You must specify the origin and angles and use 25 | // PLAYBACK_EVENT_FULL for this to work correctly on the server for anything 26 | // that depends on the event origin/angles. I.e., the origin/angles are not 27 | // taken from the invoking edict for reliable events. 28 | #define FEV_RELIABLE (1<<1) 29 | 30 | // Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC 31 | // sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ). 32 | #define FEV_GLOBAL (1<<2) 33 | 34 | // If this client already has one of these events in its queue, just update the event instead of sending it as a duplicate 35 | // 36 | #define FEV_UPDATE (1<<3) 37 | 38 | // Only send to entity specified as the invoker 39 | #define FEV_HOSTONLY (1<<4) 40 | 41 | // Only send if the event was created on the server. 42 | #define FEV_SERVER (1<<5) 43 | 44 | // Only issue event client side ( from shared code ) 45 | #define FEV_CLIENT (1<<6) 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/triangleapi.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( TRIANGLEAPIH ) 16 | #define TRIANGLEAPIH 17 | #pragma once 18 | 19 | typedef enum 20 | { 21 | TRI_FRONT = 0, 22 | TRI_NONE = 1, 23 | } TRICULLSTYLE; 24 | 25 | #define TRI_API_VERSION 1 26 | 27 | #define TRI_TRIANGLES 0 28 | #define TRI_TRIANGLE_FAN 1 29 | #define TRI_QUADS 2 30 | #define TRI_POLYGON 3 31 | #define TRI_LINES 4 32 | #define TRI_TRIANGLE_STRIP 5 33 | #define TRI_QUAD_STRIP 6 34 | 35 | typedef struct triangleapi_s 36 | { 37 | int version; 38 | 39 | void ( *RenderMode )( int mode ); 40 | void ( *Begin )( int primitiveCode ); 41 | void ( *End ) ( void ); 42 | 43 | void ( *Color4f ) ( float r, float g, float b, float a ); 44 | void ( *Color4ub ) ( unsigned char r, unsigned char g, unsigned char b, unsigned char a ); 45 | void ( *TexCoord2f ) ( float u, float v ); 46 | void ( *Vertex3fv ) ( float *worldPnt ); 47 | void ( *Vertex3f ) ( float x, float y, float z ); 48 | void ( *Brightness ) ( float brightness ); 49 | void ( *CullFace ) ( TRICULLSTYLE style ); 50 | int ( *SpriteTexture ) ( struct model_s *pSpriteModel, int frame ); 51 | int ( *WorldToScreen ) ( float *world, float *screen ); // Returns 1 if it's z clipped 52 | } triangleapi_t; 53 | 54 | #endif // !TRIANGLEAPIH -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/beamdef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( BEAMDEFH ) 16 | #define BEAMDEFH 17 | #pragma once 18 | 19 | #define FBEAM_STARTENTITY 0x00000001 20 | #define FBEAM_ENDENTITY 0x00000002 21 | #define FBEAM_FADEIN 0x00000004 22 | #define FBEAM_FADEOUT 0x00000008 23 | #define FBEAM_SINENOISE 0x00000010 24 | #define FBEAM_SOLID 0x00000020 25 | #define FBEAM_SHADEIN 0x00000040 26 | #define FBEAM_SHADEOUT 0x00000080 27 | #define FBEAM_STARTVISIBLE 0x10000000 // Has this client actually seen this beam's start entity yet? 28 | #define FBEAM_ENDVISIBLE 0x20000000 // Has this client actually seen this beam's end entity yet? 29 | #define FBEAM_ISACTIVE 0x40000000 30 | #define FBEAM_FOREVER 0x80000000 31 | 32 | typedef struct beam_s BEAM; 33 | struct beam_s 34 | { 35 | BEAM *next; 36 | int type; 37 | int flags; 38 | vec3_t source; 39 | vec3_t target; 40 | vec3_t delta; 41 | float t; // 0 .. 1 over lifetime of beam 42 | float freq; 43 | float die; 44 | float width; 45 | float amplitude; 46 | float r, g, b; 47 | float brightness; 48 | float speed; 49 | float frameRate; 50 | float frame; 51 | int segments; 52 | int startEntity; 53 | int endEntity; 54 | int modelIndex; 55 | int frameCount; 56 | struct model_s *pFollowModel; 57 | struct particle_s *particles; 58 | }; 59 | 60 | #endif -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/crc.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | /* crc.h */ 16 | #ifndef CRC_H 17 | #define CRC_H 18 | #ifdef _WIN32 19 | #pragma once 20 | #endif 21 | 22 | // MD5 Hash 23 | typedef struct 24 | { 25 | unsigned int buf[4]; 26 | unsigned int bits[2]; 27 | unsigned char in[64]; 28 | } MD5Context_t; 29 | 30 | 31 | typedef unsigned long CRC32_t; 32 | void CRC32_Init(CRC32_t *pulCRC); 33 | CRC32_t CRC32_Final(CRC32_t pulCRC); 34 | void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); 35 | void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); 36 | int CRC_File(CRC32_t *crcvalue, char *pszFileName); 37 | unsigned char COM_BlockSequenceCRCByte(unsigned char *base, int length, int sequence); 38 | 39 | void MD5Init(MD5Context_t *context); 40 | void MD5Update(MD5Context_t *context, unsigned char const *buf, 41 | unsigned int len); 42 | void MD5Final(unsigned char digest[16], MD5Context_t *context); 43 | void Transform(unsigned int buf[4], unsigned int const in[16]); 44 | 45 | int MD5_Hash_File(unsigned char digest[16], char *pszFileName, int bUsefopen, int bSeed, unsigned int seed[4]); 46 | char *MD5_Print(unsigned char hash[16]); 47 | int MD5_Hash_CachedFile(unsigned char digest[16], unsigned char *pCache, int nFileSize, int bSeed, unsigned int seed[4]); 48 | 49 | int CRC_MapFile(CRC32_t *crcvalue, char *pszFileName); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/crc.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | /* crc.h */ 16 | #ifndef CRC_H 17 | #define CRC_H 18 | #ifdef _WIN32 19 | #pragma once 20 | #endif 21 | 22 | // MD5 Hash 23 | typedef struct 24 | { 25 | unsigned int buf[4]; 26 | unsigned int bits[2]; 27 | unsigned char in[64]; 28 | } MD5Context_t; 29 | 30 | 31 | typedef unsigned long CRC32_t; 32 | void CRC32_Init(CRC32_t *pulCRC); 33 | CRC32_t CRC32_Final(CRC32_t pulCRC); 34 | void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len); 35 | void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); 36 | int CRC_File(CRC32_t *crcvalue, char *pszFileName); 37 | 38 | unsigned char COM_BlockSequenceCRCByte (unsigned char *base, int length, int sequence); 39 | 40 | void MD5Init(MD5Context_t *context); 41 | void MD5Update(MD5Context_t *context, unsigned char const *buf, 42 | unsigned int len); 43 | void MD5Final(unsigned char digest[16], MD5Context_t *context); 44 | void Transform(unsigned int buf[4], unsigned int const in[16]); 45 | 46 | int MD5_Hash_File(unsigned char digest[16], char *pszFileName, int bUsefopen, int bSeed, unsigned int seed[4]); 47 | char *MD5_Print(unsigned char hash[16]); 48 | int MD5_Hash_CachedFile(unsigned char digest[16], unsigned char *pCache, int nFileSize, int bSeed, unsigned int seed[4]); 49 | 50 | int CRC_MapFile(CRC32_t *crcvalue, char *pszFileName); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/beamdef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( BEAMDEFH ) 16 | #define BEAMDEFH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | #define FBEAM_STARTENTITY 0x00000001 22 | #define FBEAM_ENDENTITY 0x00000002 23 | #define FBEAM_FADEIN 0x00000004 24 | #define FBEAM_FADEOUT 0x00000008 25 | #define FBEAM_SINENOISE 0x00000010 26 | #define FBEAM_SOLID 0x00000020 27 | #define FBEAM_SHADEIN 0x00000040 28 | #define FBEAM_SHADEOUT 0x00000080 29 | #define FBEAM_STARTVISIBLE 0x10000000 // Has this client actually seen this beam's start entity yet? 30 | #define FBEAM_ENDVISIBLE 0x20000000 // Has this client actually seen this beam's end entity yet? 31 | #define FBEAM_ISACTIVE 0x40000000 32 | #define FBEAM_FOREVER 0x80000000 33 | 34 | typedef struct beam_s BEAM; 35 | struct beam_s 36 | { 37 | BEAM *next; 38 | int type; 39 | int flags; 40 | vec3_t source; 41 | vec3_t target; 42 | vec3_t delta; 43 | float t; // 0 .. 1 over lifetime of beam 44 | float freq; 45 | float die; 46 | float width; 47 | float amplitude; 48 | float r, g, b; 49 | float brightness; 50 | float speed; 51 | float frameRate; 52 | float frame; 53 | int segments; 54 | int startEntity; 55 | int endEntity; 56 | int modelIndex; 57 | int frameCount; 58 | struct model_s *pFollowModel; 59 | struct particle_s *particles; 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/triangleapi.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( TRIANGLEAPIH ) 16 | #define TRIANGLEAPIH 17 | #pragma once 18 | 19 | typedef enum 20 | { 21 | TRI_FRONT = 0, 22 | TRI_NONE = 1, 23 | } TRICULLSTYLE; 24 | 25 | #define TRI_API_VERSION 1 26 | 27 | #define TRI_TRIANGLES 0 28 | #define TRI_TRIANGLE_FAN 1 29 | #define TRI_QUADS 2 30 | #define TRI_POLYGON 3 31 | #define TRI_LINES 4 32 | #define TRI_TRIANGLE_STRIP 5 33 | #define TRI_QUAD_STRIP 6 34 | 35 | typedef struct triangleapi_s 36 | { 37 | int version; 38 | 39 | void ( *RenderMode )( int mode ); 40 | void ( *Begin )( int primitiveCode ); 41 | void ( *End ) ( void ); 42 | 43 | void ( *Color4f ) ( float r, float g, float b, float a ); 44 | void ( *Color4ub ) ( unsigned char r, unsigned char g, unsigned char b, unsigned char a ); 45 | void ( *TexCoord2f ) ( float u, float v ); 46 | void ( *Vertex3fv ) ( float *worldPnt ); 47 | void ( *Vertex3f ) ( float x, float y, float z ); 48 | void ( *Brightness ) ( float brightness ); 49 | void ( *CullFace ) ( TRICULLSTYLE style ); 50 | int ( *SpriteTexture ) ( struct model_s *pSpriteModel, int frame ); 51 | int ( *WorldToScreen ) ( float *world, float *screen ); // Returns 1 if it's z clipped 52 | void ( *Fog ) ( float flFogColor[3], float flStart, float flEnd, int bOn ); //Works just like GL_FOG, flFogColor is r/g/b. 53 | } triangleapi_t; 54 | 55 | #endif // !TRIANGLEAPIH 56 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/ref_params.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( REF_PARAMSH ) 16 | #define REF_PARAMSH 17 | 18 | typedef struct ref_params_s 19 | { 20 | // Output 21 | float vieworg[3]; 22 | float viewangles[3]; 23 | 24 | float forward[3]; 25 | float right[3]; 26 | float up[3]; 27 | 28 | // Client frametime; 29 | float frametime; 30 | // Client time 31 | float time; 32 | 33 | // Misc 34 | int intermission; 35 | int paused; 36 | int spectator; 37 | int onground; 38 | int waterlevel; 39 | 40 | float simvel[3]; 41 | float simorg[3]; 42 | 43 | float viewheight[3]; 44 | float idealpitch; 45 | 46 | float cl_viewangles[3]; 47 | 48 | int health; 49 | float crosshairangle[3]; 50 | float viewsize; 51 | 52 | float punchangle[3]; 53 | int maxclients; 54 | int viewentity; 55 | int playernum; 56 | int max_entities; 57 | int demoplayback; 58 | int hardware; 59 | 60 | int smoothing; 61 | 62 | // Last issued usercmd 63 | struct usercmd_s *cmd; 64 | 65 | // Movevars 66 | struct movevars_s *movevars; 67 | 68 | int viewport[4]; // the viewport coordinates x ,y , width, height 69 | 70 | int nextView; // the renderer calls ClientDLL_CalcRefdef() and Renderview 71 | // so long in cycles until this value is 0 (multiple views) 72 | int onlyClientDraw; // if !=0 nothing is drawn by the engine except clientDraw functions 73 | } ref_params_t; 74 | 75 | #endif // !REF_PARAMSH 76 | -------------------------------------------------------------------------------- /RobinBot/Main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Original Project: Far Aimbot 0.5 3 | -------------------------------- 4 | Author: WithCreative & HLRTeam 5 | Created: HLRTeam 6 | Updated: WithCreative & 10.12.2017 7 | Extras: RobinLoader [DLL Injector] by WithCreative 8 | Version 1: Trigger Bot, ESP Box (HLRTeam) 9 | Version 2: Aimbot, Trigger Bot, ESP Box, Name ESP, No Recoil, Menu (WithCreative) 10 | Special Thanks to: HLRTeam for ValveSDK & Source Base 11 | Category: Game Hacking 12 | Description: Counter-Strike - Engine SDK Hack 13 | */ 14 | 15 | 16 | #include "Main.h" 17 | #include "SetupHooks.h" 18 | 19 | char g_szBaseDir[256]; 20 | local_s g_Local; 21 | SCREENINFO g_Screen; 22 | GameInfo_s BuildInfo; 23 | HINSTANCE hInstance; 24 | cl_clientfunc_t *g_pClient = nullptr; 25 | cl_clientfunc_t g_Client; 26 | cl_enginefunc_t *g_pEngine = nullptr; 27 | cl_enginefunc_t g_Engine; 28 | engine_studio_api_t *g_pStudio = nullptr; 29 | engine_studio_api_t g_Studio; 30 | ofstream ofile; 31 | 32 | string szDirFile( char* pszName ) 33 | { 34 | string szRet = g_szBaseDir; 35 | return (szRet + pszName); 36 | } 37 | 38 | 39 | void add_log(const char *fmt, ...) 40 | { 41 | if(!fmt) 42 | return; 43 | va_list va_alist; 44 | char logbuf[256] = { 0 }; 45 | va_start(va_alist, fmt); 46 | _vsnprintf(logbuf + strlen(logbuf), sizeof(logbuf)-strlen(logbuf), fmt, va_alist); 47 | va_end(va_alist); 48 | ofile << logbuf << endl; 49 | } 50 | 51 | BOOL APIENTRY DllMain( HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved ) 52 | { 53 | if( dwReason == DLL_PROCESS_ATTACH ) 54 | { 55 | if ( GetLastError() != ERROR_ALREADY_EXISTS ) 56 | { 57 | AllocConsole(); 58 | GetModuleFileName( hModule, (LPWSTR)g_szBaseDir, sizeof( g_szBaseDir ) ); 59 | char* pos = g_szBaseDir + strlen( g_szBaseDir ); 60 | while( pos >= g_szBaseDir && *pos!='\\' ) --pos; pos[ 1 ]=0; 61 | 62 | hInstance = hModule; 63 | DisableThreadLibraryCalls((HINSTANCE)hModule); 64 | SetupHooks* Hook = new SetupHooks; 65 | Hook->StartThread(&SetupHooks::Initialize, 0); 66 | delete Hook; 67 | } 68 | } 69 | return TRUE; 70 | } -------------------------------------------------------------------------------- /RobinBot/interpreter.h: -------------------------------------------------------------------------------- 1 | #ifndef INTERPRETER_H 2 | #define INTERPRETER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | #pragma warning(disable:4018) 12 | 13 | class CommandInterpreter 14 | { 15 | public: 16 | void AddCommand(char* name, void(*func)()){ Add(name, Entry::COMMAND, func); } 17 | void AddAlias(const char* name, string& content); 18 | void AddCvarInt(char* name, int* var){ Add(name, Entry::CVAR_INT, var); } 19 | void AddCvarFloat(char* name, float* var){ Add(name, Entry::CVAR_FLOAT, var); } 20 | void AddCvarString(char* name, string* var){ Add(name, Entry::CVAR_STR, var); } 21 | void exec(const char* cmdlist); 22 | void exec_one(const char* cmd); 23 | void execFile(const char* filename); 24 | string& argS(int i){ --i; if (i < preExecArgs.size()) return preExecArgs[i]; else return emptyString; } 25 | char* argC(int i){ --i; if (i < preExecArgs.size()) return const_cast(preExecArgs[i].c_str()); else return ""; } 26 | int argI(int i){ --i; if (i < preExecArgs.size()) return atoi(preExecArgs[i].c_str()); else return 0; } 27 | float argF(int i){ --i; if (i < preExecArgs.size()) return (float)atof(preExecArgs[i].c_str()); else return 0.0f; } 28 | void collectArguments(string& dest, int from = 1, int to = 100000); 29 | void init() { createRandomPrefix(); } 30 | CommandInterpreter(){ init(); } 31 | union{ 32 | char excludePrefixChar[5]; 33 | unsigned long excludePrefixDword; 34 | }; 35 | vector preExecArgs; 36 | StringFinder names; 37 | protected: 38 | void Add(char* name, int type, void* data); 39 | void extractArguments(const char* args); 40 | void logExec(const char* command); 41 | void createRandomPrefix(); 42 | public: 43 | struct Entry 44 | { 45 | enum { CVAR_FLOAT, CVAR_INT, CVAR_STR, COMMAND, ALIAS, HL_CVAR }; 46 | int type; 47 | void* data; 48 | char* name; 49 | }; 50 | vector entries; 51 | string emptyString; 52 | }; 53 | 54 | extern CommandInterpreter cmd; 55 | 56 | #endif -------------------------------------------------------------------------------- /RobinBot/drawing.cpp: -------------------------------------------------------------------------------- 1 | #include "drawing.h" 2 | #include "main.h" 3 | 4 | #pragma warning( disable:4996 ) 5 | 6 | void CDrawing::FillArea( int x, int y, int w, int h, int r, int g, int b, int a ) 7 | { 8 | g_Engine.pfnTintRGBA( x, y, w, h, r, g, b, a ); 9 | } 10 | 11 | void CDrawing::DrawBox( int x, int y, int w, int h, int linewidth, int r, int g, int b, int a ) 12 | { 13 | FillArea( x, y, w, linewidth, r, g, b, a ); 14 | FillArea( x + w - linewidth, y + linewidth, linewidth, h - linewidth, r, g, b, a ); 15 | FillArea( x, y + linewidth, linewidth, h - linewidth, r, g, b, a ); 16 | FillArea( x + linewidth, y + h - linewidth, w - linewidth * 2, linewidth, r, g, b, a ); 17 | } 18 | 19 | int CDrawing::iStringLen( const char *fmt, ... ) 20 | { 21 | va_list va_alist; 22 | char buf[256]; 23 | va_start( va_alist, fmt ); 24 | _vsnprintf( buf, sizeof( buf ), fmt, va_alist ); 25 | va_end( va_alist ); 26 | int iWidth, iHeight; 27 | g_Engine.pfnDrawConsoleStringLen( buf, &iWidth, &iHeight ); 28 | return iWidth; 29 | } 30 | 31 | int CDrawing::iStringHeight( void ) 32 | { 33 | int iWidth, iHeight; 34 | g_Engine.pfnDrawConsoleStringLen( "F", &iWidth, &iHeight ); 35 | return iHeight; 36 | } 37 | 38 | void CDrawing::DrawString( int x, int y, int r, int g, int b, const char *fmt, ... ) 39 | { 40 | va_list va_alist; 41 | char buf[256]; 42 | va_start( va_alist, fmt ); 43 | _vsnprintf( buf, sizeof( buf ), fmt, va_alist ); 44 | va_end( va_alist ); 45 | g_Engine.pfnDrawSetTextColor( (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f ); 46 | g_Engine.pfnDrawConsoleString( x, y, buf ); 47 | } 48 | 49 | void CDrawing::DrawStringCenter( int x, int y, int r, int g, int b, const char *fmt, ... ) 50 | { 51 | va_list va_alist; 52 | char buf[256]; 53 | va_start( va_alist, fmt ); 54 | _vsnprintf( buf, sizeof( buf ), fmt, va_alist ); 55 | va_end( va_alist ); 56 | int iWidth = iStringLen( "%s", buf ); 57 | g_Engine.pfnDrawSetTextColor( (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f ); 58 | g_Engine.pfnDrawConsoleString( x - iWidth / 2, y, buf ); 59 | } 60 | 61 | CDrawing g_Drawing; -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/shake.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef SHAKE_H 16 | #define SHAKE_H 17 | 18 | // Screen / View effects 19 | 20 | // screen shake 21 | extern int gmsgShake; 22 | 23 | // This structure is sent over the net to describe a screen shake event 24 | typedef struct 25 | { 26 | unsigned short amplitude; // FIXED 4.12 amount of shake 27 | unsigned short duration; // FIXED 4.12 seconds duration 28 | unsigned short frequency; // FIXED 8.8 noise frequency (low frequency is a jerk,high frequency is a rumble) 29 | } ScreenShake; 30 | 31 | extern void V_ApplyShake( float *origin, float *angles, float factor ); 32 | extern void V_CalcShake( void ); 33 | extern int V_ScreenShake( const char *pszName, int iSize, void *pbuf ); 34 | extern int V_ScreenFade( const char *pszName, int iSize, void *pbuf ); 35 | 36 | 37 | // Fade in/out 38 | extern int gmsgFade; 39 | 40 | #define FFADE_IN 0x0000 // Just here so we don't pass 0 into the function 41 | #define FFADE_OUT 0x0001 // Fade out (not in) 42 | #define FFADE_MODULATE 0x0002 // Modulate (don't blend) 43 | #define FFADE_STAYOUT 0x0004 // ignores the duration, stays faded out until new ScreenFade message received 44 | 45 | // This structure is sent over the net to describe a screen fade event 46 | typedef struct 47 | { 48 | unsigned short duration; // FIXED 4.12 seconds duration 49 | unsigned short holdTime; // FIXED 4.12 seconds duration until reset (fade & hold) 50 | short fadeFlags; // flags 51 | byte r, g, b, a; // fade to color ( max alpha ) 52 | } ScreenFade; 53 | 54 | #endif // SHAKE_H 55 | 56 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/event_api.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( EVENT_APIH ) 16 | #define EVENT_APIH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | #define EVENT_API_VERSION 1 22 | 23 | typedef struct event_api_s 24 | { 25 | int version; 26 | void ( *EV_PlaySound ) ( int ent, float *origin, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch ); 27 | void ( *EV_StopSound ) ( int ent, int channel, const char *sample ); 28 | int ( *EV_FindModelIndex )( const char *pmodel ); 29 | int ( *EV_IsLocal ) ( int playernum ); 30 | int ( *EV_LocalPlayerDucking ) ( void ); 31 | void ( *EV_LocalPlayerViewheight ) ( float * ); 32 | void ( *EV_LocalPlayerBounds ) ( int hull, float *mins, float *maxs ); 33 | int ( *EV_IndexFromTrace) ( struct pmtrace_s *pTrace ); 34 | struct physent_s *( *EV_GetPhysent ) ( int idx ); 35 | void ( *EV_SetUpPlayerPrediction ) ( int dopred, int bIncludeLocalClient ); 36 | void ( *EV_PushPMStates ) ( void ); 37 | void ( *EV_PopPMStates ) ( void ); 38 | void ( *EV_SetSolidPlayers ) (int playernum); 39 | void ( *EV_SetTraceHull ) ( int hull ); 40 | void ( *EV_PlayerTrace ) ( float *start, float *end, int traceFlags, int ignore_pe, struct pmtrace_s *tr ); 41 | void ( *EV_WeaponAnimation ) ( int sequence, int body ); 42 | unsigned short ( *EV_PrecacheEvent ) ( int type, const char* psz ); 43 | void ( *EV_PlaybackEvent ) ( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); 44 | const char *( *EV_TraceTexture ) ( int ground, float *vstart, float *vend ); 45 | void ( *EV_StopAllSounds ) ( int entnum, int entchannel ); 46 | void ( *EV_KillEvents ) ( int entnum, const char *eventname ); 47 | } event_api_t; 48 | 49 | extern event_api_t eventapi; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/progs.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef PROGS_H 16 | #define PROGS_H 17 | 18 | #include "progdefs.h" 19 | 20 | // 16 simultaneous events, max 21 | #define MAX_EVENT_QUEUE 64 22 | 23 | #define DEFAULT_EVENT_RESENDS 1 24 | 25 | #include "event_flags.h" 26 | 27 | typedef struct event_info_s event_info_t; 28 | 29 | #include "event_args.h" 30 | 31 | struct event_info_s 32 | { 33 | unsigned short index; // 0 implies not in use 34 | 35 | short packet_index; // Use data from state info for entity in delta_packet . -1 implies separate info based on event 36 | // parameter signature 37 | short entity_index; // The edict this event is associated with 38 | 39 | float fire_time; // if non-zero, the time when the event should be fired ( fixed up on the client ) 40 | 41 | event_args_t args; 42 | 43 | // CLIENT ONLY 44 | int flags; // Reliable or not, etc. 45 | 46 | }; 47 | 48 | typedef struct event_state_s event_state_t; 49 | 50 | struct event_state_s 51 | { 52 | struct event_info_s ei[ MAX_EVENT_QUEUE ]; 53 | }; 54 | 55 | #if !defined( ENTITY_STATEH ) 56 | #include "entity_state.h" 57 | #endif 58 | 59 | #if !defined( EDICT_H ) 60 | #include "edict.h" 61 | #endif 62 | 63 | #define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (int)&(((t *)0)->m))) 64 | #define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area) 65 | 66 | //============================================================================ 67 | 68 | extern char *pr_strings; 69 | extern globalvars_t gGlobalVariables; 70 | 71 | //============================================================================ 72 | 73 | edict_t *ED_Alloc (void); 74 | void ED_Free (edict_t *ed); 75 | void ED_LoadFromFile (char *data); 76 | 77 | edict_t *EDICT_NUM(int n); 78 | int NUM_FOR_EDICT(const edict_t *e); 79 | 80 | #define PROG_TO_EDICT(e) ((edict_t *)((byte *)sv.edicts + e)) 81 | 82 | #endif // PROGS_H -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/keydefs.h: -------------------------------------------------------------------------------- 1 | // keydefs.h 2 | #ifndef KEYDEFS_H 3 | #define KEYDEFS_H 4 | #ifdef _WIN32 5 | #pragma once 6 | #endif 7 | 8 | // 9 | // these are the key numbers that should be passed to Key_Event 10 | // 11 | #define K_TAB 9 12 | #define K_ENTER 13 13 | #define K_ESCAPE 27 14 | #define K_SPACE 32 15 | 16 | // normal keys should be passed as lowercased ascii 17 | 18 | #define K_BACKSPACE 127 19 | #define K_UPARROW 128 20 | #define K_DOWNARROW 129 21 | #define K_LEFTARROW 130 22 | #define K_RIGHTARROW 131 23 | 24 | #define K_ALT 132 25 | #define K_CTRL 133 26 | #define K_SHIFT 134 27 | #define K_F1 135 28 | #define K_F2 136 29 | #define K_F3 137 30 | #define K_F4 138 31 | #define K_F5 139 32 | #define K_F6 140 33 | #define K_F7 141 34 | #define K_F8 142 35 | #define K_F9 143 36 | #define K_F10 144 37 | #define K_F11 145 38 | #define K_F12 146 39 | #define K_INS 147 40 | #define K_DEL 148 41 | #define K_PGDN 149 42 | #define K_PGUP 150 43 | #define K_HOME 151 44 | #define K_END 152 45 | 46 | #define K_KP_HOME 160 47 | #define K_KP_UPARROW 161 48 | #define K_KP_PGUP 162 49 | #define K_KP_LEFTARROW 163 50 | #define K_KP_5 164 51 | #define K_KP_RIGHTARROW 165 52 | #define K_KP_END 166 53 | #define K_KP_DOWNARROW 167 54 | #define K_KP_PGDN 168 55 | #define K_KP_ENTER 169 56 | #define K_KP_INS 170 57 | #define K_KP_DEL 171 58 | #define K_KP_SLASH 172 59 | #define K_KP_MINUS 173 60 | #define K_KP_PLUS 174 61 | #define K_CAPSLOCK 175 62 | 63 | 64 | // 65 | // joystick buttons 66 | // 67 | #define K_JOY1 203 68 | #define K_JOY2 204 69 | #define K_JOY3 205 70 | #define K_JOY4 206 71 | 72 | // 73 | // aux keys are for multi-buttoned joysticks to generate so they can use 74 | // the normal binding process 75 | // 76 | #define K_AUX1 207 77 | #define K_AUX2 208 78 | #define K_AUX3 209 79 | #define K_AUX4 210 80 | #define K_AUX5 211 81 | #define K_AUX6 212 82 | #define K_AUX7 213 83 | #define K_AUX8 214 84 | #define K_AUX9 215 85 | #define K_AUX10 216 86 | #define K_AUX11 217 87 | #define K_AUX12 218 88 | #define K_AUX13 219 89 | #define K_AUX14 220 90 | #define K_AUX15 221 91 | #define K_AUX16 222 92 | #define K_AUX17 223 93 | #define K_AUX18 224 94 | #define K_AUX19 225 95 | #define K_AUX20 226 96 | #define K_AUX21 227 97 | #define K_AUX22 228 98 | #define K_AUX23 229 99 | #define K_AUX24 230 100 | #define K_AUX25 231 101 | #define K_AUX26 232 102 | #define K_AUX27 233 103 | #define K_AUX28 234 104 | #define K_AUX29 235 105 | #define K_AUX30 236 106 | #define K_AUX31 237 107 | #define K_AUX32 238 108 | #define K_MWHEELDOWN 239 109 | #define K_MWHEELUP 240 110 | 111 | #define K_PAUSE 255 112 | 113 | // 114 | // mouse buttons generate virtual keys 115 | // 116 | #define K_MOUSE1 241 117 | #define K_MOUSE2 242 118 | #define K_MOUSE3 243 119 | #define K_MOUSE4 244 120 | #define K_MOUSE5 245 121 | 122 | #endif // KEYDEFS_H 123 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/net_api.h: -------------------------------------------------------------------------------- 1 | #if !defined( NET_APIH ) 2 | #define NET_APIH 3 | #ifdef _WIN32 4 | #pragma once 5 | #endif 6 | 7 | #if !defined ( NETADRH ) 8 | #include "netadr.h" 9 | #endif 10 | 11 | #define NETAPI_REQUEST_SERVERLIST ( 0 ) // Doesn't need a remote address 12 | #define NETAPI_REQUEST_PING ( 1 ) 13 | #define NETAPI_REQUEST_RULES ( 2 ) 14 | #define NETAPI_REQUEST_PLAYERS ( 3 ) 15 | #define NETAPI_REQUEST_DETAILS ( 4 ) 16 | 17 | // Set this flag for things like broadcast requests, etc. where the engine should not 18 | // kill the request hook after receiving the first response 19 | #define FNETAPI_MULTIPLE_RESPONSE ( 1<<0 ) 20 | 21 | typedef void ( *net_api_response_func_t ) ( struct net_response_s *response ); 22 | 23 | #define NET_SUCCESS ( 0 ) 24 | #define NET_ERROR_TIMEOUT ( 1<<0 ) 25 | #define NET_ERROR_PROTO_UNSUPPORTED ( 1<<1 ) 26 | #define NET_ERROR_UNDEFINED ( 1<<2 ) 27 | 28 | typedef struct net_adrlist_s 29 | { 30 | struct net_adrlist_s *next; 31 | netadr_t remote_address; 32 | } net_adrlist_t; 33 | 34 | typedef struct net_response_s 35 | { 36 | // NET_SUCCESS or an error code 37 | int error; 38 | 39 | // Context ID 40 | int context; 41 | // Type 42 | int type; 43 | 44 | // Server that is responding to the request 45 | netadr_t remote_address; 46 | 47 | // Response RTT ping time 48 | double ping; 49 | // Key/Value pair string ( separated by backlash \ characters ) 50 | // WARNING: You must copy this buffer in the callback function, because it is freed 51 | // by the engine right after the call!!!! 52 | // ALSO: For NETAPI_REQUEST_SERVERLIST requests, this will be a pointer to a linked list of net_adrlist_t's 53 | void *response; 54 | } net_response_t; 55 | 56 | typedef struct net_status_s 57 | { 58 | // Connected to remote server? 1 == yes, 0 otherwise 59 | int connected; 60 | // Client's IP address 61 | netadr_t local_address; 62 | // Address of remote server 63 | netadr_t remote_address; 64 | // Packet Loss ( as a percentage ) 65 | int packet_loss; 66 | // Latency, in seconds ( multiply by 1000.0 to get milliseconds ) 67 | double latency; 68 | // Connection time, in seconds 69 | double connection_time; 70 | // Rate setting ( for incoming data ) 71 | double rate; 72 | } net_status_t; 73 | 74 | typedef struct net_api_s 75 | { 76 | // APIs 77 | void ( *InitNetworking )( void ); 78 | void ( *Status ) ( struct net_status_s *status ); 79 | void ( *SendRequest) ( int context, int request, int flags, double timeout, struct netadr_s *remote_address, net_api_response_func_t response ); 80 | void ( *CancelRequest ) ( int context ); 81 | void ( *CancelAllRequests ) ( void ); 82 | char *( *AdrToString ) ( struct netadr_s *a ); 83 | int ( *CompareAdr ) ( struct netadr_s *a, struct netadr_s *b ); 84 | int ( *StringToAdr ) ( char *s, struct netadr_s *a ); 85 | const char *( *ValueForKey ) ( const char *s, const char *key ); 86 | void ( *RemoveKey ) ( char *s, const char *key ); 87 | void ( *SetValueForKey ) (char *s, const char *key, const char *value, int maxsize ); 88 | } net_api_t; 89 | 90 | extern net_api_t netapi; 91 | 92 | #endif // NET_APIH -------------------------------------------------------------------------------- /RobinBot/SetupHooks.cpp: -------------------------------------------------------------------------------- 1 | #include "SetupHooks.h" 2 | #include "Command.h" 3 | #include "Client.h" 4 | #include "detours.h" 5 | 6 | int SetupHooks::AddCommand(char *cmd_name,void(*function)(void)) 7 | { 8 | return 0; 9 | } 10 | 11 | cvar_t* SetupHooks::RegisterVariable (char *szName,char *szValue, int flags) 12 | { 13 | cvar_t* pResult = g_Engine.pfnGetCvarPointer(szName); 14 | if(pResult != NULL) 15 | return pResult; 16 | return g_Engine.pfnRegisterVariable(szName, szValue, flags); 17 | } 18 | 19 | DWORD SetupHooks::StartFunc(LPSTARTUP_PARAM pStartup) 20 | { 21 | SetupHooks* pClass = pStartup->pClass; 22 | LPTHREAD_METHOD pMethod = pStartup->pMethod; 23 | LPVOID pParam = pStartup->pParam; 24 | DWORD dwResult = (pClass->*pMethod)(pParam); 25 | delete pStartup; 26 | return dwResult; 27 | } 28 | 29 | void SetupHooks::StartThread(LPTHREAD_METHOD pMethod, LPVOID pParam, 30 | LPDWORD pdwThreadID /* = NULL */, 31 | LPSECURITY_ATTRIBUTES pSecurity /* = NULL */, 32 | DWORD dwStackSize /* = 0 */, 33 | DWORD dwFlags /* = 0 */) 34 | { 35 | LPSTARTUP_PARAM pStartup = new STARTUP_PARAM; 36 | pStartup->pClass = this; 37 | pStartup->pMethod = pMethod; 38 | pStartup->pParam = pParam; 39 | CreateThread(pSecurity, dwStackSize, (LPTHREAD_START_ROUTINE)StartFunc, pStartup, dwFlags, pdwThreadID); 40 | } 41 | 42 | DWORD SetupHooks::Initialize(LPVOID pParam) 43 | { 44 | Client* pClient = new Client; 45 | AutoOffset* Offset = new AutoOffset; 46 | 47 | while ( !Offset->GetRendererInfo() ) 48 | Sleep(90); 49 | 50 | for (int i = 0;i < 10;i++) 51 | { 52 | g_pClient = (cl_clientfunc_t*)Offset->ClientFuncs(); 53 | g_pEngine = (cl_enginefunc_t*)Offset->EngineFuncs(); 54 | if(g_pClient && g_pEngine) 55 | goto Return; 56 | } 57 | Offset->Error("Couldn't find default scanning pattern."); 58 | 59 | Return: 60 | 61 | g_pStudio = (engine_studio_api_t*)Offset->EngineStudio(); 62 | 63 | Sleep(500); 64 | 65 | if(!g_pClient || !g_pEngine || !g_pStudio) 66 | Offset->Error("OFFSET ERROR #1"); 67 | 68 | RtlCopyMemory(&g_Engine, g_pEngine, sizeof(cl_enginefunc_t)); 69 | RtlCopyMemory(&g_Studio, g_pStudio, sizeof(engine_studio_api_t)); 70 | RtlCopyMemory(&g_Client, g_pClient, sizeof(cl_clientfunc_t)); 71 | 72 | pClient->HookClient(); 73 | 74 | Sleep(500); 75 | 76 | g_pEngine->pfnAddCommand = &AddCommand; 77 | g_pEngine->pfnRegisterVariable = &RegisterVariable; 78 | g_pEngine->pfnHookUserMsg = &pfnHookUserMsg; 79 | 80 | Command* pCmd = new Command; 81 | pcmd_t cmd = pCmd->CommandByName("cmd"); 82 | pCmd->EnDsCommand(cmd,false); // Fix - Can't "cmd", not connected 83 | 84 | g_Client.Initialize(g_pEngine, CLDLL_INTERFACE_VERSION); 85 | g_Client.HUD_Init(); 86 | 87 | pCmd->EnDsCommand(cmd,true); 88 | 89 | g_pEngine->pfnAddCommand = g_Engine.pfnAddCommand; 90 | g_pEngine->pfnRegisterVariable = g_Engine.pfnRegisterVariable; 91 | g_pEngine->pfnHookUserMsg = g_Engine.pfnHookUserMsg; 92 | 93 | Sleep(500); 94 | 95 | pClient->HookEngine(); 96 | pClient->HookStudio(); 97 | 98 | delete pCmd; 99 | delete Offset; 100 | delete pClient; 101 | 102 | return 0; 103 | } -------------------------------------------------------------------------------- /RobinBot/ValveSDK/misc/parsemsg.cpp: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // 16 | // parsemsg.cpp 17 | // 18 | typedef unsigned char byte; 19 | #define true 1 20 | 21 | static byte *gpBuf; 22 | static int giSize; 23 | static int giRead; 24 | static int giBadRead; 25 | 26 | void BEGIN_READ( void *buf, int size ) 27 | { 28 | giRead = 0; 29 | giBadRead = 0; 30 | giSize = size; 31 | gpBuf = (byte*)buf; 32 | } 33 | 34 | 35 | int READ_CHAR( void ) 36 | { 37 | int c; 38 | 39 | if (giRead + 1 > giSize) 40 | { 41 | giBadRead = true; 42 | return -1; 43 | } 44 | 45 | c = (signed char)gpBuf[giRead]; 46 | giRead++; 47 | 48 | return c; 49 | } 50 | 51 | int READ_BYTE( void ) 52 | { 53 | int c; 54 | 55 | if (giRead+1 > giSize) 56 | { 57 | giBadRead = true; 58 | return -1; 59 | } 60 | 61 | c = (unsigned char)gpBuf[giRead]; 62 | giRead++; 63 | 64 | return c; 65 | } 66 | 67 | int READ_SHORT( void ) 68 | { 69 | int c; 70 | 71 | if (giRead+2 > giSize) 72 | { 73 | giBadRead = true; 74 | return -1; 75 | } 76 | 77 | c = (short)( gpBuf[giRead] + ( gpBuf[giRead+1] << 8 ) ); 78 | 79 | giRead += 2; 80 | 81 | return c; 82 | } 83 | 84 | int READ_WORD( void ) 85 | { 86 | return READ_SHORT(); 87 | } 88 | 89 | 90 | int READ_LONG( void ) 91 | { 92 | int c; 93 | 94 | if (giRead+4 > giSize) 95 | { 96 | giBadRead = true; 97 | return -1; 98 | } 99 | 100 | c = gpBuf[giRead] + (gpBuf[giRead + 1] << 8) + (gpBuf[giRead + 2] << 16) + (gpBuf[giRead + 3] << 24); 101 | 102 | giRead += 4; 103 | 104 | return c; 105 | } 106 | 107 | float READ_FLOAT( void ) 108 | { 109 | union 110 | { 111 | byte b[4]; 112 | float f; 113 | int l; 114 | } dat; 115 | 116 | dat.b[0] = gpBuf[giRead]; 117 | dat.b[1] = gpBuf[giRead+1]; 118 | dat.b[2] = gpBuf[giRead+2]; 119 | dat.b[3] = gpBuf[giRead+3]; 120 | giRead += 4; 121 | 122 | // dat.l = LittleLong (dat.l); 123 | 124 | return dat.f; 125 | } 126 | 127 | char* READ_STRING( void ) 128 | { 129 | static char string[2048]; 130 | int l,c; 131 | 132 | string[0] = 0; 133 | 134 | l = 0; 135 | do 136 | { 137 | if ( giRead+1 > giSize ) 138 | break; // no more characters 139 | 140 | c = READ_CHAR(); 141 | if (c == -1 || c == 0) 142 | break; 143 | string[l] = c; 144 | l++; 145 | } while (l < sizeof(string)-1); 146 | 147 | string[l] = 0; 148 | 149 | return string; 150 | } 151 | 152 | float READ_COORD( void ) 153 | { 154 | return (float)(READ_SHORT() * (1.0/8)); 155 | } 156 | 157 | float READ_ANGLE( void ) 158 | { 159 | return (float)(READ_CHAR() * (360.0/256)); 160 | } 161 | 162 | float READ_HIRESANGLE( void ) 163 | { 164 | return (float)(READ_SHORT() * (360.0/65536)); 165 | } 166 | 167 | -------------------------------------------------------------------------------- /RobinBot/cvar.cpp: -------------------------------------------------------------------------------- 1 | #include "Main.h" 2 | 3 | CVARlist cvar; 4 | 5 | #pragma warning(disable:4244) 6 | 7 | void func_alias() 8 | { 9 | const char* name = cmd.argC(1); 10 | string& content = cmd.argS(2); 11 | cmd.AddAlias(name,content); 12 | } 13 | 14 | void set_cvar() 15 | { 16 | char set_cvars[56]; 17 | if ( cmd.names.find(g_Engine.Cmd_Argv(1)) ) 18 | { 19 | sprintf(set_cvars,"%s %s",g_Engine.Cmd_Argv(1),g_Engine.Cmd_Argv(2)); 20 | cmd.exec(set_cvars); 21 | } 22 | else 23 | cmd.exec(g_Engine.Cmd_Argv(1)); 24 | } 25 | 26 | void CVARlist::init() 27 | { 28 | 29 | memset((char*)this, 0, sizeof(*this)); 30 | #define REGISTER_CVAR_FLOAT(name,defaultvalue) cmd.AddCvarFloat(#name, &##name );name=defaultvalue##f; 31 | #define REGISTER_CVAR_INT(name,defaultvalue) cmd.AddCvarInt(#name, &##name );name=defaultvalue; 32 | #define REGISTER_CVAR_STR(name,defaultvalue) cmd.AddCvarString(#name, &##name );name=defaultvalue; 33 | #define REGISTER_COMMAND(name) cmd.AddCommand( #name, func_##name); 34 | 35 | //Otomatik ayarlar 36 | 37 | REGISTER_CVAR_INT(aim_active, 1) 38 | REGISTER_CVAR_INT(aim_target, 10) 39 | REGISTER_CVAR_FLOAT(aim_height, 0.20) 40 | REGISTER_CVAR_INT(aim_autowall, 0) 41 | REGISTER_CVAR_INT(aim_fov, 35) 42 | REGISTER_CVAR_INT(aim_distancebasedfov, 1) 43 | REGISTER_CVAR_INT(aim_avdraw, 1) 44 | REGISTER_CVAR_INT(aim_prediction, 1) 45 | REGISTER_CVAR_INT(aim_time, 300) 46 | REGISTER_CVAR_INT(aim_delay, 0) 47 | REGISTER_CVAR_INT(aim_smoothness, 1) 48 | REGISTER_CVAR_INT(bhop, 1) 49 | //REGISTER_CVAR_INT(esp_barel, 0) 50 | REGISTER_CVAR_INT(aim_triggerbot, 1) 51 | REGISTER_CVAR_INT(aim_triggerbot_fov, 11) 52 | 53 | REGISTER_COMMAND(alias) 54 | 55 | g_Engine.pfnAddCommand("set",set_cvar); 56 | } 57 | 58 | void HlEngineCommand(const char* command) 59 | { 60 | if(!g_Engine.pfnClientCmd) { return; } 61 | g_Engine.pfnClientCmd( const_cast(command) ); 62 | } 63 | 64 | void HandleCvarInt(char* name, int* value) 65 | { 66 | char* arg1 = cmd.argC(1); 67 | if (!strcmp(arg1,"change")) 68 | { 69 | if(*value) *value=0; 70 | else *value=1; 71 | return; 72 | } 73 | if (!strcmp(arg1,"up")){*value += cmd.argI(2);return;} 74 | if (!strcmp(arg1,"down")){*value -= cmd.argI(2);return;} 75 | if (!strcmp(arg1,"hide")){*value = cmd.argI(2);return;} 76 | if (!*arg1) 77 | { 78 | g_Engine.Con_Printf( "CVAR %s = %i\n",name,*value); 79 | return; 80 | } 81 | *value = cmd.argI(1); 82 | } 83 | 84 | void HandleCvarStr(char* name, string value) 85 | { 86 | char* arg1 = cmd.argC(1); 87 | if (!*arg1) 88 | { 89 | g_Engine.Con_Printf("CVAR %s = %s\n", name, value.c_str()); 90 | return; 91 | } 92 | value = cmd.argF(1); 93 | } 94 | 95 | void HandleCvarFloat(char* name, float* value) 96 | { 97 | char* arg1 = cmd.argC(1); 98 | if (!strcmp(arg1,"change")) 99 | { 100 | if(*value) *value=0; 101 | else *value=1; 102 | return; 103 | } 104 | if (!strcmp(arg1,"up")){*value += cmd.argF(2);return;} 105 | if (!strcmp(arg1,"down")){*value -= cmd.argF(2);return;} 106 | if (!strcmp(arg1,"hide")){*value = cmd.argI(2);return;} 107 | if (!*arg1) 108 | { 109 | g_Engine.Con_Printf("CVAR %s = %f\n",name,*value); 110 | return; 111 | } 112 | *value = cmd.argF(1); 113 | } 114 | 115 | bool isHlCvar(char* name) 116 | { 117 | if(!g_Engine.pfnGetCvarPointer) { return false; } 118 | cvar_s* test = g_Engine.pfnGetCvarPointer(name); 119 | return (test!=NULL); 120 | } 121 | 122 | bool HandleHlCvar(char* name) 123 | { 124 | if(!g_Engine.pfnGetCvarPointer) { return false; } 125 | cvar_s* ptr = g_Engine.pfnGetCvarPointer(name); 126 | if(!ptr) { return false; } 127 | HandleCvarFloat(name,&ptr->value); 128 | return true; 129 | } -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/cl_entity.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // cl_entity.h 16 | #if !defined( CL_ENTITYH ) 17 | #define CL_ENTITYH 18 | #ifdef _WIN32 19 | #pragma once 20 | #endif 21 | 22 | typedef struct efrag_s 23 | { 24 | struct mleaf_s *leaf; 25 | struct efrag_s *leafnext; 26 | struct cl_entity_s *entity; 27 | struct efrag_s *entnext; 28 | } efrag_t; 29 | 30 | typedef struct 31 | { 32 | byte mouthopen; // 0 = mouth closed, 255 = mouth agape 33 | byte sndcount; // counter for running average 34 | int sndavg; // running average 35 | } mouth_t; 36 | 37 | typedef struct 38 | { 39 | float prevanimtime; 40 | float sequencetime; 41 | byte prevseqblending[2]; 42 | vec3_t prevorigin; 43 | vec3_t prevangles; 44 | 45 | int prevsequence; 46 | float prevframe; 47 | 48 | byte prevcontroller[4]; 49 | byte prevblending[2]; 50 | } latchedvars_t; 51 | 52 | typedef struct 53 | { 54 | // Time stamp for this movement 55 | float animtime; 56 | 57 | vec3_t origin; 58 | vec3_t angles; 59 | } position_history_t; 60 | 61 | typedef struct cl_entity_s cl_entity_t; 62 | 63 | #define HISTORY_MAX 64 // Must be power of 2 64 | #define HISTORY_MASK ( HISTORY_MAX - 1 ) 65 | 66 | 67 | #if !defined( ENTITY_STATEH ) 68 | #include "entity_state.h" 69 | #endif 70 | 71 | #if !defined( PROGS_H ) 72 | #include "progs.h" 73 | #endif 74 | 75 | struct cl_entity_s 76 | { 77 | int index; // Index into cl_entities ( should match actual slot, but not necessarily ) 78 | 79 | qboolean player; // True if this entity is a "player" 80 | 81 | entity_state_t baseline; // The original state from which to delta during an uncompressed message 82 | entity_state_t prevstate; // The state information from the penultimate message received from the server 83 | entity_state_t curstate; // The state information from the last message received from server 84 | 85 | int current_position; // Last received history update index 86 | position_history_t ph[ HISTORY_MAX ]; // History of position and angle updates for this player 87 | 88 | mouth_t mouth; // For synchronizing mouth movements. 89 | 90 | latchedvars_t latched; // Variables used by studio model rendering routines 91 | 92 | // Information based on interplocation, extrapolation, prediction, or just copied from last msg received. 93 | // 94 | float lastmove; 95 | 96 | // Actual render position and angles 97 | vec3_t origin; 98 | vec3_t angles; 99 | 100 | // Attachment points 101 | vec3_t attachment[4]; 102 | 103 | // Other entity local information 104 | int trivial_accept; 105 | 106 | struct model_s *model; // cl.model_precache[ curstate.modelindes ]; all visible entities have a model 107 | struct efrag_s *efrag; // linked list of efrags 108 | struct mnode_s *topnode; // for bmodels, first world node that splits bmodel, or NULL if not split 109 | 110 | float syncbase; // for client-side animations -- used by obsolete alias animation system, remove? 111 | int visframe; // last frame this entity was found in an active leaf 112 | colorVec cvFloorColor; 113 | }; 114 | 115 | #endif // !CL_ENTITYH -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/cl_entity.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // cl_entity.h 16 | #if !defined( CL_ENTITYH ) 17 | #define CL_ENTITYH 18 | #ifdef _WIN32 19 | #pragma once 20 | #endif 21 | 22 | typedef struct efrag_s 23 | { 24 | struct mleaf_s *leaf; 25 | struct efrag_s *leafnext; 26 | struct cl_entity_s *entity; 27 | struct efrag_s *entnext; 28 | } efrag_t; 29 | 30 | typedef struct 31 | { 32 | byte mouthopen; // 0 = mouth closed, 255 = mouth agape 33 | byte sndcount; // counter for running average 34 | int sndavg; // running average 35 | } mouth_t; 36 | 37 | typedef struct 38 | { 39 | float prevanimtime; 40 | float sequencetime; 41 | byte prevseqblending[2]; 42 | vec3_t prevorigin; 43 | vec3_t prevangles; 44 | 45 | int prevsequence; 46 | float prevframe; 47 | 48 | byte prevcontroller[4]; 49 | byte prevblending[2]; 50 | } latchedvars_t; 51 | 52 | typedef struct 53 | { 54 | // Time stamp for this movement 55 | float animtime; 56 | 57 | vec3_t origin; 58 | vec3_t angles; 59 | } position_history_t; 60 | 61 | typedef struct cl_entity_s cl_entity_t; 62 | 63 | #define HISTORY_MAX 64 // Must be power of 2 64 | #define HISTORY_MASK ( HISTORY_MAX - 1 ) 65 | 66 | 67 | #if !defined( ENTITY_STATEH ) 68 | #include "entity_state.h" 69 | #endif 70 | 71 | #if !defined( PROGS_H ) 72 | #include "progs.h" 73 | #endif 74 | 75 | struct cl_entity_s 76 | { 77 | int index; // Index into cl_entities ( should match actual slot, but not necessarily ) 78 | 79 | qboolean player; // True if this entity is a "player" 80 | 81 | entity_state_t baseline; // The original state from which to delta during an uncompressed message 82 | entity_state_t prevstate; // The state information from the penultimate message received from the server 83 | entity_state_t curstate; // The state information from the last message received from server 84 | 85 | int current_position; // Last received history update index 86 | position_history_t ph[ HISTORY_MAX ]; // History of position and angle updates for this player 87 | 88 | mouth_t mouth; // For synchronizing mouth movements. 89 | 90 | latchedvars_t latched; // Variables used by studio model rendering routines 91 | 92 | // Information based on interplocation, extrapolation, prediction, or just copied from last msg received. 93 | // 94 | float lastmove; 95 | 96 | // Actual render position and angles 97 | vec3_t origin; 98 | vec3_t angles; 99 | 100 | // Attachment points 101 | vec3_t attachment[4]; 102 | 103 | // Other entity local information 104 | int trivial_accept; 105 | 106 | struct model_s *model; // cl.model_precache[ curstate.modelindes ]; all visible entities have a model 107 | struct efrag_s *efrag; // linked list of efrags 108 | struct mnode_s *topnode; // for bmodels, first world node that splits bmodel, or NULL if not split 109 | 110 | float syncbase; // for client-side animations -- used by obsolete alias animation system, remove? 111 | int visframe; // last frame this entity was found in an active leaf 112 | colorVec cvFloorColor; 113 | }; 114 | 115 | #endif // !CL_ENTITYH 116 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/interface.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "interface.h" 5 | 6 | #ifndef _WIN32 // LINUX 7 | #include 8 | #endif 9 | 10 | 11 | // ------------------------------------------------------------------------------------ // 12 | // InterfaceReg. 13 | // ------------------------------------------------------------------------------------ // 14 | InterfaceReg *InterfaceReg::s_pInterfaceRegs = NULL; 15 | 16 | 17 | InterfaceReg::InterfaceReg( InstantiateInterfaceFn fn, const char *pName ) : 18 | m_pName(pName) 19 | { 20 | m_CreateFn = fn; 21 | m_pNext = s_pInterfaceRegs; 22 | s_pInterfaceRegs = this; 23 | } 24 | 25 | 26 | 27 | // ------------------------------------------------------------------------------------ // 28 | // CreateInterface. 29 | // ------------------------------------------------------------------------------------ // 30 | IBaseInterface *CreateInterface( const char *pName, int *pReturnCode ) 31 | { 32 | InterfaceReg *pCur; 33 | 34 | for(pCur=InterfaceReg::s_pInterfaceRegs; pCur; pCur=pCur->m_pNext) 35 | { 36 | if(strcmp(pCur->m_pName, pName) == 0) 37 | { 38 | if ( pReturnCode ) 39 | { 40 | *pReturnCode = IFACE_OK; 41 | } 42 | return pCur->m_CreateFn(); 43 | } 44 | } 45 | 46 | if ( pReturnCode ) 47 | { 48 | *pReturnCode = IFACE_FAILED; 49 | } 50 | return NULL; 51 | } 52 | 53 | 54 | #ifdef _WIN32 55 | #define WIN32_LEAN_AND_MEAN 56 | #include "windows.h" 57 | #endif 58 | 59 | 60 | #ifdef _WIN32 61 | HINTERFACEMODULE Sys_LoadModule(const char *pModuleName) 62 | { 63 | return (HINTERFACEMODULE)LoadLibrary((LPWSTR)pModuleName); 64 | } 65 | 66 | #else // LINUX 67 | HINTERFACEMODULE Sys_LoadModule(const char *pModuleName) 68 | { 69 | // Linux dlopen() doesn't look in the current directory for libraries. 70 | // We tell it to, so people don't have to 'install' libraries as root. 71 | 72 | char szCwd[1024]; 73 | char szAbsoluteLibFilename[1024]; 74 | 75 | getcwd( szCwd, sizeof( szCwd ) ); 76 | if ( szCwd[ strlen( szCwd ) - 1 ] == '/' ) 77 | szCwd[ strlen( szCwd ) - 1 ] = 0; 78 | 79 | sprintf( szAbsoluteLibFilename, "%s/%s", szCwd, pModuleName ); 80 | 81 | return (HINTERFACEMODULE)dlopen( szAbsoluteLibFilename, RTLD_NOW ); 82 | } 83 | 84 | #endif 85 | 86 | 87 | #ifdef _WIN32 88 | void Sys_FreeModule(HINTERFACEMODULE hModule) 89 | { 90 | if(!hModule) 91 | return; 92 | 93 | FreeLibrary((HMODULE)hModule); 94 | } 95 | 96 | #else // LINUX 97 | void Sys_FreeModule(HINTERFACEMODULE hModule) 98 | { 99 | if(!hModule) 100 | return; 101 | 102 | dlclose( (void *)hModule ); 103 | } 104 | 105 | #endif 106 | 107 | 108 | //----------------------------------------------------------------------------- 109 | // Purpose: returns the instance of this module 110 | // Output : interface_instance_t 111 | //----------------------------------------------------------------------------- 112 | CreateInterfaceFn Sys_GetFactoryThis( void ) 113 | { 114 | return CreateInterface; 115 | } 116 | 117 | 118 | //----------------------------------------------------------------------------- 119 | // Purpose: returns the instance of the named module 120 | // Input : *pModuleName - name of the module 121 | // Output : interface_instance_t - instance of that module 122 | //----------------------------------------------------------------------------- 123 | 124 | #ifdef _WIN32 125 | CreateInterfaceFn Sys_GetFactory( HINTERFACEMODULE hModule ) 126 | { 127 | if(!hModule) 128 | return NULL; 129 | 130 | return (CreateInterfaceFn)GetProcAddress((HMODULE)hModule, CREATEINTERFACE_PROCNAME); 131 | } 132 | 133 | #else // LINUX 134 | CreateInterfaceFn Sys_GetFactory( HINTERFACEMODULE hModule ) 135 | { 136 | if(!hModule) 137 | return NULL; 138 | 139 | return dlsym( (void *)hModule, CREATEINTERFACE_PROCNAME ); 140 | } 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/custom.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // Customization.h 16 | 17 | #ifndef CUSTOM_H 18 | #define CUSTOM_H 19 | #ifdef _WIN32 20 | #pragma once 21 | #endif 22 | 23 | #include "const.h" 24 | 25 | #define MAX_QPATH 64 // Must match value in quakedefs.h 26 | 27 | ///////////////// 28 | // Customization 29 | // passed to pfnPlayerCustomization 30 | // For automatic downloading. 31 | typedef enum 32 | { 33 | t_sound = 0, 34 | t_skin, 35 | t_model, 36 | t_decal, 37 | t_generic, 38 | t_eventscript 39 | } resourcetype_t; 40 | 41 | // Fake type for world 42 | #define t_world 6 43 | 44 | typedef struct 45 | { 46 | int size; 47 | } _resourceinfo_t; 48 | 49 | typedef struct resourceinfo_s 50 | { 51 | _resourceinfo_t info[ 7 ]; 52 | } resourceinfo_t; 53 | 54 | #define RES_FATALIFMISSING (1<<0) // Disconnect if we can't get this file. 55 | #define RES_WASMISSING (1<<1) // Do we have the file locally, did we get it ok? 56 | #define RES_CUSTOM (1<<2) // Is this resource one that corresponds to another player's customization 57 | // or is it a server startup resource. 58 | #define RES_REQUESTED (1<<3) // Already requested a download of this one 59 | #define RES_PRECACHED (1<<4) // Already precached 60 | 61 | #include "crc.h" 62 | 63 | typedef struct resource_s 64 | { 65 | char szFileName[MAX_QPATH]; // File name to download/precache. 66 | resourcetype_t type; // t_sound, t_skin, t_model, t_decal. 67 | int nIndex; // For t_decals 68 | int nDownloadSize; // Size in Bytes if this must be downloaded. 69 | unsigned char ucFlags; 70 | 71 | // For handling client to client resource propagation 72 | unsigned char rgucMD5_hash[16]; // To determine if we already have it. 73 | unsigned char playernum; // Which player index this resource is associated with, if it's a custom resource. 74 | 75 | unsigned char rguc_reserved[ 32 ]; // For future expansion 76 | struct resource_s *pNext; // Next in chain. 77 | struct resource_s *pPrev; 78 | } resource_t; 79 | 80 | typedef struct customization_s 81 | { 82 | qboolean bInUse; // Is this customization in use; 83 | resource_t resource; // The resource_t for this customization 84 | qboolean bTranslated; // Has the raw data been translated into a useable format? 85 | // (e.g., raw decal .wad make into texture_t *) 86 | int nUserData1; // Customization specific data 87 | int nUserData2; // Customization specific data 88 | void *pInfo; // Buffer that holds the data structure that references the data (e.g., the cachewad_t) 89 | void *pBuffer; // Buffer that holds the data for the customization (the raw .wad data) 90 | struct customization_s *pNext; // Next in chain 91 | } customization_t; 92 | 93 | #define FCUST_FROMHPAK ( 1<<0 ) 94 | #define FCUST_WIPEDATA ( 1<<1 ) 95 | #define FCUST_IGNOREINIT ( 1<<2 ) 96 | 97 | void COM_ClearCustomizationList( struct customization_s *pHead, qboolean bCleanDecals); 98 | qboolean COM_CreateCustomization( struct customization_s *pListHead, struct resource_s *pResource, int playernumber, int flags, 99 | struct customization_s **pCustomization, int *nLumps ); 100 | int COM_SizeofResourceList ( struct resource_s *pList, struct resourceinfo_s *ri ); 101 | 102 | #endif // CUSTOM_H 103 | -------------------------------------------------------------------------------- /RobinBot/players.h: -------------------------------------------------------------------------------- 1 | #ifndef __PLAYERS_H__ 2 | #define __PLAYERS_H__ 3 | 4 | #include 5 | #include "Main.h" 6 | 7 | #ifndef RADTODEG 8 | #define RADTODEG(x) (x * (180 / M_PI)) 9 | #endif 10 | 11 | typedef float TRANSFORM_MATRIX[MAXSTUDIOBONES][3][4]; 12 | typedef TRANSFORM_MATRIX *PTRANSFORM_MATRIX; 13 | 14 | typedef struct _SOUND_INFO 15 | { 16 | Vector vOrigin; 17 | DWORD dwTime; 18 | bool bValid; 19 | } 20 | SOUND_INFO, *PSOUND_INFO; 21 | 22 | typedef struct _SCREENSHOT_INFO 23 | { 24 | DWORD dwStartTime; 25 | int nCounter; 26 | } 27 | SCREENSHOT_INFO, *PSCREENSHOT_INFO; 28 | 29 | typedef enum _TEAM_INFO 30 | { 31 | TEAM_T, 32 | TEAM_CT, 33 | TEAM_SPEC, 34 | TEAM_NONE 35 | } 36 | TEAM_INFO, *PTEAM_INFO; 37 | 38 | typedef struct ME_INFO_ 39 | { 40 | TEAM_INFO eTeam; 41 | 42 | screenfade_t sScreenFade; 43 | 44 | bool bIsReloading; 45 | bool bIsGoodWeapon; 46 | 47 | char cWeapon[64]; 48 | 49 | Vector vViewOrg; 50 | Vector vViewAngles; 51 | Vector vAimAngles; 52 | Vector vPreAimAngles; 53 | 54 | bool bPanic; 55 | int nScreenShot; 56 | SCREENSHOT_INFO sAntiCheat; 57 | } 58 | ME_INFO, *PME_INFO; 59 | 60 | typedef enum _VECTOR_MODE 61 | { 62 | VM_BONE, 63 | VM_HITBOX 64 | } 65 | VECTOR_MODE, *PVECTOR_MODE; 66 | 67 | static int iSequenceInfoTable[] = 68 | { 69 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70 | 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 71 | 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 72 | 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 73 | 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 74 | 2, 0, 1, 2, 0, 0, 0, 4, 0, 4, 75 | 0, 5, 0, 5, 0, 0, 1, 1, 2, 0, 76 | 1, 1, 2, 0, 1, 0, 1, 0, 1, 2, 77 | 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 78 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 79 | 3 80 | }; 81 | 82 | class CMe // todo: derive this from cplayer 83 | { 84 | public: 85 | CMe(void); 86 | ~CMe(); 87 | void GetInfo(void); 88 | hud_player_info_t sPlayerInfo; 89 | cl_entity_t *Entity(void); 90 | PME_INFO Info(void); 91 | bool Visible(Vector *vInput); 92 | float Distance(Vector *vInput); 93 | bool IsFlashed(void); 94 | void CalcViewAngles(Vector *vOrigin, Vector *vOutput); 95 | private: 96 | cl_entity_t *p_sEnt; 97 | ME_INFO p_sInfo; 98 | ME_INFO p_sPreInfo; 99 | }; 100 | 101 | typedef struct PLAYER_INFO_ 102 | { 103 | Vector vOrigin; 104 | 105 | bool bValid; 106 | bool bIsVulnerable; 107 | 108 | float fScreen[2]; 109 | bool bIsScreen; 110 | float fBoneScreen[2]; 111 | bool bIsBoneScreen; 112 | 113 | TEAM_INFO eTeam; 114 | 115 | bool bGotBone; 116 | Vector vAimBone; 117 | 118 | SOUND_INFO sSound; 119 | SOUND_INFO sOldSound; 120 | } 121 | PLAYER_INFO, *PPLAYER_INFO; 122 | 123 | class CPlayer 124 | { 125 | public: 126 | CPlayer(void); 127 | ~CPlayer(); 128 | void GetInfo(int nID); 129 | hud_player_info_t sPlayerInfo; 130 | cl_entity_t *Entity(void); 131 | PPLAYER_INFO Info(void); 132 | bool ValidateEntity(void); 133 | float Distance(Vector *vInput); 134 | float BoneDistance(Vector *vInput); 135 | bool IsInFov(float fFov); 136 | Vector *Position(void); 137 | Vector *BonePosition(void); 138 | bool ScreenPosition(float *fOutput); 139 | bool BoneScreenPosition(float *fOutput); 140 | void GetBoneInformation(VECTOR_MODE eMode, int nNum); 141 | 142 | private: 143 | cl_entity_t *p_sEnt; 144 | PLAYER_INFO p_sInfo; 145 | }; 146 | 147 | #define MAX_VPLAYERS 33 148 | 149 | class CPlayers 150 | { 151 | public: 152 | CPlayers(void); 153 | ~CPlayers(); 154 | int Size(void); 155 | CMe *Me(void); 156 | CPlayer *Player(int i); 157 | 158 | private: 159 | CMe *p_cMe; 160 | CPlayer *p_cPlayers; 161 | }; 162 | extern CPlayers g_cPlayers; 163 | 164 | typedef struct _TARGET_INFO 165 | { 166 | float fDistance; 167 | CPlayer *cPlayer; 168 | float fScreen[2]; 169 | } 170 | TARGET_INFO, *PTARGET_INFO; 171 | 172 | typedef struct _AIMBOT_INFO 173 | { 174 | TARGET_INFO sTarget; 175 | bool bActive; 176 | DWORD dwStartTime; 177 | } 178 | AIMBOT_INFO, *PAIMBOT_INFO; 179 | 180 | 181 | #endif 182 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/engine_launcher_api.h: -------------------------------------------------------------------------------- 1 | // engine/launcher interface 2 | #if !defined( ENGINE_LAUNCHER_APIH ) 3 | #define ENGINE_LAUNCHER_APIH 4 | #ifdef _WIN32 5 | #pragma once 6 | #endif 7 | 8 | //typedef void ( *xcommand_t ) ( void ); 9 | 10 | #define RENDERTYPE_UNDEFINED 0 11 | #define RENDERTYPE_SOFTWARE 1 12 | #define RENDERTYPE_HARDWARE 2 13 | 14 | #define ENGINE_LAUNCHER_API_VERSION 1 15 | 16 | typedef struct engine_api_s 17 | { 18 | int version; 19 | int rendertype; 20 | int size; 21 | 22 | // Functions 23 | int ( *GetEngineState ) ( void ); 24 | void ( *Cbuf_AddText ) ( char *text ); // append cmd at end of buf 25 | void ( *Cbuf_InsertText ) ( char *text ); // insert cmd at start of buf 26 | void ( *Cmd_AddCommand ) ( char *cmd_name, void ( *funcname )( void ) ); 27 | int ( *Cmd_Argc ) ( void ); 28 | char *( *Cmd_Args ) ( void ); 29 | char *( *Cmd_Argv ) ( int arg ); 30 | void ( *Con_Printf ) ( char *, ... ); 31 | void ( *Con_SafePrintf ) ( char *, ... ); 32 | void ( *Cvar_Set ) ( char *var_name, char *value ); 33 | void ( *Cvar_SetValue ) ( char *var_name, float value ); 34 | int ( *Cvar_VariableInt ) ( char *var_name ); 35 | char *( *Cvar_VariableString ) ( char *var_name ); 36 | float ( *Cvar_VariableValue ) ( char *var_name ); 37 | void ( *ForceReloadProfile ) ( void ); 38 | int ( *GetGameInfo ) ( struct GameInfo_s *pGI, char *pszChannel ); 39 | void ( *GameSetBackground ) ( int bBack ); 40 | void ( *GameSetState ) ( int iState ); 41 | void ( *GameSetSubState ) ( int iState ); 42 | int ( *GetPauseState ) ( void ); 43 | int ( *Host_Frame ) ( float time, int iState, int *stateInfo ); 44 | void ( *Host_GetHostInfo ) ( float *fps, int *nActive, int *nSpectators, int *nMaxPlayers, char *pszMap ); 45 | void ( *Host_Shutdown ) ( void ); 46 | int ( *Game_Init ) ( char *lpCmdLine, unsigned char *pMem, int iSize, struct exefuncs_s *pef, void *, int ); 47 | void ( *IN_ActivateMouse ) ( void ); 48 | void ( *IN_ClearStates ) ( void ); 49 | void ( *IN_DeactivateMouse ) ( void ); 50 | void ( *IN_MouseEvent ) ( int mstate ); 51 | void ( *Keyboard_ReturnToGame ) ( void ); 52 | void ( *Key_ClearStates ) ( void ); 53 | void ( *Key_Event ) ( int key, int down ); 54 | int ( *LoadGame ) ( const char *pszSlot ); 55 | void ( *S_BlockSound ) ( void ); 56 | void ( *S_ClearBuffer ) ( void ); 57 | void ( *S_GetDSPointer ) ( struct IDirectSound **lpDS, struct IDirectSoundBuffer **lpDSBuf ); 58 | void *( *S_GetWAVPointer ) ( void ); 59 | void ( *S_UnblockSound ) ( void ); 60 | int ( *SaveGame ) ( const char *pszSlot, const char *pszComment ); 61 | void ( *SetAuth ) ( void *pobj ); 62 | void ( *SetMessagePumpDisableMode ) ( int bMode ); 63 | void ( *SetPauseState ) ( int bPause ); 64 | void ( *SetStartupMode ) ( int bMode ); 65 | void ( *SNDDMA_Shutdown ) ( void ); 66 | void ( *Snd_AcquireBuffer ) ( void ); 67 | void ( *Snd_ReleaseBuffer ) ( void ); 68 | void ( *StoreProfile ) ( void ); 69 | double ( *Sys_FloatTime ) ( void ); 70 | void ( *VID_UpdateWindowVars ) ( void *prc, int x, int y ); 71 | void ( *VID_UpdateVID ) ( struct viddef_s *pvid ); 72 | 73 | // VGUI interfaces 74 | void ( *VGui_CallEngineSurfaceProc ) ( void* hwnd, unsigned int msg, unsigned int wparam, long lparam ); 75 | 76 | // notifications that the launcher is taking/giving focus to the engine 77 | void ( *EngineTakingFocus ) ( void ); 78 | void ( *LauncherTakingFocus ) ( void ); 79 | 80 | #ifdef _WIN32 81 | // Only filled in by rendertype RENDERTYPE_HARDWARE 82 | void ( *GL_Init ) ( void ); 83 | int ( *GL_SetMode ) ( HWND hwndGame, HDC *pmaindc, HGLRC *pbaseRC, int fD3D, const char *p, const char *pszCmdLine ); 84 | void ( *GL_Shutdown ) ( HWND hwnd, HDC hdc, HGLRC hglrc ); 85 | 86 | void ( *QGL_D3DShared ) ( struct tagD3DGlobals *d3dGShared ); 87 | 88 | int ( WINAPI *glSwapBuffers ) ( HDC dc ); 89 | void ( *DirectorProc ) ( unsigned int cmd, void * params ); 90 | #else 91 | // NOT USED IN LINUX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 92 | void ( *GL_Init ) ( void ); 93 | void ( *GL_SetMode ) ( void ); 94 | void ( *GL_Shutdown ) ( void ); 95 | void ( *QGL_D3DShared ) ( void ); 96 | void ( *glSwapBuffers ) ( void ); 97 | void ( *DirectorProc ) ( void ); 98 | // LINUX 99 | #endif 100 | 101 | } engine_api_t; 102 | 103 | #endif // ENGINE_LAUNCHER_APIH 104 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/mathlib.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // mathlib.h 16 | 17 | typedef float vec_t; 18 | typedef vec_t vec3_t[3]; 19 | typedef vec_t vec4_t[4]; // x,y,z,w 20 | typedef vec_t vec5_t[5]; 21 | 22 | typedef short vec_s_t; 23 | typedef vec_s_t vec3s_t[3]; 24 | typedef vec_s_t vec4s_t[4]; // x,y,z,w 25 | typedef vec_s_t vec5s_t[5]; 26 | 27 | typedef int fixed4_t; 28 | typedef int fixed8_t; 29 | typedef int fixed16_t; 30 | 31 | #ifndef M_PI 32 | #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h 33 | #endif 34 | 35 | struct mplane_s; 36 | 37 | extern vec3_t vec3_origin; 38 | extern int nanmask; 39 | 40 | #define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) 41 | 42 | #ifndef VECTOR_H 43 | #define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) 44 | #endif 45 | 46 | #define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];} 47 | #define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];} 48 | #define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];} 49 | #define VectorClear(a) {(a)[0]=0.0;(a)[1]=0.0;(a)[2]=0.0;} 50 | 51 | void VectorMA (const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc); 52 | 53 | vec_t _DotProduct (vec3_t v1, vec3_t v2); 54 | void _VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out); 55 | void _VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out); 56 | void _VectorCopy (vec3_t in, vec3_t out); 57 | 58 | int VectorCompare (const vec3_t v1, const vec3_t v2); 59 | float Length (const vec3_t v); 60 | void CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross); 61 | float VectorNormalize (vec3_t v); // returns vector length 62 | void VectorInverse (vec3_t v); 63 | void VectorScale (const vec3_t in, vec_t scale, vec3_t out); 64 | int Q_log2(int val); 65 | 66 | void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]); 67 | void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]); 68 | 69 | // Here are some "manual" INLINE routines for doing floating point to integer conversions 70 | extern short new_cw, old_cw; 71 | 72 | typedef union DLONG { 73 | int i[2]; 74 | double d; 75 | float f; 76 | } DLONG; 77 | 78 | extern DLONG dlong; 79 | 80 | #ifdef _WIN32 81 | void __inline set_fpu_cw(void) 82 | { 83 | _asm 84 | { wait 85 | fnstcw old_cw 86 | wait 87 | mov ax, word ptr old_cw 88 | or ah, 0xc 89 | mov word ptr new_cw,ax 90 | fldcw new_cw 91 | } 92 | } 93 | 94 | int __inline quick_ftol(float f) 95 | { 96 | _asm { 97 | // Assumes that we are already in chop mode, and only need a 32-bit int 98 | fld DWORD PTR f 99 | fistp DWORD PTR dlong 100 | } 101 | return dlong.i[0]; 102 | } 103 | 104 | void __inline restore_fpu_cw(void) 105 | { 106 | _asm fldcw old_cw 107 | } 108 | #else 109 | #define set_fpu_cw() /* */ 110 | #define quick_ftol(f) ftol(f) 111 | #define restore_fpu_cw() /* */ 112 | #endif 113 | 114 | void FloorDivMod (double numer, double denom, int *quotient, 115 | int *rem); 116 | fixed16_t Invert24To16(fixed16_t val); 117 | int GreatestCommonDivisor (int i1, int i2); 118 | 119 | void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); 120 | void AngleVectorsTranspose (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); 121 | #define AngleIVectors AngleVectorsTranspose 122 | 123 | void AngleMatrix (const vec3_t angles, float (*matrix)[4] ); 124 | void AngleIMatrix (const vec3_t angles, float (*matrix)[4] ); 125 | void VectorTransform (const vec3_t in1, float in2[3][4], vec3_t out); 126 | 127 | void VectorMatrix( vec3_t forward, vec3_t right, vec3_t up); 128 | void VectorAngles( const vec3_t forward, vec3_t angles ); 129 | 130 | int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct mplane_s *plane); 131 | float anglemod(float a); 132 | 133 | 134 | 135 | #define BOX_ON_PLANE_SIDE(emins, emaxs, p) \ 136 | (((p)->type < 3)? \ 137 | ( \ 138 | ((p)->dist <= (emins)[(p)->type])? \ 139 | 1 \ 140 | : \ 141 | ( \ 142 | ((p)->dist >= (emaxs)[(p)->type])?\ 143 | 2 \ 144 | : \ 145 | 3 \ 146 | ) \ 147 | ) \ 148 | : \ 149 | BoxOnPlaneSide( (emins), (emaxs), (p))) 150 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/r_studioint.h: -------------------------------------------------------------------------------- 1 | #if !defined( R_STUDIOINT_H ) 2 | #define R_STUDIOINT_H 3 | #if defined( _WIN32 ) 4 | #pragma once 5 | #endif 6 | 7 | #define STUDIO_INTERFACE_VERSION 1 8 | 9 | typedef struct engine_studio_api_s 10 | { 11 | // Allocate number*size bytes and zero it 12 | void *( *Mem_Calloc ) ( int number, size_t size ); 13 | // Check to see if pointer is in the cache 14 | void *( *Cache_Check ) ( struct cache_user_s *c ); 15 | // Load file into cache ( can be swapped out on demand ) 16 | void ( *LoadCacheFile ) ( char *path, struct cache_user_s *cu ); 17 | // Retrieve model pointer for the named model 18 | struct model_s *( *Mod_ForName ) ( const char *name, int crash_if_missing ); 19 | // Retrieve pointer to studio model data block from a model 20 | void *( *Mod_Extradata ) ( struct model_s *mod ); 21 | // Retrieve indexed model from client side model precache list 22 | struct model_s *( *GetModelByIndex ) ( int index ); 23 | // Get entity that is set for rendering 24 | struct cl_entity_s * ( *GetCurrentEntity ) ( void ); 25 | // Get referenced player_info_t 26 | struct player_info_s *( *PlayerInfo ) ( int index ); 27 | // Get most recently received player state data from network system 28 | struct entity_state_s *( *GetPlayerState ) ( int index ); 29 | // Get viewentity 30 | struct cl_entity_s * ( *GetViewEntity ) ( void ); 31 | // Get current frame count, and last two timestampes on client 32 | void ( *GetTimes ) ( int *framecount, double *current, double *old ); 33 | // Get a pointer to a cvar by name 34 | struct cvar_s *( *GetCvar ) ( const char *name ); 35 | // Get current render origin and view vectors ( up, right and vpn ) 36 | void ( *GetViewInfo ) ( float *origin, float *upv, float *rightv, float *vpnv ); 37 | // Get sprite model used for applying chrome effect 38 | struct model_s *( *GetChromeSprite ) ( void ); 39 | // Get model counters so we can incement instrumentation 40 | void ( *GetModelCounters ) ( int **s, int **a ); 41 | // Get software scaling coefficients 42 | void ( *GetAliasScale ) ( float *x, float *y ); 43 | 44 | // Get bone, light, alias, and rotation matrices 45 | float ****( *StudioGetBoneTransform ) ( void ); 46 | float ****( *StudioGetLightTransform )( void ); 47 | float ***( *StudioGetAliasTransform ) ( void ); 48 | float ***( *StudioGetRotationMatrix ) ( void ); 49 | 50 | // Set up body part, and get submodel pointers 51 | void ( *StudioSetupModel ) ( int bodypart, void **ppbodypart, void **ppsubmodel ); 52 | // Check if entity's bbox is in the view frustum 53 | int ( *StudioCheckBBox ) ( void ); 54 | // Apply lighting effects to model 55 | void ( *StudioDynamicLight ) ( struct cl_entity_s *ent, struct alight_s *plight ); 56 | void ( *StudioEntityLight ) ( struct alight_s *plight ); 57 | void ( *StudioSetupLighting ) ( struct alight_s *plighting ); 58 | 59 | // Draw mesh vertices 60 | void ( *StudioDrawPoints ) ( void ); 61 | 62 | // Draw hulls around bones 63 | void ( *StudioDrawHulls ) ( void ); 64 | // Draw bbox around studio models 65 | void ( *StudioDrawAbsBBox ) ( void ); 66 | // Draws bones 67 | void ( *StudioDrawBones ) ( void ); 68 | // Loads in appropriate texture for model 69 | void ( *StudioSetupSkin ) ( void *ptexturehdr, int index ); 70 | // Sets up for remapped colors 71 | void ( *StudioSetRemapColors ) ( int top, int bottom ); 72 | // Set's player model and returns model pointer 73 | struct model_s *( *SetupPlayerModel ) ( int index ); 74 | // Fires any events embedded in animation 75 | void ( *StudioClientEvents ) ( void ); 76 | // Retrieve/set forced render effects flags 77 | int ( *GetForceFaceFlags ) ( void ); 78 | void ( *SetForceFaceFlags ) ( int flags ); 79 | // Tell engine the value of the studio model header 80 | void ( *StudioSetHeader ) ( void *header ); 81 | // Tell engine which model_t * is being renderered 82 | void ( *SetRenderModel ) ( struct model_s *model ); 83 | 84 | // Final state setup and restore for rendering 85 | void ( *SetupRenderer ) ( int rendermode ); 86 | void ( *RestoreRenderer ) ( void ); 87 | 88 | // Set render origin for applying chrome effect 89 | void ( *SetChromeOrigin ) ( void ); 90 | 91 | // True if using D3D/OpenGL 92 | int ( *IsHardware ) ( void ); 93 | 94 | // Only called by hardware interface 95 | void ( *GL_StudioDrawShadow ) ( void ); 96 | void ( *GL_SetRenderMode ) ( int mode ); 97 | } engine_studio_api_t; 98 | 99 | typedef struct r_studio_interface_s 100 | { 101 | int version; 102 | int ( *StudioDrawModel ) ( int flags ); 103 | int ( *StudioDrawPlayer ) ( int flags, struct entity_state_s *pplayer ); 104 | } r_studio_interface_t; 105 | 106 | extern r_studio_interface_t *pStudioAPI; 107 | 108 | #endif // R_STUDIOINT_H -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/interface.h: -------------------------------------------------------------------------------- 1 | 2 | // This header defines the interface convention used in the valve engine. 3 | // To make an interface and expose it: 4 | // 1. Derive from IBaseInterface. 5 | // 2. The interface must be ALL pure virtuals, and have no data members. 6 | // 3. Define a name for it. 7 | // 4. In its implementation file, use EXPOSE_INTERFACE or EXPOSE_SINGLE_INTERFACE. 8 | 9 | // Versioning 10 | // There are two versioning cases that are handled by this: 11 | // 1. You add functions to the end of an interface, so it is binary compatible with the previous interface. In this case, 12 | // you need two EXPOSE_INTERFACEs: one to expose your class as the old interface and one to expose it as the new interface. 13 | // 2. You update an interface so it's not compatible anymore (but you still want to be able to expose the old interface 14 | // for legacy code). In this case, you need to make a new version name for your new interface, and make a wrapper interface and 15 | // expose it for the old interface. 16 | 17 | #ifndef INTERFACE_H 18 | #define INTERFACE_H 19 | 20 | #ifdef __cplusplus 21 | 22 | // All interfaces derive from this. 23 | class IBaseInterface 24 | { 25 | public: 26 | 27 | virtual ~IBaseInterface() {} 28 | }; 29 | 30 | 31 | #define CREATEINTERFACE_PROCNAME "CreateInterface" 32 | typedef IBaseInterface* (*CreateInterfaceFn)(const char *pName, int *pReturnCode); 33 | 34 | 35 | typedef IBaseInterface* (*InstantiateInterfaceFn)(); 36 | 37 | 38 | // Used internally to register classes. 39 | class InterfaceReg 40 | { 41 | public: 42 | InterfaceReg(InstantiateInterfaceFn fn, const char *pName); 43 | 44 | public: 45 | 46 | InstantiateInterfaceFn m_CreateFn; 47 | const char *m_pName; 48 | 49 | InterfaceReg *m_pNext; // For the global list. 50 | static InterfaceReg *s_pInterfaceRegs; 51 | }; 52 | 53 | 54 | // Use this to expose an interface that can have multiple instances. 55 | // e.g.: 56 | // EXPOSE_INTERFACE( CInterfaceImp, IInterface, "MyInterface001" ) 57 | // This will expose a class called CInterfaceImp that implements IInterface (a pure class) 58 | // clients can receive a pointer to this class by calling CreateInterface( "MyInterface001" ) 59 | // 60 | // In practice, the shared header file defines the interface (IInterface) and version name ("MyInterface001") 61 | // so that each component can use these names/vtables to communicate 62 | // 63 | // A single class can support multiple interfaces through multiple inheritance 64 | // 65 | #define EXPOSE_INTERFACE_FN(functionName, interfaceName, versionName) \ 66 | static InterfaceReg __g_Create##className##_reg(functionName, versionName); 67 | 68 | #define EXPOSE_INTERFACE(className, interfaceName, versionName) \ 69 | static IBaseInterface* __Create##className##_interface() {return (interfaceName *)new className;}\ 70 | static InterfaceReg __g_Create##className##_reg(__Create##className##_interface, versionName ); 71 | 72 | // Use this to expose a singleton interface with a global variable you've created. 73 | #define EXPOSE_SINGLE_INTERFACE_GLOBALVAR(className, interfaceName, versionName, globalVarName) \ 74 | static IBaseInterface* __Create##className##interfaceName##_interface() {return (interfaceName *)&globalVarName;}\ 75 | static InterfaceReg __g_Create##className##interfaceName##_reg(__Create##className##interfaceName##_interface, versionName); 76 | 77 | // Use this to expose a singleton interface. This creates the global variable for you automatically. 78 | #define EXPOSE_SINGLE_INTERFACE(className, interfaceName, versionName) \ 79 | static className __g_##className##_singleton;\ 80 | EXPOSE_SINGLE_INTERFACE_GLOBALVAR(className, interfaceName, versionName, __g_##className##_singleton) 81 | 82 | 83 | #ifdef WIN32 84 | #define EXPORT_FUNCTION __declspec(dllexport) 85 | #else 86 | #define EXPORT_FUNCTION 87 | #endif 88 | 89 | 90 | // This function is automatically exported and allows you to access any interfaces exposed with the above macros. 91 | // if pReturnCode is set, it will return one of the following values 92 | // extend this for other error conditions/code 93 | enum 94 | { 95 | IFACE_OK = 0, 96 | IFACE_FAILED 97 | }; 98 | 99 | 100 | IBaseInterface* CreateInterface(const char *pName, int *pReturnCode); 101 | 102 | 103 | // Handle to an interface (HInterfaceModule_t* is just there for type safety). 104 | typedef struct HInterfaceModule_t* HINTERFACEMODULE; 105 | 106 | 107 | // Use these to load and unload a module. 108 | extern HINTERFACEMODULE Sys_LoadModule(const char *pModuleName); 109 | extern void Sys_FreeModule(HINTERFACEMODULE hModule); 110 | 111 | // Use these to get the factory function from either a loaded module or the current module. 112 | extern CreateInterfaceFn Sys_GetFactory( HINTERFACEMODULE hModule ); 113 | extern CreateInterfaceFn Sys_GetFactoryThis( void ); 114 | 115 | #endif // __cplusplus 116 | 117 | #endif 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/entity_state.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( ENTITY_STATEH ) 16 | #define ENTITY_STATEH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // For entityType below 22 | #define ENTITY_NORMAL (1<<0) 23 | #define ENTITY_BEAM (1<<1) 24 | 25 | // Entity state is used for the baseline and for delta compression of a packet of 26 | // entities that is sent to a client. 27 | typedef struct entity_state_s entity_state_t; 28 | 29 | struct entity_state_s 30 | { 31 | // Fields which are filled in by routines outside of delta compression 32 | int entityType; 33 | // Index into cl_entities array for this entity. 34 | int number; 35 | float msg_time; 36 | 37 | // Message number last time the player/entity state was updated. 38 | int messagenum; 39 | 40 | // Fields which can be transitted and reconstructed over the network stream 41 | vec3_t origin; 42 | vec3_t angles; 43 | 44 | int modelindex; 45 | int sequence; 46 | float frame; 47 | int colormap; 48 | short skin; 49 | short solid; 50 | int effects; 51 | float scale; 52 | 53 | byte eflags; 54 | 55 | // Render information 56 | int rendermode; 57 | int renderamt; 58 | color24 rendercolor; 59 | int renderfx; 60 | 61 | int movetype; 62 | float animtime; 63 | float framerate; 64 | int body; 65 | byte controller[4]; 66 | byte blending[4]; 67 | vec3_t velocity; 68 | 69 | // Send bbox down to client for use during prediction. 70 | vec3_t mins; 71 | vec3_t maxs; 72 | 73 | int aiment; 74 | // If owned by a player, the index of that player ( for projectiles ). 75 | int owner; 76 | 77 | // Friction, for prediction. 78 | float friction; 79 | // Gravity multiplier 80 | float gravity; 81 | 82 | // PLAYER SPECIFIC 83 | int team; 84 | int playerclass; 85 | int health; 86 | qboolean spectator; 87 | int weaponmodel; 88 | int gaitsequence; 89 | // If standing on conveyor, e.g. 90 | vec3_t basevelocity; 91 | // Use the crouched hull, or the regular player hull. 92 | int usehull; 93 | // Latched buttons last time state updated. 94 | int oldbuttons; 95 | // -1 = in air, else pmove entity number 96 | int onground; 97 | int iStepLeft; 98 | // How fast we are falling 99 | float flFallVelocity; 100 | 101 | float fov; 102 | int weaponanim; 103 | 104 | // Parametric movement overrides 105 | vec3_t startpos; 106 | vec3_t endpos; 107 | float impacttime; 108 | float starttime; 109 | 110 | // For mods 111 | int iuser1; 112 | int iuser2; 113 | int iuser3; 114 | int iuser4; 115 | float fuser1; 116 | float fuser2; 117 | float fuser3; 118 | float fuser4; 119 | vec3_t vuser1; 120 | vec3_t vuser2; 121 | vec3_t vuser3; 122 | vec3_t vuser4; 123 | }; 124 | 125 | #include "pm_info.h" 126 | 127 | typedef struct clientdata_s 128 | { 129 | vec3_t origin; 130 | vec3_t velocity; 131 | 132 | int viewmodel; 133 | vec3_t punchangle; 134 | int flags; 135 | int waterlevel; 136 | int watertype; 137 | vec3_t view_ofs; 138 | float health; 139 | 140 | int bInDuck; 141 | 142 | int weapons; // remove? 143 | 144 | int flTimeStepSound; 145 | int flDuckTime; 146 | int flSwimTime; 147 | int waterjumptime; 148 | 149 | float maxspeed; 150 | 151 | float fov; 152 | int weaponanim; 153 | 154 | int m_iId; 155 | int ammo_shells; 156 | int ammo_nails; 157 | int ammo_cells; 158 | int ammo_rockets; 159 | float m_flNextAttack; 160 | 161 | int tfstate; 162 | 163 | int pushmsec; 164 | 165 | int deadflag; 166 | 167 | char physinfo[ MAX_PHYSINFO_STRING ]; 168 | 169 | // For mods 170 | int iuser1; 171 | int iuser2; 172 | int iuser3; 173 | int iuser4; 174 | float fuser1; 175 | float fuser2; 176 | float fuser3; 177 | float fuser4; 178 | vec3_t vuser1; 179 | vec3_t vuser2; 180 | vec3_t vuser3; 181 | vec3_t vuser4; 182 | } clientdata_t; 183 | 184 | #include "weaponinfo.h" 185 | 186 | typedef struct local_state_s 187 | { 188 | entity_state_t playerstate; 189 | clientdata_t client; 190 | weapon_data_t weapondata[ 32 ]; 191 | } local_state_t; 192 | 193 | #endif // !ENTITY_STATEH -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/entity_state.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( ENTITY_STATEH ) 16 | #define ENTITY_STATEH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // For entityType below 22 | #define ENTITY_NORMAL (1<<0) 23 | #define ENTITY_BEAM (1<<1) 24 | 25 | // Entity state is used for the baseline and for delta compression of a packet of 26 | // entities that is sent to a client. 27 | typedef struct entity_state_s entity_state_t; 28 | 29 | struct entity_state_s 30 | { 31 | // Fields which are filled in by routines outside of delta compression 32 | int entityType; 33 | // Index into cl_entities array for this entity. 34 | int number; 35 | float msg_time; 36 | 37 | // Message number last time the player/entity state was updated. 38 | int messagenum; 39 | 40 | // Fields which can be transitted and reconstructed over the network stream 41 | vec3_t origin; 42 | vec3_t angles; 43 | 44 | int modelindex; 45 | int sequence; 46 | float frame; 47 | int colormap; 48 | short skin; 49 | short solid; 50 | int effects; 51 | float scale; 52 | 53 | byte eflags; 54 | 55 | // Render information 56 | int rendermode; 57 | int renderamt; 58 | color24 rendercolor; 59 | int renderfx; 60 | 61 | int movetype; 62 | float animtime; 63 | float framerate; 64 | int body; 65 | byte controller[4]; 66 | byte blending[4]; 67 | vec3_t velocity; 68 | 69 | // Send bbox down to client for use during prediction. 70 | vec3_t mins; 71 | vec3_t maxs; 72 | 73 | int aiment; 74 | // If owned by a player, the index of that player ( for projectiles ). 75 | int owner; 76 | 77 | // Friction, for prediction. 78 | float friction; 79 | // Gravity multiplier 80 | float gravity; 81 | 82 | // PLAYER SPECIFIC 83 | int team; 84 | int playerclass; 85 | int health; 86 | qboolean spectator; 87 | int weaponmodel; 88 | int gaitsequence; 89 | // If standing on conveyor, e.g. 90 | vec3_t basevelocity; 91 | // Use the crouched hull, or the regular player hull. 92 | int usehull; 93 | // Latched buttons last time state updated. 94 | int oldbuttons; 95 | // -1 = in air, else pmove entity number 96 | int onground; 97 | int iStepLeft; 98 | // How fast we are falling 99 | float flFallVelocity; 100 | 101 | float fov; 102 | int weaponanim; 103 | 104 | // Parametric movement overrides 105 | vec3_t startpos; 106 | vec3_t endpos; 107 | float impacttime; 108 | float starttime; 109 | 110 | // For mods 111 | int iuser1; 112 | int iuser2; 113 | int iuser3; 114 | int iuser4; 115 | float fuser1; 116 | float fuser2; 117 | float fuser3; 118 | float fuser4; 119 | vec3_t vuser1; 120 | vec3_t vuser2; 121 | vec3_t vuser3; 122 | vec3_t vuser4; 123 | }; 124 | 125 | #include "pm_info.h" 126 | 127 | typedef struct clientdata_s 128 | { 129 | vec3_t origin; 130 | vec3_t velocity; 131 | 132 | int viewmodel; 133 | vec3_t punchangle; 134 | int flags; 135 | int waterlevel; 136 | int watertype; 137 | vec3_t view_ofs; 138 | float health; 139 | 140 | int bInDuck; 141 | 142 | int weapons; // remove? 143 | 144 | int flTimeStepSound; 145 | int flDuckTime; 146 | int flSwimTime; 147 | int waterjumptime; 148 | 149 | float maxspeed; 150 | 151 | float fov; 152 | int weaponanim; 153 | 154 | int m_iId; 155 | int ammo_shells; 156 | int ammo_nails; 157 | int ammo_cells; 158 | int ammo_rockets; 159 | float m_flNextAttack; 160 | 161 | int tfstate; 162 | 163 | int pushmsec; 164 | 165 | int deadflag; 166 | 167 | char physinfo[ MAX_PHYSINFO_STRING ]; 168 | 169 | // For mods 170 | int iuser1; 171 | int iuser2; 172 | int iuser3; 173 | int iuser4; 174 | float fuser1; 175 | float fuser2; 176 | float fuser3; 177 | float fuser4; 178 | vec3_t vuser1; 179 | vec3_t vuser2; 180 | vec3_t vuser3; 181 | vec3_t vuser4; 182 | } clientdata_t; 183 | 184 | #include "weaponinfo.h" 185 | 186 | typedef struct local_state_s 187 | { 188 | entity_state_t playerstate; 189 | clientdata_t client; 190 | weapon_data_t weapondata[ 32 ]; 191 | } local_state_t; 192 | 193 | #endif // !ENTITY_STATEH 194 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/util_vector.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // Vector.h 16 | // A subset of the extdll.h in the project HL Entity DLL 17 | // 18 | 19 | #if !defined FILE_UTIL_VECTOR_H 20 | #define FILE_UTIL_VECTOR_H 21 | 22 | // Misc C-runtime library headers 23 | #include "STDIO.H" 24 | #include "STDLIB.H" 25 | #include "MATH.H" 26 | 27 | // Header file containing definition of globalvars_t and entvars_t 28 | typedef int func_t; // 29 | typedef int string_t; // from engine's pr_comp.h; 30 | typedef float vec_t; // needed before including progdefs.h 31 | 32 | //========================================================= 33 | // 2DVector - used for many pathfinding and many other 34 | // operations that are treated as planar rather than 3d. 35 | //========================================================= 36 | class Vector2D 37 | { 38 | public: 39 | inline Vector2D(void) { } 40 | inline Vector2D(float X, float Y) { x = X; y = Y; } 41 | inline Vector2D operator+(const Vector2D& v) const { return Vector2D(x+v.x, y+v.y); } 42 | inline Vector2D operator-(const Vector2D& v) const { return Vector2D(x-v.x, y-v.y); } 43 | inline Vector2D operator*(float fl) const { return Vector2D(x*fl, y*fl); } 44 | inline Vector2D operator/(float fl) const { return Vector2D(x/fl, y/fl); } 45 | 46 | inline float Length(void) const { return (float)sqrt(x*x + y*y ); } 47 | 48 | inline Vector2D Normalize ( void ) const 49 | { 50 | Vector2D vec2; 51 | 52 | float flLen = Length(); 53 | if ( flLen == 0 ) 54 | { 55 | return Vector2D( (float)0, (float)0 ); 56 | } 57 | else 58 | { 59 | flLen = 1 / flLen; 60 | return Vector2D( x * flLen, y * flLen ); 61 | } 62 | } 63 | 64 | vec_t x, y; 65 | }; 66 | 67 | inline float DotProduct(const Vector2D& a, const Vector2D& b) { return( a.x*b.x + a.y*b.y ); } 68 | inline Vector2D operator*(float fl, const Vector2D& v) { return v * fl; } 69 | 70 | //========================================================= 71 | // 3D Vector 72 | //========================================================= 73 | class Vector // same data-layout as engine's vec3_t, 74 | { // which is a vec_t[3] 75 | public: 76 | // Construction/destruction 77 | inline Vector(void) { } 78 | inline Vector(float X, float Y, float Z) { x = X; y = Y; z = Z; } 79 | inline Vector(double X, double Y, double Z) { x = (float)X; y = (float)Y; z = (float)Z; } 80 | inline Vector(int X, int Y, int Z) { x = (float)X; y = (float)Y; z = (float)Z; } 81 | inline Vector(const Vector& v) { x = v.x; y = v.y; z = v.z; } 82 | inline Vector(float rgfl[3]) { x = rgfl[0]; y = rgfl[1]; z = rgfl[2]; } 83 | 84 | // Operators 85 | inline Vector operator-(void) const { return Vector(-x,-y,-z); } 86 | inline int operator==(const Vector& v) const { return x==v.x && y==v.y && z==v.z; } 87 | inline int operator!=(const Vector& v) const { return !(*this==v); } 88 | inline Vector operator+(const Vector& v) const { return Vector(x+v.x, y+v.y, z+v.z); } 89 | inline Vector operator-(const Vector& v) const { return Vector(x-v.x, y-v.y, z-v.z); } 90 | inline Vector operator*(float fl) const { return Vector(x*fl, y*fl, z*fl); } 91 | inline Vector operator/(float fl) const { return Vector(x/fl, y/fl, z/fl); } 92 | 93 | // Methods 94 | inline void CopyToArray(float* rgfl) const { rgfl[0] = x, rgfl[1] = y, rgfl[2] = z; } 95 | inline float Length(void) const { return (float)sqrt(x*x + y*y + z*z); } 96 | operator float *() { return &x; } // Vectors will now automatically convert to float * when needed 97 | operator const float *() const { return &x; } // Vectors will now automatically convert to float * when needed 98 | inline Vector Normalize(void) const 99 | { 100 | float flLen = Length(); 101 | if (flLen == 0) return Vector(0,0,1); // ???? 102 | flLen = 1 / flLen; 103 | return Vector(x * flLen, y * flLen, z * flLen); 104 | } 105 | 106 | inline Vector2D Make2D ( void ) const 107 | { 108 | Vector2D Vec2; 109 | 110 | Vec2.x = x; 111 | Vec2.y = y; 112 | 113 | return Vec2; 114 | } 115 | inline float Length2D(void) const { return (float)sqrt(x*x + y*y); } 116 | 117 | // Members 118 | vec_t x, y, z; 119 | }; 120 | inline Vector operator*(float fl, const Vector& v) { return v * fl; } 121 | inline float DotProduct(const Vector& a, const Vector& b) { return(a.x*b.x+a.y*b.y+a.z*b.z); } 122 | inline Vector CrossProduct(const Vector& a, const Vector& b) { return Vector( a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x ); } 123 | 124 | #define vec3_t Vector 125 | 126 | 127 | #define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];} 128 | #define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];} 129 | #define VectorClear(a) { a[0]=0.0;a[1]=0.0;a[2]=0.0;} 130 | 131 | #endif 132 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/progdefs.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef PROGDEFS_H 16 | #define PROGDEFS_H 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct 22 | { 23 | float time; 24 | float frametime; 25 | float force_retouch; 26 | string_t mapname; 27 | string_t startspot; 28 | float deathmatch; 29 | float coop; 30 | float teamplay; 31 | float serverflags; 32 | float found_secrets; 33 | vec3_t v_forward; 34 | vec3_t v_up; 35 | vec3_t v_right; 36 | float trace_allsolid; 37 | float trace_startsolid; 38 | float trace_fraction; 39 | vec3_t trace_endpos; 40 | vec3_t trace_plane_normal; 41 | float trace_plane_dist; 42 | edict_t *trace_ent; 43 | float trace_inopen; 44 | float trace_inwater; 45 | int trace_hitgroup; 46 | int trace_flags; 47 | int msg_entity; 48 | int cdAudioTrack; 49 | int maxClients; 50 | int maxEntities; 51 | const char *pStringBase; 52 | 53 | void *pSaveData; 54 | vec3_t vecLandmarkOffset; 55 | } globalvars_t; 56 | 57 | 58 | typedef struct entvars_s 59 | { 60 | string_t classname; 61 | string_t globalname; 62 | 63 | vec3_t origin; 64 | vec3_t oldorigin; 65 | vec3_t velocity; 66 | vec3_t basevelocity; 67 | vec3_t clbasevelocity; // Base velocity that was passed in to server physics so 68 | // client can predict conveyors correctly. Server zeroes it, so we need to store here, too. 69 | vec3_t movedir; 70 | 71 | vec3_t angles; // Model angles 72 | vec3_t avelocity; // angle velocity (degrees per second) 73 | vec3_t punchangle; // auto-decaying view angle adjustment 74 | vec3_t v_angle; // Viewing angle (player only) 75 | 76 | // For parametric entities 77 | vec3_t endpos; 78 | vec3_t startpos; 79 | float impacttime; 80 | float starttime; 81 | 82 | int fixangle; // 0:nothing, 1:force view angles, 2:add avelocity 83 | float idealpitch; 84 | float pitch_speed; 85 | float ideal_yaw; 86 | float yaw_speed; 87 | 88 | int modelindex; 89 | string_t model; 90 | 91 | int viewmodel; // player's viewmodel 92 | int weaponmodel; // what other players see 93 | 94 | vec3_t absmin; // BB max translated to world coord 95 | vec3_t absmax; // BB max translated to world coord 96 | vec3_t mins; // local BB min 97 | vec3_t maxs; // local BB max 98 | vec3_t size; // maxs - mins 99 | 100 | float ltime; 101 | float nextthink; 102 | 103 | int movetype; 104 | int solid; 105 | 106 | int skin; 107 | int body; // sub-model selection for studiomodels 108 | int effects; 109 | 110 | float gravity; // % of "normal" gravity 111 | float friction; // inverse elasticity of MOVETYPE_BOUNCE 112 | 113 | int light_level; 114 | 115 | int sequence; // animation sequence 116 | int gaitsequence; // movement animation sequence for player (0 for none) 117 | float frame; // % playback position in animation sequences (0..255) 118 | float animtime; // world time when frame was set 119 | float framerate; // animation playback rate (-8x to 8x) 120 | byte controller[4]; // bone controller setting (0..255) 121 | byte blending[2]; // blending amount between sub-sequences (0..255) 122 | 123 | float scale; // sprite rendering scale (0..255) 124 | 125 | int rendermode; 126 | float renderamt; 127 | vec3_t rendercolor; 128 | int renderfx; 129 | 130 | float health; 131 | float frags; 132 | int weapons; // bit mask for available weapons 133 | float takedamage; 134 | 135 | int deadflag; 136 | vec3_t view_ofs; // eye position 137 | 138 | int button; 139 | int impulse; 140 | 141 | edict_t *chain; // Entity pointer when linked into a linked list 142 | edict_t *dmg_inflictor; 143 | edict_t *enemy; 144 | edict_t *aiment; // entity pointer when MOVETYPE_FOLLOW 145 | edict_t *owner; 146 | edict_t *groundentity; 147 | 148 | int spawnflags; 149 | int flags; 150 | 151 | int colormap; // lowbyte topcolor, highbyte bottomcolor 152 | int team; 153 | 154 | float max_health; 155 | float teleport_time; 156 | float armortype; 157 | float armorvalue; 158 | int waterlevel; 159 | int watertype; 160 | 161 | string_t target; 162 | string_t targetname; 163 | string_t netname; 164 | string_t message; 165 | 166 | float dmg_take; 167 | float dmg_save; 168 | float dmg; 169 | float dmgtime; 170 | 171 | string_t noise; 172 | string_t noise1; 173 | string_t noise2; 174 | string_t noise3; 175 | 176 | float speed; 177 | float air_finished; 178 | float pain_finished; 179 | float radsuit_finished; 180 | 181 | edict_t *pContainingEntity; 182 | 183 | int playerclass; 184 | float maxspeed; 185 | 186 | float fov; 187 | int weaponanim; 188 | 189 | int pushmsec; 190 | 191 | int bInDuck; 192 | int flTimeStepSound; 193 | int flSwimTime; 194 | int flDuckTime; 195 | int iStepLeft; 196 | float flFallVelocity; 197 | 198 | int gamestate; 199 | 200 | int oldbuttons; 201 | 202 | int groupinfo; 203 | 204 | // For mods 205 | int iuser1; 206 | int iuser2; 207 | int iuser3; 208 | int iuser4; 209 | float fuser1; 210 | float fuser2; 211 | float fuser3; 212 | float fuser4; 213 | vec3_t vuser1; 214 | vec3_t vuser2; 215 | vec3_t vuser3; 216 | vec3_t vuser4; 217 | edict_t *euser1; 218 | edict_t *euser2; 219 | edict_t *euser3; 220 | edict_t *euser4; 221 | } entvars_t; 222 | 223 | 224 | #endif // PROGDEFS_H -------------------------------------------------------------------------------- /RobinBot/interpreter.cpp: -------------------------------------------------------------------------------- 1 | #include "Main.h" 2 | 3 | void HlEngineCommand(const char* command); 4 | void HandleCvarInt(char* name, int* value); 5 | void HandleCvarFloat(char* name, float* value); 6 | void HandleCvarStr(char* name, string value); 7 | bool isHlCvar(char* name); 8 | bool HandleHlCvar(char* name); 9 | 10 | void CommandInterpreter::exec(const char* cmdlist) 11 | { 12 | string my_copy = cmdlist; 13 | char* from = const_cast(my_copy.c_str()); 14 | char* to = from; 15 | while (*from == ' ' || *from == '\t'){ ++from; ++to; } 16 | while (*to >= ' ' && *to != ';'){ 17 | if (*to == '\"') 18 | { 19 | do{ ++to; } while (*to && *to != '\"'); 20 | } 21 | else 22 | { 23 | ++to; 24 | } 25 | } 26 | do{ 27 | if (from[0] == '/' && from[1] == '/') { return; } 28 | if (from < to) 29 | { 30 | char oldch = *to; 31 | *to = 0; 32 | exec_one(from); 33 | *to = oldch; 34 | } 35 | if (!*to) { break; } 36 | ++to; 37 | from = to; 38 | while (*from == ' ' || *from == '\t'){ ++from; ++to; } 39 | while (*to >= ' ' && *to != ';') ++to; 40 | } while (1); 41 | } 42 | 43 | void CommandInterpreter::extractArguments(const char* const_args) 44 | { 45 | preExecArgs.clear(); 46 | char* args = const_cast(const_args); 47 | while (*args) 48 | { 49 | while (*args && *args <= ' ') args++; 50 | if (!*args) break; 51 | char* start; 52 | if (*args == '\"') { start = ++args; while (*args != '\"' && *args) args++; } 53 | else { start = args; while (*args > ' ') args++; } 54 | char last = *args; 55 | *args = 0; 56 | preExecArgs.push_back(start); 57 | *args = last; 58 | if (*args == '\"') args++; 59 | } 60 | } 61 | 62 | void CommandInterpreter::collectArguments(string& dest, int from, int to) 63 | { 64 | dest.erase(); 65 | --from; --to; 66 | int nArgs = preExecArgs.size(); 67 | to = (to < nArgs) ? to : (nArgs - 1); 68 | while (from <= to){ 69 | dest += preExecArgs[from]; 70 | if (from != to) dest += " "; 71 | ++from; 72 | }; 73 | } 74 | 75 | void CommandInterpreter::createRandomPrefix() 76 | { 77 | static char characterBox[] = "0123456789abcdefghijklmnopqrstuvwxyz" 78 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ!$%&/()=?{}[]*#-.,<>~+_"; 79 | static int len = sizeof(characterBox)-1; 80 | excludePrefixChar[0] = characterBox[rand() % len]; 81 | excludePrefixChar[1] = characterBox[rand() % len]; 82 | excludePrefixChar[2] = characterBox[rand() % len]; 83 | excludePrefixChar[3] = characterBox[rand() % len]; 84 | excludePrefixChar[4] = 0; 85 | } 86 | 87 | void CommandInterpreter::exec_one(const char* cur_cmd) 88 | { 89 | if (*cur_cmd == '#' || *cur_cmd == '.') 90 | { 91 | if (false) 92 | { 93 | static string hlcommand; 94 | hlcommand.erase(); 95 | hlcommand += excludePrefixChar; 96 | hlcommand += (cur_cmd + 1); 97 | HlEngineCommand(hlcommand.c_str()); 98 | } 99 | else 100 | { 101 | HlEngineCommand(cur_cmd + 1); 102 | } 103 | return; 104 | } 105 | char command[32]; 106 | char* commandPos = command; 107 | int commandCharsLeft = 31; 108 | while (*cur_cmd > ' ' && commandCharsLeft) 109 | { 110 | *commandPos = *cur_cmd; 111 | commandPos++; 112 | cur_cmd++; 113 | commandCharsLeft--; 114 | } 115 | *commandPos = 0; 116 | while (*cur_cmd > ' ') cur_cmd++; 117 | if (names.find(command)) 118 | { 119 | Entry& entry = entries[names.num]; 120 | switch (entry.type) 121 | { 122 | case Entry::ALIAS:{ 123 | string& content = *(string*)(entry.data); 124 | exec(const_cast(content.c_str())); 125 | }break; 126 | case Entry::COMMAND:{ 127 | typedef void(*CmdFunc)(); 128 | CmdFunc function = (CmdFunc)(entry.data); 129 | extractArguments(cur_cmd); 130 | function(); 131 | }break; 132 | case Entry::CVAR_INT: 133 | extractArguments(cur_cmd); 134 | HandleCvarInt(command, (int*)entry.data); 135 | break; 136 | case Entry::CVAR_FLOAT: 137 | extractArguments(cur_cmd); 138 | HandleCvarFloat(command, (float*)entry.data); 139 | break; 140 | case Entry::CVAR_STR: { 141 | extractArguments(cur_cmd); 142 | HandleCvarStr(command, *(string*)entry.data); 143 | } 144 | break; 145 | case Entry::HL_CVAR: 146 | extractArguments(cur_cmd); 147 | HandleHlCvar(command); 148 | break; 149 | } 150 | } 151 | else { 152 | if (!isHlCvar(command)) 153 | { 154 | { 155 | g_Engine.Con_Printf("Unknown command: %s\n", command); 156 | } 157 | } 158 | else 159 | { 160 | Add(command, Entry::HL_CVAR, NULL); 161 | extractArguments(cur_cmd); 162 | HandleHlCvar(command); 163 | } 164 | } 165 | } 166 | 167 | void CommandInterpreter::execFile(const char* filename) 168 | { 169 | if (strstr(filename, "..")) 170 | { 171 | g_Engine.Con_Printf("forbidden.\n"); 172 | return; 173 | } 174 | ifstream ifs(filename); 175 | if (!ifs) 176 | { 177 | return; 178 | } 179 | char buf[1024]; 180 | while (ifs) 181 | { 182 | ifs.getline(buf, 550, 10); 183 | if (!ifs) { break; } 184 | exec(buf); 185 | } 186 | } 187 | 188 | void CommandInterpreter::Add(char* name, int type, void* data) 189 | { 190 | if (names.find(name)) 191 | { 192 | g_Engine.Con_Printf("%s is already registered.\n", name); 193 | return; 194 | } 195 | int index = entries.size(); 196 | Entry tmp = { type, data, name }; 197 | entries.push_back(tmp); 198 | names.add(name, index); 199 | } 200 | 201 | inline static void lowercase(char* str) 202 | { 203 | while (*str){ *str = tolower(*str); ++str; } 204 | } 205 | 206 | void CommandInterpreter::AddAlias(const char* NamE, string& newcontent) 207 | { 208 | char name[36]; 209 | strncpy_s(name, NamE, 31); 210 | name[31] = 0; 211 | lowercase(name); 212 | if (names.find(name)) 213 | { 214 | Entry& entry = entries[names.num]; 215 | if (entry.type != Entry::ALIAS) 216 | { 217 | g_Engine.Con_Printf("%s is already registered.\n", name); 218 | return; 219 | } 220 | *(string*)(entry.data) = newcontent; 221 | return; 222 | } 223 | if (isHlCvar(name)) 224 | { 225 | g_Engine.Con_Printf("%s is a HL cvar.\n", name); 226 | return; 227 | } 228 | int index = entries.size(); 229 | string* initial_content = new string; 230 | *initial_content = newcontent; 231 | Entry tmp = { Entry::ALIAS, initial_content }; 232 | entries.push_back(tmp); 233 | names.add(name, index); 234 | } -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/anorms.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | 16 | {-0.525731, 0.000000, 0.850651}, 17 | {-0.442863, 0.238856, 0.864188}, 18 | {-0.295242, 0.000000, 0.955423}, 19 | {-0.309017, 0.500000, 0.809017}, 20 | {-0.162460, 0.262866, 0.951056}, 21 | {0.000000, 0.000000, 1.000000}, 22 | {0.000000, 0.850651, 0.525731}, 23 | {-0.147621, 0.716567, 0.681718}, 24 | {0.147621, 0.716567, 0.681718}, 25 | {0.000000, 0.525731, 0.850651}, 26 | {0.309017, 0.500000, 0.809017}, 27 | {0.525731, 0.000000, 0.850651}, 28 | {0.295242, 0.000000, 0.955423}, 29 | {0.442863, 0.238856, 0.864188}, 30 | {0.162460, 0.262866, 0.951056}, 31 | {-0.681718, 0.147621, 0.716567}, 32 | {-0.809017, 0.309017, 0.500000}, 33 | {-0.587785, 0.425325, 0.688191}, 34 | {-0.850651, 0.525731, 0.000000}, 35 | {-0.864188, 0.442863, 0.238856}, 36 | {-0.716567, 0.681718, 0.147621}, 37 | {-0.688191, 0.587785, 0.425325}, 38 | {-0.500000, 0.809017, 0.309017}, 39 | {-0.238856, 0.864188, 0.442863}, 40 | {-0.425325, 0.688191, 0.587785}, 41 | {-0.716567, 0.681718, -0.147621}, 42 | {-0.500000, 0.809017, -0.309017}, 43 | {-0.525731, 0.850651, 0.000000}, 44 | {0.000000, 0.850651, -0.525731}, 45 | {-0.238856, 0.864188, -0.442863}, 46 | {0.000000, 0.955423, -0.295242}, 47 | {-0.262866, 0.951056, -0.162460}, 48 | {0.000000, 1.000000, 0.000000}, 49 | {0.000000, 0.955423, 0.295242}, 50 | {-0.262866, 0.951056, 0.162460}, 51 | {0.238856, 0.864188, 0.442863}, 52 | {0.262866, 0.951056, 0.162460}, 53 | {0.500000, 0.809017, 0.309017}, 54 | {0.238856, 0.864188, -0.442863}, 55 | {0.262866, 0.951056, -0.162460}, 56 | {0.500000, 0.809017, -0.309017}, 57 | {0.850651, 0.525731, 0.000000}, 58 | {0.716567, 0.681718, 0.147621}, 59 | {0.716567, 0.681718, -0.147621}, 60 | {0.525731, 0.850651, 0.000000}, 61 | {0.425325, 0.688191, 0.587785}, 62 | {0.864188, 0.442863, 0.238856}, 63 | {0.688191, 0.587785, 0.425325}, 64 | {0.809017, 0.309017, 0.500000}, 65 | {0.681718, 0.147621, 0.716567}, 66 | {0.587785, 0.425325, 0.688191}, 67 | {0.955423, 0.295242, 0.000000}, 68 | {1.000000, 0.000000, 0.000000}, 69 | {0.951056, 0.162460, 0.262866}, 70 | {0.850651, -0.525731, 0.000000}, 71 | {0.955423, -0.295242, 0.000000}, 72 | {0.864188, -0.442863, 0.238856}, 73 | {0.951056, -0.162460, 0.262866}, 74 | {0.809017, -0.309017, 0.500000}, 75 | {0.681718, -0.147621, 0.716567}, 76 | {0.850651, 0.000000, 0.525731}, 77 | {0.864188, 0.442863, -0.238856}, 78 | {0.809017, 0.309017, -0.500000}, 79 | {0.951056, 0.162460, -0.262866}, 80 | {0.525731, 0.000000, -0.850651}, 81 | {0.681718, 0.147621, -0.716567}, 82 | {0.681718, -0.147621, -0.716567}, 83 | {0.850651, 0.000000, -0.525731}, 84 | {0.809017, -0.309017, -0.500000}, 85 | {0.864188, -0.442863, -0.238856}, 86 | {0.951056, -0.162460, -0.262866}, 87 | {0.147621, 0.716567, -0.681718}, 88 | {0.309017, 0.500000, -0.809017}, 89 | {0.425325, 0.688191, -0.587785}, 90 | {0.442863, 0.238856, -0.864188}, 91 | {0.587785, 0.425325, -0.688191}, 92 | {0.688191, 0.587785, -0.425325}, 93 | {-0.147621, 0.716567, -0.681718}, 94 | {-0.309017, 0.500000, -0.809017}, 95 | {0.000000, 0.525731, -0.850651}, 96 | {-0.525731, 0.000000, -0.850651}, 97 | {-0.442863, 0.238856, -0.864188}, 98 | {-0.295242, 0.000000, -0.955423}, 99 | {-0.162460, 0.262866, -0.951056}, 100 | {0.000000, 0.000000, -1.000000}, 101 | {0.295242, 0.000000, -0.955423}, 102 | {0.162460, 0.262866, -0.951056}, 103 | {-0.442863, -0.238856, -0.864188}, 104 | {-0.309017, -0.500000, -0.809017}, 105 | {-0.162460, -0.262866, -0.951056}, 106 | {0.000000, -0.850651, -0.525731}, 107 | {-0.147621, -0.716567, -0.681718}, 108 | {0.147621, -0.716567, -0.681718}, 109 | {0.000000, -0.525731, -0.850651}, 110 | {0.309017, -0.500000, -0.809017}, 111 | {0.442863, -0.238856, -0.864188}, 112 | {0.162460, -0.262866, -0.951056}, 113 | {0.238856, -0.864188, -0.442863}, 114 | {0.500000, -0.809017, -0.309017}, 115 | {0.425325, -0.688191, -0.587785}, 116 | {0.716567, -0.681718, -0.147621}, 117 | {0.688191, -0.587785, -0.425325}, 118 | {0.587785, -0.425325, -0.688191}, 119 | {0.000000, -0.955423, -0.295242}, 120 | {0.000000, -1.000000, 0.000000}, 121 | {0.262866, -0.951056, -0.162460}, 122 | {0.000000, -0.850651, 0.525731}, 123 | {0.000000, -0.955423, 0.295242}, 124 | {0.238856, -0.864188, 0.442863}, 125 | {0.262866, -0.951056, 0.162460}, 126 | {0.500000, -0.809017, 0.309017}, 127 | {0.716567, -0.681718, 0.147621}, 128 | {0.525731, -0.850651, 0.000000}, 129 | {-0.238856, -0.864188, -0.442863}, 130 | {-0.500000, -0.809017, -0.309017}, 131 | {-0.262866, -0.951056, -0.162460}, 132 | {-0.850651, -0.525731, 0.000000}, 133 | {-0.716567, -0.681718, -0.147621}, 134 | {-0.716567, -0.681718, 0.147621}, 135 | {-0.525731, -0.850651, 0.000000}, 136 | {-0.500000, -0.809017, 0.309017}, 137 | {-0.238856, -0.864188, 0.442863}, 138 | {-0.262866, -0.951056, 0.162460}, 139 | {-0.864188, -0.442863, 0.238856}, 140 | {-0.809017, -0.309017, 0.500000}, 141 | {-0.688191, -0.587785, 0.425325}, 142 | {-0.681718, -0.147621, 0.716567}, 143 | {-0.442863, -0.238856, 0.864188}, 144 | {-0.587785, -0.425325, 0.688191}, 145 | {-0.309017, -0.500000, 0.809017}, 146 | {-0.147621, -0.716567, 0.681718}, 147 | {-0.425325, -0.688191, 0.587785}, 148 | {-0.162460, -0.262866, 0.951056}, 149 | {0.442863, -0.238856, 0.864188}, 150 | {0.162460, -0.262866, 0.951056}, 151 | {0.309017, -0.500000, 0.809017}, 152 | {0.147621, -0.716567, 0.681718}, 153 | {0.000000, -0.525731, 0.850651}, 154 | {0.425325, -0.688191, 0.587785}, 155 | {0.587785, -0.425325, 0.688191}, 156 | {0.688191, -0.587785, 0.425325}, 157 | {-0.955423, 0.295242, 0.000000}, 158 | {-0.951056, 0.162460, 0.262866}, 159 | {-1.000000, 0.000000, 0.000000}, 160 | {-0.850651, 0.000000, 0.525731}, 161 | {-0.955423, -0.295242, 0.000000}, 162 | {-0.951056, -0.162460, 0.262866}, 163 | {-0.864188, 0.442863, -0.238856}, 164 | {-0.951056, 0.162460, -0.262866}, 165 | {-0.809017, 0.309017, -0.500000}, 166 | {-0.864188, -0.442863, -0.238856}, 167 | {-0.951056, -0.162460, -0.262866}, 168 | {-0.809017, -0.309017, -0.500000}, 169 | {-0.681718, 0.147621, -0.716567}, 170 | {-0.681718, -0.147621, -0.716567}, 171 | {-0.850651, 0.000000, -0.525731}, 172 | {-0.688191, 0.587785, -0.425325}, 173 | {-0.587785, 0.425325, -0.688191}, 174 | {-0.425325, 0.688191, -0.587785}, 175 | {-0.425325, -0.688191, -0.587785}, 176 | {-0.587785, -0.425325, -0.688191}, 177 | {-0.688191, -0.587785, -0.425325}, 178 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/pm_defs.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, 2000, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // pm_defs.h 16 | #if !defined( PM_DEFSH ) 17 | #define PM_DEFSH 18 | #pragma once 19 | 20 | #define MAX_PHYSENTS 600 // Must have room for all entities in the world. 21 | #define MAX_MOVEENTS 64 22 | #define MAX_CLIP_PLANES 5 23 | 24 | #define PM_NORMAL 0x00000000 25 | #define PM_STUDIO_IGNORE 0x00000001 // Skip studio models 26 | #define PM_STUDIO_BOX 0x00000002 // Use boxes for non-complex studio models (even in traceline) 27 | #define PM_GLASS_IGNORE 0x00000004 // Ignore entities with non-normal rendermode 28 | #define PM_WORLD_ONLY 0x00000008 // Only trace against the world 29 | 30 | // Values for flags parameter of PM_TraceLine 31 | #define PM_TRACELINE_ANYVISIBLE 0 32 | #define PM_TRACELINE_PHYSENTSONLY 1 33 | 34 | #include "pm_info.h" 35 | 36 | // PM_PlayerTrace results. 37 | //#include "engine/pmtrace.h" 38 | 39 | #if !defined ( USERCMD_H ) 40 | #include "usercmd.h" 41 | #endif 42 | 43 | // physent_t 44 | typedef struct physent_s 45 | { 46 | char name[32]; // Name of model, or "player" or "world". 47 | int player; 48 | vec3_t origin; // Model's origin in world coordinates. 49 | struct model_s *model; // only for bsp models 50 | struct model_s *studiomodel; // SOLID_BBOX, but studio clip intersections. 51 | vec3_t mins, maxs; // only for non-bsp models 52 | int info; // For client or server to use to identify (index into edicts or cl_entities) 53 | vec3_t angles; // rotated entities need this info for hull testing to work. 54 | 55 | int solid; // Triggers and func_door type WATER brushes are SOLID_NOT 56 | int skin; // BSP Contents for such things like fun_door water brushes. 57 | int rendermode; // So we can ignore glass 58 | 59 | // Complex collision detection. 60 | float frame; 61 | int sequence; 62 | byte controller[4]; 63 | byte blending[2]; 64 | 65 | int movetype; 66 | int takedamage; 67 | int blooddecal; 68 | int team; 69 | int classnumber; 70 | 71 | // For mods 72 | int iuser1; 73 | int iuser2; 74 | int iuser3; 75 | int iuser4; 76 | float fuser1; 77 | float fuser2; 78 | float fuser3; 79 | float fuser4; 80 | vec3_t vuser1; 81 | vec3_t vuser2; 82 | vec3_t vuser3; 83 | vec3_t vuser4; 84 | } physent_t; 85 | 86 | typedef struct playermove_s playermove_t; 87 | 88 | struct playermove_s 89 | { 90 | int player_index; // So we don't try to run the PM_CheckStuck nudging too quickly. 91 | qboolean server; // For debugging, are we running physics code on server side? 92 | 93 | qboolean multiplayer; // 1 == multiplayer server 94 | float time; // realtime on host, for reckoning duck timing 95 | float frametime; // Duration of this frame 96 | 97 | vec3_t forward, right, up; // Vectors for angles 98 | // player state 99 | vec3_t origin; // Movement origin. 100 | vec3_t angles; // Movement view angles. 101 | vec3_t oldangles; // Angles before movement view angles were looked at. 102 | vec3_t velocity; // Current movement direction. 103 | vec3_t movedir; // For waterjumping, a forced forward velocity so we can fly over lip of ledge. 104 | vec3_t basevelocity; // Velocity of the conveyor we are standing, e.g. 105 | 106 | // For ducking/dead 107 | vec3_t view_ofs; // Our eye position. 108 | float flDuckTime; // Time we started duck 109 | qboolean bInDuck; // In process of ducking or ducked already? 110 | 111 | // For walking/falling 112 | int flTimeStepSound; // Next time we can play a step sound 113 | int iStepLeft; 114 | 115 | float flFallVelocity; 116 | vec3_t punchangle; 117 | 118 | float flSwimTime; 119 | 120 | float flNextPrimaryAttack; 121 | 122 | int effects; // MUZZLE FLASH, e.g. 123 | 124 | int flags; // FL_ONGROUND, FL_DUCKING, etc. 125 | int usehull; // 0 = regular player hull, 1 = ducked player hull, 2 = point hull 126 | float gravity; // Our current gravity and friction. 127 | float friction; 128 | int oldbuttons; // Buttons last usercmd 129 | float waterjumptime; // Amount of time left in jumping out of water cycle. 130 | qboolean dead; // Are we a dead player? 131 | int deadflag; 132 | int spectator; // Should we use spectator physics model? 133 | int movetype; // Our movement type, NOCLIP, WALK, FLY 134 | 135 | int onground; 136 | int waterlevel; 137 | int watertype; 138 | int oldwaterlevel; 139 | 140 | char sztexturename[256]; 141 | char chtexturetype; 142 | 143 | float maxspeed; 144 | float clientmaxspeed; // Player specific maxspeed 145 | 146 | // For mods 147 | int iuser1; 148 | int iuser2; 149 | int iuser3; 150 | int iuser4; 151 | float fuser1; 152 | float fuser2; 153 | float fuser3; 154 | float fuser4; 155 | vec3_t vuser1; 156 | vec3_t vuser2; 157 | vec3_t vuser3; 158 | vec3_t vuser4; 159 | // world state 160 | // Number of entities to clip against. 161 | int numphysent; 162 | physent_t physents[MAX_PHYSENTS]; 163 | // Number of momvement entities (ladders) 164 | int nummoveent; 165 | // just a list of ladders 166 | physent_t moveents[MAX_MOVEENTS]; 167 | 168 | // All things being rendered, for tracing against things you don't actually collide with 169 | int numvisent; 170 | physent_t visents[ MAX_PHYSENTS ]; 171 | 172 | // input to run through physics. 173 | usercmd_t cmd; 174 | 175 | // Trace results for objects we collided with. 176 | int numtouch; 177 | pmtrace_t touchindex[MAX_PHYSENTS]; 178 | 179 | char physinfo[ MAX_PHYSINFO_STRING ]; // Physics info string 180 | 181 | struct movevars_s *movevars; 182 | vec3_t player_mins[ 4 ]; 183 | vec3_t player_maxs[ 4 ]; 184 | 185 | // Common functions 186 | const char *(*PM_Info_ValueForKey) ( const char *s, const char *key ); 187 | void (*PM_Particle)( vec3_t origin, int color, float life, int zpos, int zvel); 188 | int (*PM_TestPlayerPosition) (vec3_t pos, pmtrace_t *ptrace ); 189 | void (*Con_NPrintf)( int idx, char *fmt, ... ); 190 | void (*Con_DPrintf)( char *fmt, ... ); 191 | void (*Con_Printf)( char *fmt, ... ); 192 | double (*Sys_FloatTime)( void ); 193 | void (*PM_StuckTouch)( int hitent, pmtrace_t *ptraceresult ); 194 | int (*PM_PointContents) (vec3_t p, int *truecontents /*filled in if this is non-null*/ ); 195 | int (*PM_TruePointContents) (vec3_t p); 196 | int (*PM_HullPointContents) ( struct hull_s *hull, int num, vec3_t p); 197 | pmtrace_t (*PM_PlayerTrace) (vec3_t start, vec3_t end, int traceFlags, int ignore_pe ); 198 | struct pmtrace_s *(*PM_TraceLine)( float *start, float *end, int flags, int usehull, int ignore_pe ); 199 | long (*RandomLong)( long lLow, long lHigh ); 200 | float (*RandomFloat)( float flLow, float flHigh ); 201 | int (*PM_GetModelType)( struct model_s *mod ); 202 | void (*PM_GetModelBounds)( struct model_s *mod, vec3_t mins, vec3_t maxs ); 203 | void *(*PM_HullForBsp)( physent_t *pe, vec3_t offset ); 204 | float (*PM_TraceModel)( physent_t *pEnt, vec3_t start, vec3_t end, trace_t *trace ); 205 | int (*COM_FileSize)(char *filename); 206 | byte *(*COM_LoadFile) (char *path, int usehunk, int *pLength); 207 | void (*COM_FreeFile) ( void *buffer ); 208 | char *(*memfgets)( byte *pMemFile, int fileSize, int *pFilePos, char *pBuffer, int bufferSize ); 209 | 210 | // Functions 211 | // Run functions for this frame? 212 | qboolean runfuncs; 213 | void (*PM_PlaySound) ( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch ); 214 | const char *(*PM_TraceTexture) ( int ground, vec3_t vstart, vec3_t vend ); 215 | void (*PM_PlaybackEventFull) ( int flags, int clientindex, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); 216 | }; 217 | 218 | #endif 219 | -------------------------------------------------------------------------------- /RobinBot/ValveSDK/common/com_model.h: -------------------------------------------------------------------------------- 1 | // com_model.h 2 | #if !defined( COM_MODEL_H ) 3 | #define COM_MODEL_H 4 | #if defined( _WIN32 ) 5 | #pragma once 6 | #endif 7 | 8 | #define STUDIO_RENDER 1 9 | #define STUDIO_EVENTS 2 10 | 11 | #define MAX_CLIENTS 32 12 | #define MAX_EDICTS 900 13 | 14 | #define MAX_MODEL_NAME 64 15 | #define MAX_MAP_HULLS 4 16 | #define MIPLEVELS 4 17 | #define NUM_AMBIENTS 4 // automatic ambient sounds 18 | #define MAXLIGHTMAPS 4 19 | #define PLANE_ANYZ 5 20 | 21 | #define ALIAS_Z_CLIP_PLANE 5 22 | 23 | // flags in finalvert_t.flags 24 | #define ALIAS_LEFT_CLIP 0x0001 25 | #define ALIAS_TOP_CLIP 0x0002 26 | #define ALIAS_RIGHT_CLIP 0x0004 27 | #define ALIAS_BOTTOM_CLIP 0x0008 28 | #define ALIAS_Z_CLIP 0x0010 29 | #define ALIAS_ONSEAM 0x0020 30 | #define ALIAS_XY_CLIP_MASK 0x000F 31 | 32 | #define ZISCALE ((float)0x8000) 33 | 34 | #define CACHE_SIZE 32 // used to align key data structures 35 | 36 | typedef enum 37 | { 38 | mod_brush, 39 | mod_sprite, 40 | mod_alias, 41 | mod_studio 42 | } modtype_t; 43 | 44 | // must match definition in modelgen.h 45 | #ifndef SYNCTYPE_T 46 | #define SYNCTYPE_T 47 | 48 | typedef enum 49 | { 50 | ST_SYNC=0, 51 | ST_RAND 52 | } synctype_t; 53 | 54 | #endif 55 | 56 | typedef struct 57 | { 58 | float mins[3], maxs[3]; 59 | float origin[3]; 60 | int headnode[MAX_MAP_HULLS]; 61 | int visleafs; // not including the solid leaf 0 62 | int firstface, numfaces; 63 | } dmodel_t; 64 | 65 | // plane_t structure 66 | typedef struct mplane_s 67 | { 68 | vec3_t normal; // surface normal 69 | float dist; // closest appoach to origin 70 | byte type; // for texture axis selection and fast side tests 71 | byte signbits; // signx + signy<<1 + signz<<1 72 | byte pad[2]; 73 | } mplane_t; 74 | 75 | typedef struct 76 | { 77 | vec3_t position; 78 | } mvertex_t; 79 | 80 | typedef struct 81 | { 82 | unsigned short v[2]; 83 | unsigned int cachededgeoffset; 84 | } medge_t; 85 | 86 | typedef struct texture_s 87 | { 88 | char name[16]; 89 | unsigned width, height; 90 | int anim_total; // total tenths in sequence ( 0 = no) 91 | int anim_min, anim_max; // time for this frame min <=time< max 92 | struct texture_s *anim_next; // in the animation sequence 93 | struct texture_s *alternate_anims; // bmodels in frame 1 use these 94 | unsigned offsets[MIPLEVELS]; // four mip maps stored 95 | unsigned paloffset; 96 | } texture_t; 97 | 98 | typedef struct 99 | { 100 | float vecs[2][4]; // [s/t] unit vectors in world space. 101 | // [i][3] is the s/t offset relative to the origin. 102 | // s or t = dot(3Dpoint,vecs[i])+vecs[i][3] 103 | float mipadjust; // ?? mipmap limits for very small surfaces 104 | texture_t *texture; 105 | int flags; // sky or slime, no lightmap or 256 subdivision 106 | } mtexinfo_t; 107 | 108 | typedef struct mnode_s 109 | { 110 | // common with leaf 111 | int contents; // 0, to differentiate from leafs 112 | int visframe; // node needs to be traversed if current 113 | 114 | short minmaxs[6]; // for bounding box culling 115 | 116 | struct mnode_s *parent; 117 | 118 | // node specific 119 | mplane_t *plane; 120 | struct mnode_s *children[2]; 121 | 122 | unsigned short firstsurface; 123 | unsigned short numsurfaces; 124 | } mnode_t; 125 | 126 | typedef struct msurface_s msurface_t; 127 | typedef struct decal_s decal_t; 128 | 129 | // JAY: Compress this as much as possible 130 | struct decal_s 131 | { 132 | decal_t *pnext; // linked list for each surface 133 | msurface_t *psurface; // Surface id for persistence / unlinking 134 | short dx; // Offsets into surface texture (in texture coordinates, so we don't need floats) 135 | short dy; 136 | short texture; // Decal texture 137 | byte scale; // Pixel scale 138 | byte flags; // Decal flags 139 | 140 | short entityIndex; // Entity this is attached to 141 | }; 142 | 143 | typedef struct mleaf_s 144 | { 145 | // common with node 146 | int contents; // wil be a negative contents number 147 | int visframe; // node needs to be traversed if current 148 | 149 | short minmaxs[6]; // for bounding box culling 150 | 151 | struct mnode_s *parent; 152 | 153 | // leaf specific 154 | byte *compressed_vis; 155 | struct efrag_s *efrags; 156 | 157 | msurface_t **firstmarksurface; 158 | int nummarksurfaces; 159 | int key; // BSP sequence number for leaf's contents 160 | byte ambient_sound_level[NUM_AMBIENTS]; 161 | } mleaf_t; 162 | 163 | struct msurface_s 164 | { 165 | int visframe; // should be drawn when node is crossed 166 | 167 | int dlightframe; // last frame the surface was checked by an animated light 168 | int dlightbits; // dynamically generated. Indicates if the surface illumination 169 | // is modified by an animated light. 170 | 171 | mplane_t *plane; // pointer to shared plane 172 | int flags; // see SURF_ #defines 173 | 174 | int firstedge; // look up in model->surfedges[], negative numbers 175 | int numedges; // are backwards edges 176 | 177 | // surface generation data 178 | struct surfcache_s *cachespots[MIPLEVELS]; 179 | 180 | short texturemins[2]; // smallest s/t position on the surface. 181 | short extents[2]; // ?? s/t texture size, 1..256 for all non-sky surfaces 182 | 183 | mtexinfo_t *texinfo; 184 | 185 | // lighting info 186 | byte styles[MAXLIGHTMAPS]; // index into d_lightstylevalue[] for animated lights 187 | // no one surface can be effected by more than 4 188 | // animated lights. 189 | color24 *samples; 190 | 191 | decal_t *pdecals; 192 | }; 193 | 194 | typedef struct 195 | { 196 | int planenum; 197 | short children[2]; // negative numbers are contents 198 | } dclipnode_t; 199 | 200 | typedef struct hull_s 201 | { 202 | dclipnode_t *clipnodes; 203 | mplane_t *planes; 204 | int firstclipnode; 205 | int lastclipnode; 206 | vec3_t clip_mins; 207 | vec3_t clip_maxs; 208 | } hull_t; 209 | 210 | #if !defined( CACHE_USER ) && !defined( QUAKEDEF_H ) 211 | #define CACHE_USER 212 | typedef struct cache_user_s 213 | { 214 | void *data; 215 | } cache_user_t; 216 | #endif 217 | 218 | typedef struct model_s 219 | { 220 | char name[ MAX_MODEL_NAME ]; 221 | qboolean needload; // bmodels and sprites don't cache normally 222 | 223 | modtype_t type; 224 | int numframes; 225 | synctype_t synctype; 226 | 227 | int flags; 228 | 229 | // 230 | // volume occupied by the model 231 | // 232 | vec3_t mins, maxs; 233 | float radius; 234 | 235 | // 236 | // brush model 237 | // 238 | int firstmodelsurface, nummodelsurfaces; 239 | 240 | int numsubmodels; 241 | dmodel_t *submodels; 242 | 243 | int numplanes; 244 | mplane_t *planes; 245 | 246 | int numleafs; // number of visible leafs, not counting 0 247 | struct mleaf_s *leafs; 248 | 249 | int numvertexes; 250 | mvertex_t *vertexes; 251 | 252 | int numedges; 253 | medge_t *edges; 254 | 255 | int numnodes; 256 | mnode_t *nodes; 257 | 258 | int numtexinfo; 259 | mtexinfo_t *texinfo; 260 | 261 | int numsurfaces; 262 | msurface_t *surfaces; 263 | 264 | int numsurfedges; 265 | int *surfedges; 266 | 267 | int numclipnodes; 268 | dclipnode_t *clipnodes; 269 | 270 | int nummarksurfaces; 271 | msurface_t **marksurfaces; 272 | 273 | hull_t hulls[MAX_MAP_HULLS]; 274 | 275 | int numtextures; 276 | texture_t **textures; 277 | 278 | byte *visdata; 279 | 280 | color24 *lightdata; 281 | 282 | char *entities; 283 | 284 | // 285 | // additional model data 286 | // 287 | cache_user_t cache; // only access through Mod_Extradata 288 | 289 | } model_t; 290 | 291 | typedef vec_t vec4_t[4]; 292 | 293 | typedef struct alight_s 294 | { 295 | int ambientlight; // clip at 128 296 | int shadelight; // clip at 192 - ambientlight 297 | vec3_t color; 298 | float *plightvec; 299 | } alight_t; 300 | 301 | typedef struct auxvert_s 302 | { 303 | float fv[3]; // viewspace x, y 304 | } auxvert_t; 305 | 306 | #include "../engine/custom.h" 307 | 308 | #define MAX_INFO_STRING 256 309 | #define MAX_SCOREBOARDNAME 32 310 | typedef struct player_info_s 311 | { 312 | // User id on server 313 | int userid; 314 | 315 | // User info string 316 | char userinfo[ MAX_INFO_STRING ]; 317 | 318 | // Name 319 | char name[ MAX_SCOREBOARDNAME ]; 320 | 321 | // Spectator or not, unused 322 | int spectator; 323 | 324 | int ping; 325 | int packet_loss; 326 | 327 | // skin information 328 | char model[MAX_QPATH]; 329 | int topcolor; 330 | int bottomcolor; 331 | 332 | // last frame rendered 333 | int renderframe; 334 | 335 | // Gait frame estimation 336 | int gaitsequence; 337 | float gaitframe; 338 | float gaityaw; 339 | vec3_t prevgaitorigin; 340 | 341 | customization_t customdata; 342 | } player_info_t; 343 | 344 | #endif // #define COM_MODEL_H 345 | -------------------------------------------------------------------------------- /RobinBot/players.cpp: -------------------------------------------------------------------------------- 1 | #include "players.h" 2 | 3 | #pragma warning(disable:4996) 4 | #pragma warning(disable:4800) 5 | #pragma warning(disable:4002) 6 | #pragma warning(disable:4244) 7 | 8 | CMe::CMe(void) 9 | { 10 | p_sInfo.eTeam = TEAM_NONE; 11 | 12 | } 13 | 14 | CMe::~CMe(){} 15 | 16 | void CMe::GetInfo(void) 17 | { 18 | p_sEnt = g_Engine.GetLocalPlayer(); 19 | 20 | g_Engine.pfnGetScreenFade(&(p_sInfo.sScreenFade)); 21 | 22 | g_Engine.pEventAPI->EV_LocalPlayerViewheight(p_sInfo.vViewOrg); 23 | VectorAdd(p_sEnt->origin, p_sInfo.vViewOrg, p_sInfo.vViewOrg); 24 | 25 | g_Engine.pfnGetPlayerInfo(p_sEnt->index, &sPlayerInfo); 26 | 27 | if ( g_Local.iTeam == 1 ) 28 | p_sInfo.eTeam = TEAM_T; 29 | else if ( g_Local.iTeam == 2 ) 30 | p_sInfo.eTeam = TEAM_CT; 31 | else if ( g_Local.iTeam == 3 ) 32 | p_sInfo.eTeam = TEAM_SPEC; 33 | else 34 | p_sInfo.eTeam = TEAM_NONE; 35 | 36 | p_sInfo.bIsGoodWeapon = true; 37 | model_s *pModel = g_Studio.GetModelByIndex(p_sEnt->curstate.weaponmodel); 38 | if (pModel != NULL) 39 | { 40 | strncpy(p_sInfo.cWeapon, pModel->name, sizeof(p_sInfo.cWeapon)); 41 | char *cWeaponName = p_sInfo.cWeapon; 42 | if (strstr(cWeaponName, "hegrenade") || 43 | strstr(cWeaponName, "flashbang") || 44 | strstr(cWeaponName, "smokegrenade") || 45 | strstr(cWeaponName, "knife") || 46 | strstr(cWeaponName, "c4")) 47 | p_sInfo.bIsGoodWeapon = false; 48 | } 49 | 50 | int iSequenceType = iSequenceInfoTable[p_sEnt->curstate.sequence]; 51 | if (iSequenceType == 2 || iSequenceType == 5) 52 | p_sInfo.bIsReloading = true; 53 | else 54 | p_sInfo.bIsReloading = false; 55 | } 56 | 57 | cl_entity_t *CMe::Entity(void) 58 | { 59 | return p_sEnt; 60 | } 61 | 62 | ME_INFO *CMe::Info(void) 63 | { 64 | return &p_sInfo; 65 | } 66 | 67 | bool CMe::Visible(Vector *vInput) 68 | { 69 | pmtrace_t *sTrace = g_Engine.PM_TraceLine(p_sInfo.vViewOrg, (*vInput), 0, 2, -1); 70 | return (sTrace->fraction >= 1.0f); 71 | } 72 | 73 | float CMe::Distance(Vector *vInput) 74 | { 75 | return (float)(VectorDistance(p_sInfo.vViewOrg, (*vInput)) / 22.0f); 76 | } 77 | 78 | bool CMe::IsFlashed(void) 79 | { 80 | return (!(!(p_sInfo.sScreenFade.fader == 255 && p_sInfo.sScreenFade.fadeg == 255 && p_sInfo.sScreenFade.fadeb == 255) || 81 | p_sInfo.sScreenFade.fadealpha <= 150)); 82 | } 83 | 84 | void CMe::CalcViewAngles(Vector *vOrigin, Vector *vOutput) 85 | { 86 | Vector vDelta; 87 | VectorSubtract(&(p_sInfo.vViewOrg), vOrigin, &vDelta); 88 | 89 | // vOut->x 90 | float adjacent = sqrt(POW(vDelta.x) + POW(vDelta.y)); 91 | p_sInfo.vAimAngles.x = (float)RADTODEG(atan(vDelta.z / adjacent)); 92 | 93 | // vOut->y 94 | if (vDelta.x >= 0) // front 95 | { 96 | if (vDelta.y >= 0) // right 97 | p_sInfo.vAimAngles.y = (float)RADTODEG(atan(fabs(vDelta.y / vDelta.x))) + 180.0f; 98 | else // left 99 | p_sInfo.vAimAngles.y = (float)RADTODEG(atan(fabs(vDelta.x / vDelta.y))) + 90.0f; 100 | } 101 | else // behind 102 | { 103 | if (vDelta.y >= 0) 104 | p_sInfo.vAimAngles.y = (float)RADTODEG(atan(fabs(vDelta.x / vDelta.y))) + 270.0f; 105 | else 106 | p_sInfo.vAimAngles.y = (float)RADTODEG(atan(fabs(vDelta.y / vDelta.x))); 107 | } 108 | 109 | // vOut->z 110 | p_sInfo.vAimAngles.z = 0.0f; 111 | 112 | if (vOutput != NULL) 113 | VectorCopy(&(p_sInfo.vAimAngles), vOutput); 114 | } 115 | 116 | CPlayer::CPlayer(void){} 117 | CPlayer::~CPlayer(){} 118 | 119 | void CPlayer::GetInfo(int nID) 120 | { 121 | p_sEnt = g_Engine.GetEntityByIndex(nID); 122 | p_sInfo.bGotBone = false; 123 | p_sInfo.bValid = ValidateEntity(); 124 | 125 | if (p_sInfo.bValid) 126 | { 127 | //SoundCopy(g_cPlayers.player(i)->cursound, g_cPlayers.player(i)->oldsound); 128 | 129 | VectorCopy(p_sEnt->origin, p_sInfo.sSound.vOrigin); // todo p_sEnt -> p_pEnt 130 | p_sInfo.sSound.dwTime = GetTickCount(); 131 | p_sInfo.sSound.bValid = true; 132 | 133 | int iSequenceType = iSequenceInfoTable[p_sEnt->curstate.sequence]; 134 | if (iSequenceType == 2 || iSequenceType == 5) 135 | p_sInfo.bIsVulnerable = true; 136 | else 137 | p_sInfo.bIsVulnerable = false; 138 | 139 | g_Engine.pfnGetPlayerInfo(nID, &sPlayerInfo); 140 | 141 | if ( g_Player[nID].iTeam == 1 ) 142 | p_sInfo.eTeam = TEAM_T; 143 | else if ( g_Player[nID].iTeam == 2 ) 144 | p_sInfo.eTeam = TEAM_CT; 145 | else if ( g_Player[nID].iTeam == 3 ) 146 | p_sInfo.eTeam = TEAM_SPEC; 147 | else 148 | p_sInfo.eTeam = TEAM_NONE; 149 | } 150 | } 151 | 152 | cl_entity_t *CPlayer::Entity(void) 153 | { 154 | return p_sEnt; 155 | } 156 | 157 | PPLAYER_INFO CPlayer::Info(void) 158 | { 159 | return &p_sInfo; 160 | } 161 | 162 | bool CPlayer::ValidateEntity(void) 163 | { 164 | if( (p_sEnt->index != g_Local.iIndex) && !(p_sEnt->curstate.effects & EF_NODRAW) && p_sEnt->player && (p_sEnt->model->name !=0 || p_sEnt->model->name !="") && !(p_sEnt->curstate.messagenum < g_Engine.GetLocalPlayer()->curstate.messagenum)) 165 | return true; 166 | else 167 | return false; 168 | } 169 | 170 | float CPlayer::Distance(Vector *vInput) 171 | { 172 | return (float)(VectorDistance(p_sInfo.vOrigin, (*vInput)) / 22.0f); 173 | } 174 | 175 | float CPlayer::BoneDistance(Vector *vInput) 176 | { 177 | return (float)(VectorDistance(p_sInfo.vAimBone, (*vInput)) / 22.0f); // todo: use dyn vecs here 178 | } 179 | 180 | bool CPlayer::IsInFov(float fFov) 181 | { 182 | if ((fFov == 0.0f) || 183 | ((p_sInfo.fScreen[0] <= g_Screen.iWidth/2 + fFov) && 184 | (p_sInfo.fScreen[0] >= g_Screen.iWidth/2 - fFov) && 185 | (p_sInfo.fScreen[1] <= g_Screen.iHeight/2 + fFov) && 186 | (p_sInfo.fScreen[1] >= g_Screen.iHeight/2 - fFov))) 187 | return true; 188 | 189 | return false; 190 | } 191 | 192 | Vector *CPlayer::Position(void) 193 | { 194 | return &(p_sInfo.vOrigin); 195 | } 196 | 197 | Vector *CPlayer::BonePosition(void) 198 | { 199 | return &(p_sInfo.vAimBone); 200 | // vOutput->x = (p_sInfo.sBones)[nBoneID][0][3]; 201 | // vOutput->y = (p_sInfo.sBones)[nBoneID][1][3]; 202 | // vOutput->z = (p_sInfo.sBones)[nBoneID][2][3]; 203 | } 204 | 205 | bool CalcScreen(Vector *vInput, float *fOutput) 206 | { 207 | int iRasterizer = g_Engine.pTriAPI->WorldToScreen((*vInput), fOutput); 208 | if (fOutput[0] < 1 && fOutput[1] < 1 && fOutput[0] > -1 && fOutput[1] > -1 && !iRasterizer) 209 | { 210 | int iScreenCenterX = g_Screen.iWidth / 2; 211 | int iScreenCenterY = g_Screen.iHeight / 2; 212 | 213 | fOutput[0] = fOutput[0] * iScreenCenterX + iScreenCenterX; 214 | fOutput[1] = -fOutput[1] * iScreenCenterY + iScreenCenterY; 215 | 216 | return true; 217 | } 218 | 219 | return false; 220 | } 221 | void VectorTransform(float *in1, float in2[3][4], float *out) 222 | { 223 | out[0] = DotProduct(in1, in2[0]) + in2[0][3]; 224 | out[1] = DotProduct(in1, in2[1]) + in2[1][3]; 225 | out[2] = DotProduct(in1, in2[2]) + in2[2][3]; 226 | } 227 | 228 | bool CPlayer::ScreenPosition(float *fOutput) 229 | { 230 | p_sInfo.bIsScreen = CalcScreen(Position(), p_sInfo.fScreen); 231 | if (fOutput != NULL) { fOutput[0] = p_sInfo.fScreen[0]; fOutput[1] = p_sInfo.fScreen[1]; } 232 | return p_sInfo.bIsScreen; 233 | } 234 | 235 | bool CPlayer::BoneScreenPosition(float *fOutput) 236 | { 237 | p_sInfo.bIsBoneScreen = CalcScreen(BonePosition(), p_sInfo.fBoneScreen); 238 | if (fOutput != NULL) { fOutput[0] = p_sInfo.fBoneScreen[0]; fOutput[1] = p_sInfo.fBoneScreen[1]; } 239 | return p_sInfo.bIsBoneScreen; 240 | 241 | } 242 | 243 | void CPlayer::GetBoneInformation(VECTOR_MODE eMode, int nNum) 244 | { 245 | add_log("GetBoneInformation 1"); 246 | 247 | model_s *pModel = nullptr; 248 | studiohdr_t *pStudioHeader = nullptr; 249 | mstudiobbox_t *pStudioBox = nullptr; 250 | PTRANSFORM_MATRIX pTransformMatrix = (PTRANSFORM_MATRIX)g_Studio.StudioGetBoneTransform(); 251 | 252 | add_log("GetBoneInformation 2"); 253 | 254 | // switch me! 255 | if (eMode == VM_BONE) 256 | { 257 | add_log("GetBoneInformation 3"); 258 | p_sInfo.vAimBone.x = (*pTransformMatrix)[nNum][0][3]; 259 | p_sInfo.vAimBone.y = (*pTransformMatrix)[nNum][1][3]; 260 | p_sInfo.vAimBone.z = (*pTransformMatrix)[nNum][2][3]; 261 | add_log("GetBoneInformation 4"); 262 | } 263 | else if (eMode == VM_HITBOX) 264 | { 265 | add_log("GetBoneInformation 5"); 266 | if (p_sInfo.bGotBone) 267 | return; 268 | add_log("GetBoneInformation 6"); 269 | pModel = g_Studio.SetupPlayerModel(p_sEnt->index); 270 | add_log("GetBoneInformation 6 1"); 271 | pStudioHeader = (studiohdr_t *)g_Studio.Mod_Extradata(pModel); 272 | add_log("GetBoneInformation 6 2"); 273 | pStudioBox = (mstudiobbox_t *)((PBYTE)pStudioHeader + pStudioHeader->hitboxindex); 274 | add_log("GetBoneInformation 7"); 275 | Vector vMin, vMax; 276 | VectorTransform(pStudioBox[nNum].bbmin, (*pTransformMatrix)[pStudioBox[nNum].bone], vMin); 277 | VectorTransform(pStudioBox[nNum].bbmax, (*pTransformMatrix)[pStudioBox[nNum].bone], vMax); 278 | add_log("GetBoneInformation 8"); 279 | p_sInfo.vAimBone = (vMin + vMax) * 0.5f; 280 | p_sInfo.bGotBone = true; 281 | add_log("GetBoneInformation 9"); 282 | } 283 | } 284 | 285 | CPlayers::CPlayers(void) 286 | { 287 | p_cMe = new CMe; 288 | p_cPlayers = new CPlayer[MAX_VPLAYERS]; 289 | } 290 | 291 | CPlayers::~CPlayers() 292 | { 293 | delete[] p_cPlayers; 294 | delete p_cMe; 295 | } 296 | 297 | int CPlayers::Size(void) 298 | { 299 | return MAX_VPLAYERS; 300 | } 301 | 302 | CMe *CPlayers::Me(void) 303 | { 304 | return p_cMe; 305 | } 306 | 307 | CPlayer *CPlayers::Player(int i) 308 | { 309 | if (i >= 0 && i < MAX_VPLAYERS) 310 | return &p_cPlayers[i]; 311 | return &p_cPlayers[0]; 312 | } -------------------------------------------------------------------------------- /RobinBot/ValveSDK/engine/studio.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | 16 | 17 | 18 | 19 | #ifndef _STUDIO_H_ 20 | #define _STUDIO_H_ 21 | 22 | /* 23 | ============================================================================== 24 | 25 | STUDIO MODELS 26 | 27 | Studio models are position independent, so the cache manager can move them. 28 | ============================================================================== 29 | */ 30 | 31 | 32 | #define MAXSTUDIOTRIANGLES 20000 // TODO: tune this 33 | #define MAXSTUDIOVERTS 2048 // TODO: tune this 34 | #define MAXSTUDIOSEQUENCES 256 // total animation sequences 35 | #define MAXSTUDIOSKINS 100 // total textures 36 | #define MAXSTUDIOSRCBONES 512 // bones allowed at source movement 37 | #define MAXSTUDIOBONES 128 // total bones actually used 38 | #define MAXSTUDIOMODELS 32 // sub-models per model 39 | #define MAXSTUDIOBODYPARTS 32 40 | #define MAXSTUDIOGROUPS 16 41 | #define MAXSTUDIOANIMATIONS 512 // per sequence 42 | #define MAXSTUDIOMESHES 256 43 | #define MAXSTUDIOEVENTS 1024 44 | #define MAXSTUDIOPIVOTS 256 45 | #define MAXSTUDIOCONTROLLERS 8 46 | 47 | typedef struct 48 | { 49 | int id; 50 | int version; 51 | 52 | char name[64]; 53 | int length; 54 | 55 | vec3_t eyeposition; // ideal eye position 56 | vec3_t min; // ideal movement hull size 57 | vec3_t max; 58 | 59 | vec3_t bbmin; // clipping bounding box 60 | vec3_t bbmax; 61 | 62 | int flags; 63 | 64 | int numbones; // bones 65 | int boneindex; 66 | 67 | int numbonecontrollers; // bone controllers 68 | int bonecontrollerindex; 69 | 70 | int numhitboxes; // complex bounding boxes 71 | int hitboxindex; 72 | 73 | int numseq; // animation sequences 74 | int seqindex; 75 | 76 | int numseqgroups; // demand loaded sequences 77 | int seqgroupindex; 78 | 79 | int numtextures; // raw textures 80 | int textureindex; 81 | int texturedataindex; 82 | 83 | int numskinref; // replaceable textures 84 | int numskinfamilies; 85 | int skinindex; 86 | 87 | int numbodyparts; 88 | int bodypartindex; 89 | 90 | int numattachments; // queryable attachable points 91 | int attachmentindex; 92 | 93 | int soundtable; 94 | int soundindex; 95 | int soundgroups; 96 | int soundgroupindex; 97 | 98 | int numtransitions; // animation node to animation node transition graph 99 | int transitionindex; 100 | } studiohdr_t; 101 | 102 | // header for demand loaded sequence group data 103 | typedef struct 104 | { 105 | int id; 106 | int version; 107 | 108 | char name[64]; 109 | int length; 110 | } studioseqhdr_t; 111 | 112 | // bones 113 | typedef struct 114 | { 115 | char name[32]; // bone name for symbolic links 116 | int parent; // parent bone 117 | int flags; // ?? 118 | int bonecontroller[6]; // bone controller index, -1 == none 119 | float value[6]; // default DoF values 120 | float scale[6]; // scale for delta DoF values 121 | } mstudiobone_t; 122 | 123 | 124 | // bone controllers 125 | typedef struct 126 | { 127 | int bone; // -1 == 0 128 | int type; // X, Y, Z, XR, YR, ZR, M 129 | float start; 130 | float end; 131 | int rest; // byte index value at rest 132 | int index; // 0-3 user set controller, 4 mouth 133 | } mstudiobonecontroller_t; 134 | 135 | // intersection boxes 136 | typedef struct 137 | { 138 | int bone; 139 | int group; // intersection group 140 | vec3_t bbmin; // bounding box 141 | vec3_t bbmax; 142 | } mstudiobbox_t; 143 | 144 | #if !defined( CACHE_USER ) && !defined( QUAKEDEF_H ) 145 | #define CACHE_USER 146 | typedef struct cache_user_s 147 | { 148 | void *data; 149 | } cache_user_t; 150 | #endif 151 | 152 | // demand loaded sequence groups 153 | typedef struct 154 | { 155 | char label[32]; // textual name 156 | char name[64]; // file name 157 | cache_user_t cache; // cache index pointer 158 | int data; // hack for group 0 159 | } mstudioseqgroup_t; 160 | 161 | // sequence descriptions 162 | typedef struct 163 | { 164 | char label[32]; // sequence label 165 | 166 | float fps; // frames per second 167 | int flags; // looping/non-looping flags 168 | 169 | int activity; 170 | int actweight; 171 | 172 | int numevents; 173 | int eventindex; 174 | 175 | int numframes; // number of frames per sequence 176 | 177 | int numpivots; // number of foot pivots 178 | int pivotindex; 179 | 180 | int motiontype; 181 | int motionbone; 182 | vec3_t linearmovement; 183 | int automoveposindex; 184 | int automoveangleindex; 185 | 186 | vec3_t bbmin; // per sequence bounding box 187 | vec3_t bbmax; 188 | 189 | int numblends; 190 | int animindex; // mstudioanim_t pointer relative to start of sequence group data 191 | // [blend][bone][X, Y, Z, XR, YR, ZR] 192 | 193 | int blendtype[2]; // X, Y, Z, XR, YR, ZR 194 | float blendstart[2]; // starting value 195 | float blendend[2]; // ending value 196 | int blendparent; 197 | 198 | int seqgroup; // sequence group for demand loading 199 | 200 | int entrynode; // transition node at entry 201 | int exitnode; // transition node at exit 202 | int nodeflags; // transition rules 203 | 204 | int nextseq; // auto advancing sequences 205 | } mstudioseqdesc_t; 206 | 207 | // events 208 | #include "studio_event.h" 209 | /* 210 | typedef struct 211 | { 212 | int frame; 213 | int event; 214 | int type; 215 | char options[64]; 216 | } mstudioevent_t; 217 | */ 218 | 219 | // pivots 220 | typedef struct 221 | { 222 | vec3_t org; // pivot point 223 | int start; 224 | int end; 225 | } mstudiopivot_t; 226 | 227 | // attachment 228 | typedef struct 229 | { 230 | char name[32]; 231 | int type; 232 | int bone; 233 | vec3_t org; // attachment point 234 | vec3_t vectors[3]; 235 | } mstudioattachment_t; 236 | 237 | typedef struct 238 | { 239 | unsigned short offset[6]; 240 | } mstudioanim_t; 241 | 242 | // animation frames 243 | typedef union 244 | { 245 | struct { 246 | byte valid; 247 | byte total; 248 | } num; 249 | short value; 250 | } mstudioanimvalue_t; 251 | 252 | 253 | 254 | // body part index 255 | typedef struct 256 | { 257 | char name[64]; 258 | int nummodels; 259 | int base; 260 | int modelindex; // index into models array 261 | } mstudiobodyparts_t; 262 | 263 | 264 | 265 | // skin info 266 | typedef struct 267 | { 268 | char name[64]; 269 | int flags; 270 | int width; 271 | int height; 272 | int index; 273 | } mstudiotexture_t; 274 | 275 | 276 | // skin families 277 | // short index[skinfamilies][skinref] 278 | 279 | // studio models 280 | typedef struct 281 | { 282 | char name[64]; 283 | 284 | int type; 285 | 286 | float boundingradius; 287 | 288 | int nummesh; 289 | int meshindex; 290 | 291 | int numverts; // number of unique vertices 292 | int vertinfoindex; // vertex bone info 293 | int vertindex; // vertex vec3_t 294 | int numnorms; // number of unique surface normals 295 | int norminfoindex; // normal bone info 296 | int normindex; // normal vec3_t 297 | 298 | int numgroups; // deformation groups 299 | int groupindex; 300 | } mstudiomodel_t; 301 | 302 | 303 | // vec3_t boundingbox[model][bone][2]; // complex intersection info 304 | 305 | 306 | // meshes 307 | typedef struct 308 | { 309 | int numtris; 310 | int triindex; 311 | int skinref; 312 | int numnorms; // per mesh normals 313 | int normindex; // normal vec3_t 314 | } mstudiomesh_t; 315 | 316 | // triangles 317 | #if 0 318 | typedef struct 319 | { 320 | short vertindex; // index into vertex array 321 | short normindex; // index into normal array 322 | short s,t; // s,t position on skin 323 | } mstudiotrivert_t; 324 | #endif 325 | 326 | // lighting options 327 | #define STUDIO_NF_FLATSHADE 0x0001 328 | #define STUDIO_NF_CHROME 0x0002 329 | #define STUDIO_NF_FULLBRIGHT 0x0004 330 | 331 | // motion flags 332 | #define STUDIO_X 0x0001 333 | #define STUDIO_Y 0x0002 334 | #define STUDIO_Z 0x0004 335 | #define STUDIO_XR 0x0008 336 | #define STUDIO_YR 0x0010 337 | #define STUDIO_ZR 0x0020 338 | #define STUDIO_LX 0x0040 339 | #define STUDIO_LY 0x0080 340 | #define STUDIO_LZ 0x0100 341 | #define STUDIO_AX 0x0200 342 | #define STUDIO_AY 0x0400 343 | #define STUDIO_AZ 0x0800 344 | #define STUDIO_AXR 0x1000 345 | #define STUDIO_AYR 0x2000 346 | #define STUDIO_AZR 0x4000 347 | #define STUDIO_TYPES 0x7FFF 348 | #define STUDIO_RLOOP 0x8000 // controller that wraps shortest distance 349 | 350 | // sequence flags 351 | #define STUDIO_LOOPING 0x0001 352 | 353 | // bone flags 354 | #define STUDIO_HAS_NORMALS 0x0001 355 | #define STUDIO_HAS_VERTICES 0x0002 356 | #define STUDIO_HAS_BBOX 0x0004 357 | #define STUDIO_HAS_CHROME 0x0008 // if any of the textures have chrome on them 358 | 359 | #define RAD_TO_STUDIO (32768.0/M_PI) 360 | #define STUDIO_TO_RAD (M_PI/32768.0) 361 | 362 | #endif 363 | --------------------------------------------------------------------------------