Massive reorganization attempt - part 1.77
This commit is contained in:
263
dlls/cstrike/csx/CMisc.cpp
Executable file
263
dlls/cstrike/csx/CMisc.cpp
Executable file
@ -0,0 +1,263 @@
|
||||
|
||||
|
||||
#include "CMisc.h"
|
||||
#include "rank.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Grenades
|
||||
// *****************************************************
|
||||
void Grenades::put( edict_t* grenade, float time, int type, CPlayer* player )
|
||||
{
|
||||
Obj* a = new Obj;
|
||||
if ( a == 0 ) return;
|
||||
a->player = player;
|
||||
a->grenade = grenade;
|
||||
a->time = gpGlobals->time + time;
|
||||
a->type = type;
|
||||
a->prev = 0;
|
||||
a->next = head;
|
||||
if ( head ) head->prev = a;
|
||||
head = a;
|
||||
}
|
||||
|
||||
bool Grenades::find( edict_t* enemy, CPlayer** p, int* type )
|
||||
{
|
||||
bool found = false;
|
||||
Obj* a = head;
|
||||
while ( a ){
|
||||
if ( a->time > gpGlobals->time && !found ) {
|
||||
if ( a->grenade == enemy ) {
|
||||
found = true;
|
||||
*p = a->player;
|
||||
*type = a->type;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Obj* next = a->next;
|
||||
if (a->prev) a->prev->next = next;
|
||||
else head = next;
|
||||
if (next) next->prev = a->prev;
|
||||
delete a;
|
||||
a = next;
|
||||
continue;
|
||||
}
|
||||
a = a->next;
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Grenades::clear()
|
||||
{
|
||||
while(head){
|
||||
Obj* a = head->next;
|
||||
delete head;
|
||||
head = a;
|
||||
}
|
||||
}
|
||||
|
||||
// *****************************************************
|
||||
// class CPlayer
|
||||
// *****************************************************
|
||||
|
||||
void CPlayer::Disconnect(){
|
||||
|
||||
if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused
|
||||
return;
|
||||
|
||||
rank->updatePosition( &life );
|
||||
rank = 0;
|
||||
}
|
||||
|
||||
void CPlayer::PutInServer(){
|
||||
|
||||
if ( ignoreBots(pEdict) )
|
||||
return;
|
||||
|
||||
restartStats();
|
||||
const char* name = STRING(pEdict->v.netname);
|
||||
const char* unique = name;
|
||||
switch((int)csstats_rank->value) {
|
||||
case 1:
|
||||
if ( (unique = GETPLAYERAUTHID(pEdict)) == 0 )
|
||||
unique = name; // failed to get authid
|
||||
break;
|
||||
case 2:
|
||||
unique = ip;
|
||||
}
|
||||
rank = g_rank.findEntryInRank( unique , name );
|
||||
}
|
||||
|
||||
void CPlayer::Connect(const char* address ){
|
||||
bot = IsBot();
|
||||
strcpy(ip,address);
|
||||
rank = 0;
|
||||
clearStats = 0.0f;
|
||||
}
|
||||
|
||||
void CPlayer::restartStats(bool all)
|
||||
{
|
||||
if ( all ) memset(weapons,0,sizeof(weapons));
|
||||
memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
|
||||
memset(attackers,0,sizeof(attackers));
|
||||
memset(victims,0,sizeof(victims));
|
||||
memset(&life,0,sizeof(life));
|
||||
}
|
||||
|
||||
void CPlayer::Init( int pi, edict_t* pe )
|
||||
{
|
||||
pEdict = pe;
|
||||
index = pi;
|
||||
current = 0;
|
||||
clearStats = 0.0f;
|
||||
rank = 0;
|
||||
}
|
||||
|
||||
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
|
||||
|
||||
if ( ignoreBots(pEdict,pVictim->pEdict) )
|
||||
return;
|
||||
|
||||
if ( pVictim->index == index ){ // killed self
|
||||
pVictim->weapons[0].deaths++;
|
||||
pVictim->life.deaths++;
|
||||
pVictim->weaponsRnd[0].deaths++; // DEC-Weapon (round) stats
|
||||
return;
|
||||
}
|
||||
|
||||
pVictim->attackers[index].name = weaponData[wweapon].name;
|
||||
pVictim->attackers[index].kills++;
|
||||
pVictim->attackers[index].hs += hhs;
|
||||
pVictim->attackers[index].tks += ttk;
|
||||
pVictim->attackers[0].kills++;
|
||||
pVictim->attackers[0].hs += hhs;
|
||||
pVictim->attackers[0].tks += ttk;
|
||||
pVictim->weapons[pVictim->current].deaths++;
|
||||
pVictim->weapons[0].deaths++;
|
||||
pVictim->life.deaths++;
|
||||
|
||||
|
||||
pVictim->weaponsRnd[pVictim->current].deaths++; // DEC-Weapon (round) stats
|
||||
pVictim->weaponsRnd[0].deaths++; // DEC-Weapon (round) stats
|
||||
|
||||
int vi = pVictim->index;
|
||||
victims[vi].name = weaponData[wweapon].name;
|
||||
victims[vi].deaths++;
|
||||
victims[vi].hs += hhs;
|
||||
victims[vi].tks += ttk;
|
||||
victims[0].deaths++;
|
||||
victims[0].hs += hhs;
|
||||
victims[0].tks += ttk;
|
||||
|
||||
weaponsRnd[wweapon].kills++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].hs += hhs; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].tks += ttk; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].kills++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].hs += hhs; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].tks += ttk; // DEC-Weapon (round) stats
|
||||
|
||||
weapons[wweapon].kills++;
|
||||
weapons[wweapon].hs += hhs;
|
||||
weapons[wweapon].tks += ttk;
|
||||
weapons[0].kills++;
|
||||
weapons[0].hs += hhs;
|
||||
weapons[0].tks += ttk;
|
||||
life.kills++;
|
||||
life.hs += hhs;
|
||||
life.tks += ttk;
|
||||
}
|
||||
|
||||
void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){
|
||||
|
||||
if ( ignoreBots(pEdict,pVictim->pEdict) )
|
||||
return;
|
||||
|
||||
if ( index == pVictim->index ) return;
|
||||
|
||||
pVictim->attackers[index].hits++;
|
||||
pVictim->attackers[index].damage += ddamage;
|
||||
pVictim->attackers[index].bodyHits[bbody]++;
|
||||
pVictim->attackers[0].hits++;
|
||||
pVictim->attackers[0].damage += ddamage;
|
||||
pVictim->attackers[0].bodyHits[bbody]++;
|
||||
|
||||
|
||||
int vi = pVictim->index;
|
||||
victims[vi].hits++;
|
||||
victims[vi].damage += ddamage;
|
||||
victims[vi].bodyHits[bbody]++;
|
||||
victims[0].hits++;
|
||||
victims[0].damage += ddamage;
|
||||
victims[0].bodyHits[bbody]++;
|
||||
|
||||
weaponsRnd[wweapon].hits++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].damage += ddamage; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].bodyHits[bbody]++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].hits++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].damage += ddamage; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].bodyHits[bbody]++; // DEC-Weapon (round) stats
|
||||
|
||||
weapons[wweapon].hits++;
|
||||
weapons[wweapon].damage += ddamage;
|
||||
weapons[wweapon].bodyHits[bbody]++;
|
||||
weapons[0].hits++;
|
||||
weapons[0].damage += ddamage;
|
||||
weapons[0].bodyHits[bbody]++;
|
||||
|
||||
life.hits++;
|
||||
life.damage += ddamage;
|
||||
life.bodyHits[bbody]++;
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::saveShot(int weapon){
|
||||
|
||||
if ( ignoreBots(pEdict) )
|
||||
return;
|
||||
|
||||
victims[0].shots++;
|
||||
weapons[weapon].shots++;
|
||||
weapons[0].shots++;
|
||||
life.shots++;
|
||||
weaponsRnd[weapon].shots++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].shots++; // DEC-Weapon (round) stats
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::saveBPlant(){
|
||||
life.bPlants++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBExplode(){
|
||||
life.bExplosions++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBDefusing(){
|
||||
life.bDefusions++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBDefused(){
|
||||
life.bDefused++;
|
||||
}
|
||||
|
||||
// *****************************************************
|
||||
|
||||
bool ignoreBots(edict_t *pEnt, edict_t *pOther)
|
||||
{
|
||||
rankBots = (int)csstats_rankbots->value ? true : false;
|
||||
if (!rankBots && (pEnt->v.flags & FL_FAKECLIENT || (pOther && pOther->v.flags & FL_FAKECLIENT)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isModuleActive(){
|
||||
if ( !(int)CVAR_GET_FLOAT("csstats_pause") )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
95
dlls/cstrike/csx/CMisc.h
Executable file
95
dlls/cstrike/csx/CMisc.h
Executable file
@ -0,0 +1,95 @@
|
||||
|
||||
|
||||
#ifndef CMISC_H
|
||||
#define CMISC_H
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
|
||||
#define MAX_CWEAPONS 6
|
||||
|
||||
#define CSW_HEGRENADE 4
|
||||
#define CSW_C4 6
|
||||
#define CSW_SMOKEGRENADE 9
|
||||
#define CSW_KNIFE 29
|
||||
#define CSW_FLASHBANG 25
|
||||
|
||||
// *****************************************************
|
||||
// class CPlayer
|
||||
// *****************************************************
|
||||
|
||||
struct CPlayer {
|
||||
edict_t* pEdict;
|
||||
char ip[32];
|
||||
int index;
|
||||
int aiming;
|
||||
int current;
|
||||
bool bot;
|
||||
float clearStats;
|
||||
RankSystem::RankStats* rank;
|
||||
|
||||
struct PlayerWeapon : Stats {
|
||||
const char* name;
|
||||
int ammo;
|
||||
int clip;
|
||||
};
|
||||
|
||||
PlayerWeapon weapons[MAX_WEAPONS+MAX_CWEAPONS];
|
||||
PlayerWeapon attackers[33];
|
||||
PlayerWeapon victims[33];
|
||||
Stats weaponsRnd[MAX_WEAPONS+MAX_CWEAPONS]; // DEC-Weapon (Round) stats
|
||||
Stats life;
|
||||
|
||||
int teamId;
|
||||
|
||||
void Init( int pi, edict_t* pe );
|
||||
void Connect(const char* ip );
|
||||
void PutInServer();
|
||||
void Disconnect();
|
||||
void saveKill(CPlayer* pVictim, int weapon, int hs, int tk);
|
||||
void saveHit(CPlayer* pVictim, int weapon, int damage, int aiming);
|
||||
void saveShot(int weapon);
|
||||
|
||||
void saveBPlant();
|
||||
void saveBExplode();
|
||||
void saveBDefusing();
|
||||
void saveBDefused();
|
||||
|
||||
void restartStats(bool all = true);
|
||||
inline bool IsBot(){
|
||||
const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict);
|
||||
return ( auth && !strcmp( auth , "BOT" ) );
|
||||
}
|
||||
inline bool IsAlive(){
|
||||
return ((pEdict->v.deadflag==DEAD_NO)&&(pEdict->v.health>0));
|
||||
}
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class Grenades
|
||||
// *****************************************************
|
||||
|
||||
class Grenades
|
||||
{
|
||||
struct Obj
|
||||
{
|
||||
CPlayer* player;
|
||||
edict_t* grenade;
|
||||
float time;
|
||||
int type;
|
||||
Obj* next;
|
||||
Obj* prev;
|
||||
} *head;
|
||||
|
||||
public:
|
||||
Grenades() { head = 0; }
|
||||
~Grenades() { clear(); }
|
||||
void put( edict_t* grenade, float time, int type, CPlayer* player );
|
||||
bool find( edict_t* enemy, CPlayer** p, int* type );
|
||||
void clear();
|
||||
};
|
||||
|
||||
#endif // CMISC_H
|
||||
|
||||
|
||||
|
329
dlls/cstrike/csx/CRank.cpp
Executable file
329
dlls/cstrike/csx/CRank.cpp
Executable file
@ -0,0 +1,329 @@
|
||||
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
#include "rank.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
Stats::Stats(){
|
||||
hits = shots = damage = hs = tks = kills = deaths = bDefusions = bDefused = bPlants = bExplosions = 0;
|
||||
memset( bodyHits , 0 ,sizeof( bodyHits ) );
|
||||
}
|
||||
void Stats::commit(Stats* a){
|
||||
hits += a->hits;
|
||||
shots += a->shots;
|
||||
damage += a->damage;
|
||||
hs += a->hs;
|
||||
tks += a->tks;
|
||||
kills += a->kills;
|
||||
deaths += a->deaths;
|
||||
|
||||
bDefusions += a->bDefusions;
|
||||
bDefused += a->bDefused;
|
||||
bPlants += a->bPlants;
|
||||
bExplosions += a->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
bodyHits[i] += a->bodyHits[i];
|
||||
}
|
||||
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
RankSystem::RankStats::RankStats( const char* uu, const char* nn, RankSystem* pp ) {
|
||||
name = 0;
|
||||
namelen = 0;
|
||||
unique = 0;
|
||||
uniquelen = 0;
|
||||
score = 0;
|
||||
parent = pp;
|
||||
id = ++parent->rankNum;
|
||||
next = prev = 0;
|
||||
setName( nn );
|
||||
setUnique( uu );
|
||||
}
|
||||
|
||||
RankSystem::RankStats::~RankStats() {
|
||||
delete[] name;
|
||||
delete[] unique;
|
||||
--parent->rankNum;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setName( const char* nn ) {
|
||||
delete[] name;
|
||||
namelen = strlen(nn) + 1;
|
||||
name = new char[namelen];
|
||||
if ( name )
|
||||
strcpy( name , nn );
|
||||
else
|
||||
namelen = 0;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setUnique( const char* nn ) {
|
||||
delete[] unique;
|
||||
uniquelen = strlen(nn) + 1;
|
||||
unique = new char[uniquelen];
|
||||
if ( unique )
|
||||
strcpy( unique , nn );
|
||||
else
|
||||
uniquelen = 0;
|
||||
}
|
||||
|
||||
RankSystem::RankSystem() {
|
||||
head = 0;
|
||||
tail = 0;
|
||||
rankNum = 0;
|
||||
calc.code = 0;
|
||||
}
|
||||
|
||||
RankSystem::~RankSystem() {
|
||||
clear();
|
||||
}
|
||||
|
||||
void RankSystem::put_before( RankStats* a, RankStats* ptr ){
|
||||
a->next = ptr;
|
||||
if ( ptr ){
|
||||
a->prev = ptr->prev;
|
||||
ptr->prev = a;
|
||||
}
|
||||
else{
|
||||
a->prev = head;
|
||||
head = a;
|
||||
}
|
||||
if ( a->prev ) a->prev->next = a;
|
||||
else tail = a;
|
||||
}
|
||||
|
||||
void RankSystem::put_after( RankStats* a, RankStats* ptr ) {
|
||||
a->prev = ptr;
|
||||
if ( ptr ){
|
||||
a->next = ptr->next;
|
||||
ptr->next = a;
|
||||
}
|
||||
else{
|
||||
a->next = tail;
|
||||
tail = a;
|
||||
}
|
||||
if ( a->next ) a->next->prev = a;
|
||||
else head = a;
|
||||
}
|
||||
|
||||
void RankSystem::unlink( RankStats* ptr ){
|
||||
if (ptr->prev) ptr->prev->next = ptr->next;
|
||||
else tail = ptr->next;
|
||||
if (ptr->next) ptr->next->prev = ptr->prev;
|
||||
else head = ptr->prev;
|
||||
}
|
||||
|
||||
void RankSystem::clear(){
|
||||
while( tail ){
|
||||
head = tail->next;
|
||||
delete tail;
|
||||
tail = head;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool RankSystem::loadCalc(const char* filename, char* error)
|
||||
{
|
||||
if ((MF_LoadAmxScript(&calc.amx,&calc.code,filename,error,0)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr1, &calc.physAddr1)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr2, &calc.physAddr2)!=AMX_ERR_NONE)||
|
||||
(MF_AmxFindPublic(&calc.amx,"get_score",&calc.func)!=AMX_ERR_NONE)){
|
||||
LOG_CONSOLE( PLID, "Couldn't load plugin (file \"%s\")",filename);
|
||||
MF_UnloadAmxScript(&calc.amx, &calc.code);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void RankSystem::unloadCalc()
|
||||
{
|
||||
MF_UnloadAmxScript(&calc.amx , &calc.code);
|
||||
}
|
||||
|
||||
RankSystem::RankStats* RankSystem::findEntryInRank(const char* unique, const char* name )
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( strcmp( a->getUnique() ,unique ) == 0 )
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
a = new RankStats( unique ,name,this );
|
||||
if ( a == 0 ) return 0;
|
||||
put_after( a , 0 );
|
||||
return a;
|
||||
}
|
||||
|
||||
void RankSystem::updatePos( RankStats* rr , Stats* s )
|
||||
{
|
||||
rr->addStats( s );
|
||||
if ( calc.code ) {
|
||||
calc.physAddr1[0] = rr->kills;
|
||||
calc.physAddr1[1] = rr->deaths;
|
||||
calc.physAddr1[2] = rr->hs;
|
||||
calc.physAddr1[3] = rr->tks;
|
||||
calc.physAddr1[4] = rr->shots;
|
||||
calc.physAddr1[5] = rr->hits;
|
||||
calc.physAddr1[6] = rr->damage;
|
||||
|
||||
calc.physAddr1[7] = rr->bDefusions;
|
||||
calc.physAddr1[8] = rr->bDefused;
|
||||
calc.physAddr1[9] = rr->bPlants;
|
||||
calc.physAddr1[10] = rr->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
calc.physAddr2[i] = rr->bodyHits[i];
|
||||
cell result = 0;
|
||||
int err;
|
||||
MF_AmxPush(&calc.amx, calc.amxAddr2);
|
||||
MF_AmxPush(&calc.amx, calc.amxAddr1);
|
||||
if ((err = MF_AmxExec(&calc.amx,&result, calc.func)) != AMX_ERR_NONE)
|
||||
MF_LogError(&calc.amx, err, "Error encountered in stats routine");
|
||||
rr->score = result;
|
||||
}
|
||||
else rr->score = rr->kills - rr->deaths;
|
||||
|
||||
|
||||
RankStats* aa = rr->next;
|
||||
while ( aa && (aa->score <= rr->score) ) { // try to nominate
|
||||
rr->goUp();
|
||||
aa->goDown();
|
||||
aa = aa->next; // go to next rank
|
||||
}
|
||||
if ( aa != rr->next )
|
||||
{
|
||||
unlink( rr );
|
||||
put_before( rr, aa );
|
||||
}
|
||||
else
|
||||
{
|
||||
aa = rr->prev;
|
||||
while ( aa && (aa->score > rr->score) ) { // go down
|
||||
rr->goDown();
|
||||
aa->goUp();
|
||||
aa = aa->prev; // go to prev rank
|
||||
}
|
||||
if ( aa != rr->prev ){
|
||||
unlink( rr );
|
||||
put_after( rr, aa );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Who put these backwards...
|
||||
*/
|
||||
#define TRYREAD(t_var, t_num, t_size, t_file) \
|
||||
if (fread(t_var, t_size, t_num, t_file) != static_cast<size_t>(t_num)) { \
|
||||
break; \
|
||||
}
|
||||
|
||||
void RankSystem::loadRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen( filename , "rb" );
|
||||
|
||||
if (!bfp)
|
||||
{
|
||||
MF_Log("Could not load csstats file: %s", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
short int i = 0;
|
||||
if (fread(&i, sizeof(short int), 1, bfp) != 1)
|
||||
{
|
||||
fclose(bfp);
|
||||
return;
|
||||
}
|
||||
|
||||
if (i == RANK_VERSION)
|
||||
{
|
||||
Stats d;
|
||||
char unique[64], name[64];
|
||||
if (fread(&i, sizeof(short int), 1, bfp) != 1)
|
||||
{
|
||||
fclose(bfp);
|
||||
return;
|
||||
}
|
||||
|
||||
while(i && !feof(bfp))
|
||||
{
|
||||
TRYREAD(name, i, sizeof(char), bfp);
|
||||
TRYREAD(&i, 1, sizeof(short int), bfp);
|
||||
TRYREAD(unique , i, sizeof(char) , bfp);
|
||||
TRYREAD(&d.tks, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.damage, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.deaths, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.kills, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.shots, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.hits, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.hs, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.bDefusions, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.bDefused, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.bPlants, 1, sizeof(int), bfp);
|
||||
TRYREAD(&d.bExplosions, 1, sizeof(int), bfp);
|
||||
TRYREAD(d.bodyHits, 1, sizeof(d.bodyHits), bfp);
|
||||
TRYREAD(&i, 1, sizeof(short int), bfp);
|
||||
|
||||
RankSystem::RankStats* a = findEntryInRank( unique , name );
|
||||
|
||||
if ( a ) a->updatePosition( &d );
|
||||
}
|
||||
}
|
||||
fclose(bfp);
|
||||
}
|
||||
|
||||
void RankSystem::saveRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen(filename, "wb");
|
||||
|
||||
if ( !bfp ) return;
|
||||
|
||||
short int i = RANK_VERSION;
|
||||
|
||||
fwrite(&i, 1, sizeof(short int) , bfp);
|
||||
|
||||
RankSystem::iterator a = front();
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( (*a).score != (1<<31) ) // score must be different than mincell
|
||||
{
|
||||
fwrite( &(*a).namelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).name , (*a).namelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).uniquelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).unique , (*a).uniquelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).tks, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).damage, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).deaths, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).kills, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).shots, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hits, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hs, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( &(*a).bDefusions, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bDefused, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bPlants, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bExplosions, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( (*a).bodyHits, 1, sizeof((*a).bodyHits), bfp);
|
||||
}
|
||||
|
||||
--a;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
fwrite( &i , 1, sizeof(short int), bfp); // null terminator
|
||||
|
||||
fclose(bfp);
|
||||
}
|
||||
|
123
dlls/cstrike/csx/CRank.h
Executable file
123
dlls/cstrike/csx/CRank.h
Executable file
@ -0,0 +1,123 @@
|
||||
|
||||
|
||||
#ifndef CRANK_H
|
||||
#define CRANK_H
|
||||
|
||||
#define RANK_VERSION 11
|
||||
|
||||
#include "amxxmodule.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
|
||||
struct Stats {
|
||||
int hits;
|
||||
int shots;
|
||||
int damage;
|
||||
int hs;
|
||||
int tks;
|
||||
int kills;
|
||||
int deaths;
|
||||
int bodyHits[9]; ////////////////////
|
||||
|
||||
// SiDLuke start
|
||||
int bPlants;
|
||||
int bExplosions;
|
||||
int bDefusions;
|
||||
int bDefused;
|
||||
// SiDLuke end :D
|
||||
|
||||
Stats();
|
||||
void commit(Stats* a);
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
|
||||
class RankSystem
|
||||
{
|
||||
public:
|
||||
class RankStats;
|
||||
friend class RankStats;
|
||||
class iterator;
|
||||
|
||||
class RankStats : public Stats {
|
||||
friend class RankSystem;
|
||||
friend class iterator;
|
||||
RankSystem* parent;
|
||||
RankStats* next;
|
||||
RankStats* prev;
|
||||
char* unique;
|
||||
short int uniquelen;
|
||||
char* name;
|
||||
short int namelen;
|
||||
int score;
|
||||
int id;
|
||||
RankStats( const char* uu, const char* nn, RankSystem* pp );
|
||||
~RankStats();
|
||||
void setUnique( const char* nn );
|
||||
inline void goDown() {++id;}
|
||||
inline void goUp() {--id;}
|
||||
inline void addStats(Stats* a) { commit( a ); }
|
||||
public:
|
||||
void setName( const char* nn );
|
||||
inline const char* getName() const { return name ? name : ""; }
|
||||
inline const char* getUnique() const { return unique ? unique : ""; }
|
||||
inline int getPosition() const { return id; }
|
||||
inline void updatePosition( Stats* points ) {
|
||||
parent->updatePos( this , points );
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
RankStats* head;
|
||||
RankStats* tail;
|
||||
int rankNum;
|
||||
|
||||
struct scoreCalc{
|
||||
AMX amx;
|
||||
void* code;
|
||||
int func;
|
||||
cell amxAddr1;
|
||||
cell amxAddr2;
|
||||
cell *physAddr1;
|
||||
cell *physAddr2;
|
||||
} calc;
|
||||
|
||||
void put_before( RankStats* a, RankStats* ptr );
|
||||
void put_after( RankStats* a, RankStats* ptr );
|
||||
void unlink( RankStats* ptr );
|
||||
void updatePos( RankStats* r , Stats* s );
|
||||
|
||||
public:
|
||||
|
||||
RankSystem();
|
||||
~RankSystem();
|
||||
|
||||
void saveRank( const char* filename );
|
||||
void loadRank( const char* filename );
|
||||
RankStats* findEntryInRank(const char* unique, const char* name );
|
||||
bool loadCalc(const char* filename, char* error);
|
||||
inline int getRankNum( ) const { return rankNum; }
|
||||
void clear();
|
||||
void unloadCalc();
|
||||
|
||||
class iterator {
|
||||
RankStats* ptr;
|
||||
public:
|
||||
iterator(RankStats* a): ptr(a){}
|
||||
inline iterator& operator--() { ptr = ptr->prev; return *this;}
|
||||
inline iterator& operator++() { ptr = ptr->next; return *this; }
|
||||
inline RankStats& operator*() { return *ptr;}
|
||||
operator bool () { return (ptr != 0); }
|
||||
};
|
||||
|
||||
inline iterator front() { return iterator(head); }
|
||||
inline iterator begin() { return iterator(tail); }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
78
dlls/cstrike/csx/Makefile
Executable file
78
dlls/cstrike/csx/Makefile
Executable file
@ -0,0 +1,78 @@
|
||||
#(C)2004-2005 AMX Mod X Development Team
|
||||
# Makefile written by David "BAILOPAN" Anderson
|
||||
|
||||
HLSDK = ../../../../hlsdk
|
||||
MM_ROOT = ../../../metamod/metamod
|
||||
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
|
||||
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing
|
||||
DEBUG_FLAGS = -g -ggdb3
|
||||
CPP = gcc-4.1
|
||||
NAME = csx
|
||||
|
||||
BIN_SUFFIX_32 = amxx_i386.so
|
||||
BIN_SUFFIX_64 = amxx_amd64.so
|
||||
|
||||
OBJECTS = sdk/mxxmodule.cpp CRank.cpp CMisc.cpp meta_api.cpp rank.cpp usermsg.cpp
|
||||
|
||||
LINK =
|
||||
|
||||
INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \
|
||||
-I$(MM_ROOT) -I$(HLSDK)/common -Isdk
|
||||
|
||||
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
|
||||
|
||||
ifeq "$(GCC_VERSION)" "4"
|
||||
OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
|
||||
endif
|
||||
|
||||
ifeq "$(DEBUG)" "true"
|
||||
BIN_DIR = Debug
|
||||
CFLAGS = $(DEBUG_FLAGS)
|
||||
else
|
||||
BIN_DIR = Release
|
||||
CFLAGS = $(OPT_FLAGS)
|
||||
endif
|
||||
|
||||
CFLAGS += -DNDEBUG -fPIC -Wall -Wno-non-virtual-dtor -Werror -fno-exceptions -DHAVE_STDINT_H -static-libgcc -fno-rtti
|
||||
|
||||
ifeq "$(AMD64)" "true"
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX_64)
|
||||
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -m64
|
||||
else
|
||||
BINARY = $(NAME)_$(BIN_SUFFIX_32)
|
||||
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
|
||||
OPT_FLAGS += -march=i586
|
||||
endif
|
||||
|
||||
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||
|
||||
$(BIN_DIR)/%.o: %.cpp
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
all:
|
||||
mkdir -p $(BIN_DIR)
|
||||
mkdir -p $(BIN_DIR)/sdk
|
||||
$(MAKE) csx
|
||||
|
||||
amd64:
|
||||
$(MAKE) all AMD64=true
|
||||
|
||||
csx: $(OBJ_LINUX)
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
|
||||
|
||||
debug:
|
||||
$(MAKE) all DEBUG=true
|
||||
|
||||
default: all
|
||||
|
||||
clean:
|
||||
rm -rf Release/sdk/*.o
|
||||
rm -rf Release/*.o
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX_32)
|
||||
rm -rf Release/$(NAME)_$(BIN_SUFFIX_64)
|
||||
rm -rf Debug/sdk/*.o
|
||||
rm -rf Debug/*.o
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32)
|
||||
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64)
|
343
dlls/cstrike/csx/WinCSX/CRank.cpp
Executable file
343
dlls/cstrike/csx/WinCSX/CRank.cpp
Executable file
@ -0,0 +1,343 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "CRank.h"
|
||||
#include <stdio.h>
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
Stats::Stats(){
|
||||
hits = shots = damage = hs = tks = kills = deaths = bDefusions = bDefused = bPlants = bExplosions = 0;
|
||||
memset( bodyHits , 0 ,sizeof( bodyHits ) );
|
||||
}
|
||||
void Stats::commit(Stats* a){
|
||||
hits += a->hits;
|
||||
shots += a->shots;
|
||||
damage += a->damage;
|
||||
hs += a->hs;
|
||||
tks += a->tks;
|
||||
kills += a->kills;
|
||||
deaths += a->deaths;
|
||||
|
||||
bDefusions += a->bDefusions;
|
||||
bDefused += a->bDefused;
|
||||
bPlants += a->bPlants;
|
||||
bExplosions += a->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
bodyHits[i] += a->bodyHits[i];
|
||||
}
|
||||
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
RankSystem::RankStats::RankStats( const char* uu, const char* nn, RankSystem* pp ) {
|
||||
name = 0;
|
||||
namelen = 0;
|
||||
unique = 0;
|
||||
uniquelen = 0;
|
||||
score = 0;
|
||||
parent = pp;
|
||||
id = ++parent->rankNum;
|
||||
next = prev = 0;
|
||||
setName( nn );
|
||||
setUnique( uu );
|
||||
}
|
||||
|
||||
RankSystem::RankStats::~RankStats() {
|
||||
delete[] name;
|
||||
delete[] unique;
|
||||
--parent->rankNum;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setName( const char* nn ) {
|
||||
delete[] name;
|
||||
namelen = (short)strlen(nn) + 1;
|
||||
name = new char[namelen];
|
||||
if ( name )
|
||||
strcpy( name , nn );
|
||||
else
|
||||
namelen = 0;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setUnique( const char* nn ) {
|
||||
delete[] unique;
|
||||
uniquelen = (short)strlen(nn) + 1;
|
||||
unique = new char[uniquelen];
|
||||
if ( unique )
|
||||
strcpy( unique , nn );
|
||||
else
|
||||
uniquelen = 0;
|
||||
}
|
||||
|
||||
RankSystem::RankSystem() {
|
||||
head = 0;
|
||||
tail = 0;
|
||||
rankNum = 0;
|
||||
calc.code = 0;
|
||||
}
|
||||
|
||||
RankSystem::~RankSystem() {
|
||||
clear();
|
||||
}
|
||||
|
||||
void RankSystem::put_before( RankStats* a, RankStats* ptr ){
|
||||
a->next = ptr;
|
||||
if ( ptr ){
|
||||
a->prev = ptr->prev;
|
||||
ptr->prev = a;
|
||||
}
|
||||
else{
|
||||
a->prev = head;
|
||||
head = a;
|
||||
}
|
||||
if ( a->prev ) a->prev->next = a;
|
||||
else tail = a;
|
||||
}
|
||||
|
||||
void RankSystem::put_after( RankStats* a, RankStats* ptr ) {
|
||||
a->prev = ptr;
|
||||
if ( ptr ){
|
||||
a->next = ptr->next;
|
||||
ptr->next = a;
|
||||
}
|
||||
else{
|
||||
a->next = tail;
|
||||
tail = a;
|
||||
}
|
||||
if ( a->next ) a->next->prev = a;
|
||||
else head = a;
|
||||
}
|
||||
|
||||
void RankSystem::unlink( RankStats* ptr ){
|
||||
if (ptr->prev) ptr->prev->next = ptr->next;
|
||||
else tail = ptr->next;
|
||||
if (ptr->next) ptr->next->prev = ptr->prev;
|
||||
else head = ptr->prev;
|
||||
}
|
||||
|
||||
void RankSystem::clear(){
|
||||
while( tail ){
|
||||
head = tail->next;
|
||||
delete tail;
|
||||
tail = head;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
bool RankSystem::loadCalc(const char* filename, char* error)
|
||||
{
|
||||
if ((MF_LoadAmxScript(&calc.amx,&calc.code,filename,error,0)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr1, &calc.physAddr1)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr2, &calc.physAddr2)!=AMX_ERR_NONE)||
|
||||
(MF_AmxFindPublic(&calc.amx,"get_score",&calc.func)!=AMX_ERR_NONE)){
|
||||
//LOG_CONSOLE( PLID, "Couldn't load plugin (file \"%s\")",filename);
|
||||
MF_UnloadAmxScript(&calc.amx, &calc.code);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void RankSystem::unloadCalc()
|
||||
{
|
||||
MF_UnloadAmxScript(&calc.amx , &calc.code);
|
||||
}
|
||||
*/
|
||||
RankSystem::RankStats* RankSystem::findEntryInRank(const char* unique, const char* name )
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( strcmp( a->getUnique(), unique ) == 0 )
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
|
||||
a = new RankStats( unique ,name,this );
|
||||
if ( a == 0 ) return 0;
|
||||
put_after( a , 0 );
|
||||
return a;
|
||||
}
|
||||
|
||||
RankSystem::RankStats* RankSystem::findEntryInRankByUnique(const char* unique)
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( strcmp( a->getUnique(), unique ) == 0 )
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
|
||||
return NULL; // none found
|
||||
}
|
||||
RankSystem::RankStats* RankSystem::findEntryInRankByPos(int position)
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if (a->getPosition() == position)
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int RankSystem::updatePos( RankStats* rr , Stats* s )
|
||||
{
|
||||
RankStats* rrFirst = rr;
|
||||
if (s != NULL)
|
||||
rr->addStats( s );
|
||||
if ( calc.code ) {
|
||||
calc.physAddr1[0] = rr->kills;
|
||||
calc.physAddr1[1] = rr->deaths;
|
||||
calc.physAddr1[2] = rr->hs;
|
||||
calc.physAddr1[3] = rr->tks;
|
||||
calc.physAddr1[4] = rr->shots;
|
||||
calc.physAddr1[5] = rr->hits;
|
||||
calc.physAddr1[6] = rr->damage;
|
||||
|
||||
calc.physAddr1[7] = rr->bDefusions;
|
||||
calc.physAddr1[8] = rr->bDefused;
|
||||
calc.physAddr1[9] = rr->bPlants;
|
||||
calc.physAddr1[10] = rr->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
calc.physAddr2[i] = rr->bodyHits[i];
|
||||
cell result = 0;
|
||||
//int err;
|
||||
//if ((err = MF_AmxExec(&calc.amx,&result, calc.func ,2,calc.amxAddr1,calc.amxAddr2 )) != AMX_ERR_NONE)
|
||||
//LOG_CONSOLE( PLID, "Run time error %d on line %ld (plugin \"%s\")", err,calc.amx.curline,LOCALINFO("csstats_score"));
|
||||
rr->score = result;
|
||||
}
|
||||
else rr->score = rr->kills - rr->deaths;
|
||||
|
||||
|
||||
RankStats* aa = rr->next;
|
||||
while ( aa && (aa->score <= rr->score) ) { // try to nominate
|
||||
rr->goUp();
|
||||
aa->goDown();
|
||||
aa = aa->next; // go to next rank
|
||||
}
|
||||
if ( aa != rr->next )
|
||||
{
|
||||
unlink( rr );
|
||||
put_before( rr, aa );
|
||||
}
|
||||
else
|
||||
{
|
||||
aa = rr->prev;
|
||||
while ( aa && (aa->score > rr->score) ) { // go down
|
||||
rr->goDown();
|
||||
aa->goUp();
|
||||
aa = aa->prev; // go to prev rank
|
||||
}
|
||||
if ( aa != rr->prev ){
|
||||
unlink( rr );
|
||||
put_after( rr, aa );
|
||||
}
|
||||
}
|
||||
return rrFirst->getPosition();
|
||||
}
|
||||
|
||||
bool RankSystem::loadRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen( filename , "rb" );
|
||||
|
||||
if ( !bfp ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
short int i = 0;
|
||||
fread(&i, 1 , sizeof(short int) , bfp);
|
||||
|
||||
if (i == RANK_VERSION)
|
||||
{
|
||||
Stats d;
|
||||
char unique[64], name[64];
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
|
||||
while( i )
|
||||
{
|
||||
fread(name , i,sizeof(char) , bfp);
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
fread(unique , i,sizeof(char) , bfp);
|
||||
fread(&d.tks, 1,sizeof(int), bfp);
|
||||
fread(&d.damage, 1,sizeof(int), bfp);
|
||||
fread(&d.deaths, 1,sizeof(int), bfp);
|
||||
fread(&d.kills, 1,sizeof(int), bfp);
|
||||
fread(&d.shots, 1,sizeof(int), bfp);
|
||||
fread(&d.hits, 1,sizeof(int), bfp);
|
||||
fread(&d.hs, 1,sizeof(int), bfp);
|
||||
|
||||
fread(&d.bDefusions, 1,sizeof(int), bfp);
|
||||
fread(&d.bDefused, 1,sizeof(int), bfp);
|
||||
fread(&d.bPlants, 1,sizeof(int), bfp);
|
||||
fread(&d.bExplosions, 1,sizeof(int), bfp);
|
||||
|
||||
fread(d.bodyHits, 1,sizeof(d.bodyHits), bfp);
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
|
||||
RankSystem::RankStats* a = findEntryInRank( unique , name );
|
||||
|
||||
if ( a ) a->updatePosition( &d );
|
||||
}
|
||||
}
|
||||
fclose(bfp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void RankSystem::saveRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen(filename, "wb");
|
||||
|
||||
if ( !bfp ) return;
|
||||
|
||||
short int i = RANK_VERSION;
|
||||
|
||||
fwrite(&i, 1, sizeof(short int) , bfp);
|
||||
|
||||
RankSystem::iterator a = front();
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( (*a).score != (1<<31) ) // score must be different than mincell
|
||||
{
|
||||
fwrite( &(*a).namelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).name , (*a).namelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).uniquelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).unique , (*a).uniquelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).tks, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).damage, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).deaths, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).kills, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).shots, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hits, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hs, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( &(*a).bDefusions, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bDefused, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bPlants, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bExplosions, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( (*a).bodyHits, 1, sizeof((*a).bodyHits), bfp);
|
||||
}
|
||||
|
||||
--a;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
fwrite( &i , 1, sizeof(short int), bfp); // null terminator
|
||||
|
||||
fclose(bfp);
|
||||
}
|
128
dlls/cstrike/csx/WinCSX/CRank.h
Executable file
128
dlls/cstrike/csx/WinCSX/CRank.h
Executable file
@ -0,0 +1,128 @@
|
||||
|
||||
|
||||
#ifndef CRANK_H
|
||||
#define CRANK_H
|
||||
|
||||
#define RANK_VERSION 11
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "amxxmodule.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
|
||||
struct Stats {
|
||||
int hits;
|
||||
int shots;
|
||||
int damage;
|
||||
int hs;
|
||||
int tks;
|
||||
int kills;
|
||||
int deaths;
|
||||
int bodyHits[9]; ////////////////////
|
||||
|
||||
// SiDLuke start
|
||||
int bPlants;
|
||||
int bExplosions;
|
||||
int bDefusions;
|
||||
int bDefused;
|
||||
// SiDLuke end :D
|
||||
|
||||
Stats();
|
||||
void commit(Stats* a);
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
|
||||
class RankSystem
|
||||
{
|
||||
public:
|
||||
class RankStats;
|
||||
friend class RankStats;
|
||||
class iterator;
|
||||
|
||||
class RankStats : public Stats {
|
||||
friend class RankSystem;
|
||||
friend class iterator;
|
||||
RankSystem* parent;
|
||||
RankStats* next;
|
||||
RankStats* prev;
|
||||
char* unique;
|
||||
short int uniquelen;
|
||||
char* name;
|
||||
short int namelen;
|
||||
int score;
|
||||
int id;
|
||||
RankStats( const char* uu, const char* nn, RankSystem* pp );
|
||||
~RankStats();
|
||||
void setUnique( const char* nn );
|
||||
inline void goDown() {++id;}
|
||||
inline void goUp() {--id;}
|
||||
inline void addStats(Stats* a) { commit( a ); }
|
||||
public:
|
||||
void setName( const char* nn );
|
||||
inline const char* getName() const { return name ? name : ""; }
|
||||
inline const char* getUnique() const { return unique ? unique : ""; }
|
||||
inline int getPosition() const { return id; }
|
||||
inline int updatePosition( Stats* points ) {
|
||||
return parent->updatePos( this , points );
|
||||
}
|
||||
inline void MarkToDelete() {
|
||||
this->score = (1<<31);
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
RankStats* head;
|
||||
RankStats* tail;
|
||||
int rankNum;
|
||||
|
||||
struct scoreCalc{
|
||||
AMX amx;
|
||||
void* code;
|
||||
int func;
|
||||
cell amxAddr1;
|
||||
cell amxAddr2;
|
||||
cell *physAddr1;
|
||||
cell *physAddr2;
|
||||
} calc;
|
||||
|
||||
void put_before( RankStats* a, RankStats* ptr );
|
||||
void put_after( RankStats* a, RankStats* ptr );
|
||||
void unlink( RankStats* ptr );
|
||||
int updatePos( RankStats* r , Stats* s );
|
||||
|
||||
public:
|
||||
|
||||
RankSystem();
|
||||
~RankSystem();
|
||||
|
||||
void saveRank( const char* filename );
|
||||
bool loadRank( const char* filename );
|
||||
RankStats* findEntryInRank(const char* unique, const char* name );
|
||||
RankStats* findEntryInRankByUnique(const char* unique);
|
||||
RankStats* findEntryInRankByPos(int position);
|
||||
//bool loadCalc(const char* filename, char* error);
|
||||
inline int getRankNum( ) const { return rankNum; }
|
||||
void clear();
|
||||
//void unloadCalc();
|
||||
|
||||
class iterator {
|
||||
RankStats* ptr;
|
||||
public:
|
||||
iterator(RankStats* a): ptr(a){}
|
||||
inline iterator& operator--() { ptr = ptr->prev; return *this;}
|
||||
inline iterator& operator++() { ptr = ptr->next; return *this; }
|
||||
inline RankStats& operator*() { return *ptr;}
|
||||
operator bool () { return (ptr != 0); }
|
||||
};
|
||||
|
||||
inline iterator front() { return iterator(head); }
|
||||
inline iterator begin() { return iterator(tail); }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
52
dlls/cstrike/csx/WinCSX/Resource.h
Executable file
52
dlls/cstrike/csx/WinCSX/Resource.h
Executable file
@ -0,0 +1,52 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by WinCSX.rc
|
||||
//
|
||||
#define IDC_MYICON 2
|
||||
#define IDM_VISUALSTYLES 1
|
||||
#define IDD_WINCSX_DIALOG 102
|
||||
#define IDS_APP_TITLE 103
|
||||
#define IDD_WINCSXBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDI_WINCSX 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_WINCSX 109
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_ABOUTBOX 129
|
||||
#define IDR_241 132
|
||||
#define IDC_LIST 1010
|
||||
#define IDC_BUTTON_ABOUT 1029
|
||||
#define IDC_ABOUT 1029
|
||||
#define IDC_BUTTON_SAVECHANGES 1030
|
||||
#define IDC_BUTTON_CLEARSTATS 1031
|
||||
#define IDC_BUTTON_DELETE 1032
|
||||
#define IDC_EDIT_NAME 1100
|
||||
#define IDC_EDIT_POSITION 1101
|
||||
#define IDC_EDIT_AUTHID 1102
|
||||
#define IDC_EDIT_DAMAGE 1103
|
||||
#define IDC_EDIT_FRAGS 1104
|
||||
#define IDC_EDIT_DEATHS 1105
|
||||
#define IDC_EDIT_TKS 1106
|
||||
#define IDC_EDIT_SHOTS 1107
|
||||
#define IDC_EDIT_HITS 1108
|
||||
#define IDC_EDIT_HS 1109
|
||||
#define IDC_EDIT_PLANTS 1110
|
||||
#define IDC_EDIT_EXPLOSIONS 1111
|
||||
#define IDC_EDIT_DEFUSIONS 1112
|
||||
#define IDC_EDIT_DEFUSED 1113
|
||||
#define IDC_AUTHOR 1114
|
||||
#define ID_HELP_DIALOG 32771
|
||||
#define IDM_FILE_DIALOG 32773
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 133
|
||||
#define _APS_NEXT_COMMAND_VALUE 32775
|
||||
#define _APS_NEXT_CONTROL_VALUE 1033
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
463
dlls/cstrike/csx/WinCSX/WinCSX.cpp
Executable file
463
dlls/cstrike/csx/WinCSX/WinCSX.cpp
Executable file
@ -0,0 +1,463 @@
|
||||
// WinCSX.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "WinCSX.h"
|
||||
#include <stdio.h>
|
||||
#include "commctrl.h"
|
||||
|
||||
int APIENTRY _tWinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPTSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
// TODO: Place code here.
|
||||
MSG msg;
|
||||
HACCEL hAccelTable;
|
||||
|
||||
// Initialize global strings
|
||||
LoadString(hInstance, IDS_APP_TITLE, g_szTitle, MAX_LOADSTRING);
|
||||
|
||||
LoadString(hInstance, IDC_WINCSX, g_szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Perform application initialization:
|
||||
if (!InitInstance (hInstance, nCmdShow))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
InitCommonControls();
|
||||
|
||||
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_WINCSX);
|
||||
|
||||
// Show the dialog box now.
|
||||
DialogBox(hInst, (LPCTSTR)IDD_WINCSXBOX, g_hWnd, (DLGPROC)WinCSXBox);
|
||||
|
||||
// Main message loop:
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (int) msg.wParam;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// FUNCTION: MyRegisterClass()
|
||||
//
|
||||
// PURPOSE: Registers the window class.
|
||||
//
|
||||
// COMMENTS:
|
||||
//
|
||||
// This function and its usage are only necessary if you want this code
|
||||
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
|
||||
// function that was added to Windows 95. It is important to call this function
|
||||
// so that the application will get 'well formed' small icons associated
|
||||
// with it.
|
||||
//
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASSEX wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
|
||||
wcex.style = 0; // CS_HREDRAW | CS_VREDRAW;
|
||||
wcex.lpfnWndProc = (WNDPROC)WndProc;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = hInstance;
|
||||
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_WINCSX);
|
||||
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = (LPCTSTR)IDC_WINCSX;
|
||||
wcex.lpszClassName = g_szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
|
||||
|
||||
return RegisterClassEx(&wcex);
|
||||
}
|
||||
|
||||
//
|
||||
// FUNCTION: InitInstance(HANDLE, int)
|
||||
//
|
||||
// PURPOSE: Saves instance handle and creates main window
|
||||
//
|
||||
// COMMENTS:
|
||||
//
|
||||
// In this function, we save the instance handle in a global variable and
|
||||
// create and display the main program window.
|
||||
//
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
hInst = hInstance; // Store instance handle in our global variable
|
||||
|
||||
g_hWnd = CreateWindow(g_szWindowClass, g_szTitle, WS_DLGFRAME, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, hInstance, NULL); // WS_OVERLAPPED WS_MINIMIZE
|
||||
|
||||
if (!g_hWnd)
|
||||
{
|
||||
MessageBox(g_hWnd, "Failed to create main window!", "A caption", MB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(g_hWnd, SW_SHOWMINNOACTIVE); // nCmdShow SW_SHOWNORMAL were rubbish. SW_SHOWMINNOACTIVE looks ok.
|
||||
UpdateWindow(g_hWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool LoadRankFromFile(HWND hDlg) {
|
||||
if ( !g_rank.begin() )
|
||||
{
|
||||
if (!g_rank.loadRank(STATS_FILENAME)) {
|
||||
MessageBox(hDlg, "File load failed! Make sure you have csstats.dat in the same directory as this executable. Exiting...", "Where IS that file of yours?", MB_OK);
|
||||
PostQuitMessage(0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
|
||||
//
|
||||
// PURPOSE: Processes messages for the main window.
|
||||
//
|
||||
// WM_COMMAND - process the application menu
|
||||
// WM_PAINT - Paint the main window
|
||||
// WM_DESTROY - post a quit message and return
|
||||
//
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
//int wmId, wmEvent;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_PAINT:
|
||||
hdc = BeginPaint(hWnd, &ps);
|
||||
// TODO: Add any drawing code here...
|
||||
EndPaint(hWnd, &ps);
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateListBox(HWND hDlg) {
|
||||
HWND listbox = GetDlgItem(hDlg, IDC_LIST);
|
||||
|
||||
// Clear first if there's anything in here already
|
||||
SendMessage(listbox, LB_RESETCONTENT, NULL, NULL);
|
||||
|
||||
if (g_rank.front() == NULL) {
|
||||
MessageBox(hDlg, "The stats file is empty", "Emptiness...", MB_OK);
|
||||
return;
|
||||
}
|
||||
// This part copies the occurring authids into the lefthand listbox.
|
||||
int index = 10, len = 0;
|
||||
char tempbuffer[1024];
|
||||
|
||||
for (RankSystem::iterator b = g_rank.front(); b; --b) {
|
||||
//if ((*b).getPosition() < 1) // umm... naaah!
|
||||
//continue;
|
||||
|
||||
_snprintf(tempbuffer, 1023, "%s", (*b).getName());
|
||||
|
||||
SendMessage( // returns LRESULT in lResult
|
||||
listbox, // handle to destination control
|
||||
LB_ADDSTRING, // message ID
|
||||
0, // = (WPARAM) () wParam;
|
||||
(LPARAM) tempbuffer // = (LPARAM) () lParam;
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT InitWinCSXBox(HWND hDlg) {
|
||||
// Load the stats
|
||||
if (!LoadRankFromFile(hDlg))
|
||||
return TRUE;
|
||||
|
||||
UpdateListBox(hDlg);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void ClearStatsfields(HWND hDlg) {
|
||||
SetDlgItemText(hDlg, IDC_EDIT_POSITION, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_NAME, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_AUTHID, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_FRAGS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_DEATHS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_HS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_TKS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_SHOTS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_HITS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_DAMAGE, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_PLANTS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_EXPLOSIONS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_DEFUSIONS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_DEFUSED, "");
|
||||
}
|
||||
|
||||
void ListboxItemSelected(HWND hDlg) {
|
||||
HWND hwndList = GetDlgItem(hDlg, IDC_LIST); // Get the handle of the listbox
|
||||
LRESULT nItem = SendMessage(hwndList, LB_GETCURSEL, 0, 0); // Get the item # that's selected. First item is prolly 0...
|
||||
if (nItem == LB_ERR) {
|
||||
// Error, reset the form items...
|
||||
//MessageBox(hDlg, "Error: Couldn't find the selected record in the listbox!", "Oh fiddlesticks!", MB_OK);
|
||||
ClearStatsfields(hDlg);
|
||||
return;
|
||||
}
|
||||
// Retrieve complete stats record of this position. Position in listbox should be same as rank in our records!
|
||||
RankSystem::RankStats* stats = g_rank.findEntryInRankByPos((int)nItem + 1);
|
||||
if (stats == NULL) {
|
||||
char msg[] = "Error: Couldn't find the record by position! (nItem = %d)";
|
||||
sprintf(msg, msg, nItem);
|
||||
MessageBox(hDlg, msg, "Oh fiddlesticks!", MB_OK);
|
||||
ClearStatsfields(hDlg);
|
||||
return;
|
||||
}
|
||||
// Copy data into form
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_POSITION, stats->getPosition(), 0);
|
||||
SetDlgItemText(hDlg, IDC_EDIT_NAME, stats->getName());
|
||||
SetDlgItemText(hDlg, IDC_EDIT_AUTHID, stats->getUnique());
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_FRAGS, stats->kills, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_DEATHS, stats->deaths, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_HS, stats->hs, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_TKS, stats->tks, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_SHOTS, stats->shots, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_HITS, stats->hits, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_DAMAGE, stats->damage, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_PLANTS, stats->bPlants, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_EXPLOSIONS, stats->bExplosions, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_DEFUSIONS, stats->bDefusions, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_DEFUSED, stats->bDefused, 0);
|
||||
}
|
||||
|
||||
void SaveChanges(HWND hDlg) {
|
||||
BOOL success;
|
||||
int position = GetDlgItemInt(hDlg, IDC_EDIT_POSITION, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
|
||||
char authid[32]; // "primary key"
|
||||
GetDlgItemText(hDlg, IDC_EDIT_AUTHID, authid, sizeof(authid));
|
||||
RankSystem::RankStats* entry = g_rank.findEntryInRankByUnique(authid);
|
||||
if (!entry) {
|
||||
char buffer[256];
|
||||
sprintf(buffer, "Authid %s not found!", authid);
|
||||
MessageBox(hDlg, buffer, "Update failed", MB_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
char name[32];
|
||||
GetDlgItemText(hDlg, IDC_EDIT_NAME, name, sizeof(name));
|
||||
int frags = GetDlgItemInt(hDlg, IDC_EDIT_FRAGS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int deaths = GetDlgItemInt(hDlg, IDC_EDIT_DEATHS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int hs = GetDlgItemInt(hDlg, IDC_EDIT_HS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int tks = GetDlgItemInt(hDlg, IDC_EDIT_TKS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int shots = GetDlgItemInt(hDlg, IDC_EDIT_SHOTS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int hits = GetDlgItemInt(hDlg, IDC_EDIT_HITS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int damage = GetDlgItemInt(hDlg, IDC_EDIT_DAMAGE, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int plants = GetDlgItemInt(hDlg, IDC_EDIT_PLANTS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int explosions = GetDlgItemInt(hDlg, IDC_EDIT_EXPLOSIONS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int defusions = GetDlgItemInt(hDlg, IDC_EDIT_DEFUSIONS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int defused = GetDlgItemInt(hDlg, IDC_EDIT_DEFUSED, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
|
||||
// Update stats in memory
|
||||
entry->setName(name);
|
||||
entry->kills = frags;
|
||||
entry->deaths = deaths;
|
||||
entry->hs = hs;
|
||||
entry->tks = tks;
|
||||
entry->shots = shots;
|
||||
entry->hits = hits;
|
||||
entry->damage = damage;
|
||||
entry->bPlants = plants;
|
||||
entry->bExplosions = explosions;
|
||||
entry->bDefusions = defusions;
|
||||
entry->bDefused = defused;
|
||||
|
||||
int newPosition = entry->updatePosition(NULL); // Updates rank (prolly just calculates "frags - deaths" and moves up/down in rank)
|
||||
|
||||
g_rank.saveRank(STATS_FILENAME); // Save changes to file
|
||||
|
||||
// Now update our listbox
|
||||
UpdateListBox(hDlg);
|
||||
|
||||
char buffer[256];
|
||||
_snprintf(buffer, 255, "New rank of %s: %d", name, newPosition);
|
||||
MessageBox(hDlg, buffer, "Update succeeded", MB_OK);
|
||||
|
||||
// In the listbox, we need to reselect the item we just updated. Use the new name.
|
||||
HWND listbox = GetDlgItem(hDlg, IDC_LIST);
|
||||
if (SendMessage(listbox, LB_SELECTSTRING, newPosition - 1, (LPARAM)name) == LB_ERR)
|
||||
MessageBox(hDlg, "Error selecting item!", "Oh fiddlesticks!", MB_OK);
|
||||
else {
|
||||
// Update
|
||||
ListboxItemSelected(hDlg);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
BadEnd:
|
||||
MessageBox(hDlg, "Update failed", "Oh fiddlesticks!", MB_OK);
|
||||
}
|
||||
|
||||
void ClearStats(HWND hDlg) {
|
||||
if (MessageBox(hDlg, "Are you sure? If you continue the whole csstats.dat will be wiped out!", "Omg!", MB_OKCANCEL | MB_DEFBUTTON2 | MB_ICONWARNING) != IDOK)
|
||||
return;
|
||||
g_rank.clear();
|
||||
g_rank.saveRank(STATS_FILENAME);
|
||||
|
||||
// Now update our listbox
|
||||
UpdateListBox(hDlg);
|
||||
|
||||
// Update
|
||||
ListboxItemSelected(hDlg);
|
||||
}
|
||||
|
||||
void DeleteRecord(HWND hDlg) {
|
||||
if (MessageBox(hDlg, "Are you sure?", "Omg!", MB_OKCANCEL | MB_DEFBUTTON2 | MB_ICONWARNING) != IDOK)
|
||||
return;
|
||||
|
||||
BOOL success;
|
||||
int position = GetDlgItemInt(hDlg, IDC_EDIT_POSITION, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
|
||||
char authid[32]; // "primary key"
|
||||
GetDlgItemText(hDlg, IDC_EDIT_AUTHID, authid, sizeof(authid));
|
||||
RankSystem::RankStats* entry = g_rank.findEntryInRankByUnique(authid);
|
||||
if (!entry) {
|
||||
char buffer[256];
|
||||
sprintf(buffer, "Authid %s not found!", authid);
|
||||
MessageBox(hDlg, buffer, "Update failed", MB_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
// Mark this record to delete it.
|
||||
entry->MarkToDelete();
|
||||
|
||||
// Save ranks from memory to disk.
|
||||
g_rank.saveRank(STATS_FILENAME); // Save changes to file
|
||||
|
||||
// Clear memory.
|
||||
g_rank.clear();
|
||||
|
||||
// Reload from disk into memory.
|
||||
LoadRankFromFile(hDlg);
|
||||
|
||||
// Update list box.
|
||||
UpdateListBox(hDlg);
|
||||
|
||||
MessageBox(hDlg, "Deleted record", "Delete succeeded", MB_OK);
|
||||
|
||||
return;
|
||||
|
||||
BadEnd:
|
||||
MessageBox(hDlg, "Delete failed", "Oh fiddlesticks!", MB_OK);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Message handler for WinCSXBox.
|
||||
LRESULT CALLBACK WinCSXBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return InitWinCSXBox(hDlg); // load all data from file and fill the listbox with the shit
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
PostQuitMessage(0);
|
||||
|
||||
return TRUE;
|
||||
case IDC_LIST:
|
||||
switch (HIWORD(wParam))
|
||||
{
|
||||
case LBN_SELCHANGE:
|
||||
// Omg omg, a line in linebox was selected.
|
||||
ListboxItemSelected(hDlg);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case IDC_ABOUT:
|
||||
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hDlg, (DLGPROC)AboutBox);
|
||||
break;
|
||||
case IDC_BUTTON_SAVECHANGES:
|
||||
SaveChanges(hDlg);
|
||||
break;
|
||||
case IDC_BUTTON_CLEARSTATS:
|
||||
ClearStats(hDlg);
|
||||
break;
|
||||
case IDC_BUTTON_DELETE:
|
||||
DeleteRecord(hDlg);
|
||||
//DialogBox(hInst, (LPCTSTR)IDD_DELETEBOX, hDlg, (DLGPROC)DeleteBox);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Message handler for AboutBox.
|
||||
LRESULT CALLBACK AboutBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
8
dlls/cstrike/csx/WinCSX/WinCSX.exe.manifest
Normal file
8
dlls/cstrike/csx/WinCSX/WinCSX.exe.manifest
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="x86" />
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
25
dlls/cstrike/csx/WinCSX/WinCSX.h
Executable file
25
dlls/cstrike/csx/WinCSX/WinCSX.h
Executable file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "resource.h"
|
||||
#include "CRank.h"
|
||||
|
||||
// Constants
|
||||
#define MAX_LOADSTRING 100
|
||||
#define VERSION "0.2"
|
||||
#define STATS_FILENAME "csstats.dat"
|
||||
|
||||
// Global Variables:
|
||||
HINSTANCE hInst; // current instance
|
||||
TCHAR g_szTitle[MAX_LOADSTRING]; // The title bar text
|
||||
TCHAR g_szWindowClass[MAX_LOADSTRING]; // the main window class name
|
||||
RankSystem g_rank;
|
||||
HWND g_hWnd;
|
||||
|
||||
// Forward declarations of functions included in this code module:
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK WinCSXBox(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK AboutBox(HWND, UINT, WPARAM, LPARAM);
|
||||
bool LoadRankFromFile(HWND hDlg);
|
||||
|
BIN
dlls/cstrike/csx/WinCSX/WinCSX.ico
Executable file
BIN
dlls/cstrike/csx/WinCSX/WinCSX.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
208
dlls/cstrike/csx/WinCSX/WinCSX.rc
Executable file
208
dlls/cstrike/csx/WinCSX/WinCSX.rc
Executable file
@ -0,0 +1,208 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Neutral resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_WINCSX ICON "WinCSX.ico"
|
||||
IDI_SMALL ICON "small.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_WINCSXBOX DIALOGEX 22, 17, 253, 204
|
||||
STYLE DS_ABSALIGN | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "WinCSX"
|
||||
FONT 8, "System", 0, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Close",IDOK,206,168,39,27,WS_GROUP
|
||||
LISTBOX IDC_LIST,4,5,94,190,LBS_HASSTRINGS |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
EDITTEXT IDC_EDIT_NAME,109,18,87,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_POSITION,206,18,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_AUTHID,109,48,87,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY
|
||||
EDITTEXT IDC_EDIT_DAMAGE,206,48,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_FRAGS,109,78,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_DEATHS,157,78,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_TKS,206,78,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_SHOTS,109,108,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_HITS,157,108,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_HS,206,108,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_PLANTS,109,138,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_EXPLOSIONS,157,137,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_DEFUSIONS,206,137,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_DEFUSED,109,168,40,12,ES_AUTOHSCROLL
|
||||
LTEXT "Name (last used)",IDC_STATIC,109,5,56,8
|
||||
LTEXT "Damage",IDC_STATIC,206,35,28,8
|
||||
LTEXT "Frags",IDC_STATIC,109,65,20,8
|
||||
LTEXT "Headshots",IDC_STATIC,206,95,36,8
|
||||
LTEXT "Team kills",IDC_STATIC,206,65,35,8
|
||||
LTEXT "Hits",IDC_STATIC,157,95,14,8
|
||||
LTEXT "Shots",IDC_STATIC,109,95,20,8
|
||||
LTEXT "Deaths",IDC_STATIC,157,65,24,8
|
||||
LTEXT "Authid",IDC_STATIC,109,35,21,8
|
||||
LTEXT "Position",IDC_STATIC,206,5,28,8
|
||||
LTEXT "Plants",IDC_STATIC,109,125,22,8
|
||||
LTEXT "Explosions",IDC_STATIC,157,125,38,8
|
||||
LTEXT "Defused",IDC_STATIC,109,155,28,8
|
||||
LTEXT "Defusions",IDC_STATIC,206,125,34,8
|
||||
PUSHBUTTON "About",IDC_ABOUT,109,185,40,10
|
||||
PUSHBUTTON "Save",IDC_BUTTON_SAVECHANGES,157,155,39,8
|
||||
PUSHBUTTON "Clear stats",IDC_BUTTON_CLEARSTATS,157,168,39,27
|
||||
PUSHBUTTON "Delete",IDC_BUTTON_DELETE,206,155,39,8
|
||||
END
|
||||
|
||||
IDD_ABOUTBOX DIALOGEX 0, 0, 186, 95
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "About"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,109,68,50,14
|
||||
LTEXT "WinCSX 0.4",IDC_STATIC,18,20,66,8
|
||||
LTEXT "By JGHG",IDC_STATIC,18,28,66,8
|
||||
LTEXT "2005",IDC_STATIC,18,36,66,8
|
||||
LTEXT "http://www.amxmodx.org/",IDC_STATIC,18,44,88,8
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_WINCSXBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 4
|
||||
RIGHTMARGIN, 248
|
||||
VERTGUIDE, 98
|
||||
VERTGUIDE, 109
|
||||
VERTGUIDE, 157
|
||||
VERTGUIDE, 196
|
||||
VERTGUIDE, 206
|
||||
VERTGUIDE, 245
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 195
|
||||
HORZGUIDE, 18
|
||||
HORZGUIDE, 35
|
||||
HORZGUIDE, 48
|
||||
HORZGUIDE, 65
|
||||
HORZGUIDE, 78
|
||||
HORZGUIDE, 95
|
||||
HORZGUIDE, 108
|
||||
HORZGUIDE, 125
|
||||
HORZGUIDE, 137
|
||||
HORZGUIDE, 155
|
||||
HORZGUIDE, 163
|
||||
HORZGUIDE, 168
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 24
|
||||
//
|
||||
|
||||
IDM_VISUALSTYLES 24 "WinCSX.exe.manifest"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_APP_TITLE "WinCSX"
|
||||
IDC_WINCSX "WINCSX"
|
||||
END
|
||||
|
||||
#endif // Neutral resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Swedish resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Swedish resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
187
dlls/cstrike/csx/WinCSX/WinCSX.vcproj
Executable file
187
dlls/cstrike/csx/WinCSX/WinCSX.vcproj
Executable file
@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="WinCSX"
|
||||
ProjectGUID="{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
RootNamespace="WinCSX"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib"
|
||||
OutputFile="$(OutDir)/WinCSX.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/WinCSX.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib"
|
||||
OutputFile="$(OutDir)/WinCSX.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\Resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
<File
|
||||
RelativePath=".\small.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.exe.manifest">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.rc">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Dependencies"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\amxxmodule.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CRank.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CRank.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\moduleconfig.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
2409
dlls/cstrike/csx/WinCSX/amxxmodule.h
Executable file
2409
dlls/cstrike/csx/WinCSX/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
475
dlls/cstrike/csx/WinCSX/moduleconfig.h
Executable file
475
dlls/cstrike/csx/WinCSX/moduleconfig.h
Executable file
@ -0,0 +1,475 @@
|
||||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CSX"
|
||||
#define MODULE_VERSION "1.72"
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org/"
|
||||
#define MODULE_LOGTAG "CSX"
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Unknown"
|
||||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
//#define USE_METAMOD
|
||||
|
||||
// use memory manager/tester?
|
||||
// note that if you use this, you cannot construct/allocate
|
||||
// anything before the module attached (OnAmxxAttach).
|
||||
// be careful of default constructors using new/malloc!
|
||||
// #define MEMORY_TEST
|
||||
|
||||
// Unless you use STL or exceptions, keep this commented.
|
||||
// It allows you to compile without libstdc++.so as a dependency
|
||||
// #define NO_ALLOC_OVERRIDES
|
||||
|
||||
// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself
|
||||
// #define NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
//#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
// AMXX detach
|
||||
//#define FN_AMXX_DETACH OnAmxxDetach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
//#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
// #define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
// #define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
// #define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
// #define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
// #define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
// #define FN_MessageBegin_Post MessageBegin_Post
|
||||
// #define FN_MessageEnd_Post MessageEnd_Post
|
||||
// #define FN_WriteByte_Post WriteByte_Post
|
||||
// #define FN_WriteChar_Post WriteChar_Post
|
||||
// #define FN_WriteShort_Post WriteShort_Post
|
||||
// #define FN_WriteLong_Post WriteLong_Post
|
||||
// #define FN_WriteAngle_Post WriteAngle_Post
|
||||
// #define FN_WriteCoord_Post WriteCoord_Post
|
||||
// #define FN_WriteString_Post WriteString_Post
|
||||
// #define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
// #define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
271
dlls/cstrike/csx/WinCSX/msvc8/WinCSX.vcproj
Normal file
271
dlls/cstrike/csx/WinCSX/msvc8/WinCSX.vcproj
Normal file
@ -0,0 +1,271 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="WinCSX"
|
||||
ProjectGUID="{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
RootNamespace="WinCSX"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib"
|
||||
OutputFile="$(OutDir)/WinCSX.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/WinCSX.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="comctl32.lib"
|
||||
OutputFile="$(OutDir)/WinCSX.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\small.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.exe.manifest"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\WinCSX.rc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Dependencies"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\amxxmodule.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\moduleconfig.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
BIN
dlls/cstrike/csx/WinCSX/small.ico
Executable file
BIN
dlls/cstrike/csx/WinCSX/small.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
8
dlls/cstrike/csx/WinCSX/stdafx.cpp
Executable file
8
dlls/cstrike/csx/WinCSX/stdafx.cpp
Executable file
@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// WinCSX.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
20
dlls/cstrike/csx/WinCSX/stdafx.h
Executable file
20
dlls/cstrike/csx/WinCSX/stdafx.h
Executable file
@ -0,0 +1,20 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
// Windows Header Files:
|
||||
#include <windows.h>
|
||||
// C RunTime Header Files
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
//#include "CRank.h"
|
||||
//#include "amx.h"
|
395
dlls/cstrike/csx/meta_api.cpp
Executable file
395
dlls/cstrike/csx/meta_api.cpp
Executable file
@ -0,0 +1,395 @@
|
||||
#include "amxxmodule.h"
|
||||
#include "rank.h"
|
||||
|
||||
funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||
funEventCall modMsgs[MAX_REG_MSGS];
|
||||
|
||||
void (*function)(void*);
|
||||
void (*endfunction)(void*);
|
||||
|
||||
CPlayer players[33];
|
||||
|
||||
CPlayer* mPlayer;
|
||||
|
||||
int mPlayerIndex;
|
||||
int mState;
|
||||
|
||||
RankSystem g_rank;
|
||||
|
||||
Grenades g_grenades;
|
||||
|
||||
int iFGrenade;
|
||||
int iFDeath;
|
||||
int iFDamage;
|
||||
|
||||
int iFBPlanted;
|
||||
int iFBDefused;
|
||||
int iFBPlanting;
|
||||
int iFBDefusing;
|
||||
int iFBExplode;
|
||||
|
||||
int g_bombAnnounce;
|
||||
int g_Planter;
|
||||
int g_Defuser;
|
||||
|
||||
bool rankBots;
|
||||
|
||||
int gmsgCurWeapon;
|
||||
int gmsgDeathMsg;
|
||||
int gmsgDamage;
|
||||
int gmsgDamageEnd;
|
||||
int gmsgWeaponList;
|
||||
int gmsgResetHUD;
|
||||
int gmsgAmmoX;
|
||||
int gmsgScoreInfo;
|
||||
int gmsgAmmoPickup;
|
||||
int gmsgSendAudio;
|
||||
int gmsgTextMsg;
|
||||
int gmsgBarTime;
|
||||
|
||||
int g_CurrentMsg;
|
||||
|
||||
cvar_t init_csstats_maxsize ={"csstats_maxsize","3500", 0 , 3500.0 };
|
||||
cvar_t init_csstats_reset ={"csstats_reset","0"};
|
||||
cvar_t init_csstats_rank ={"csstats_rank","0"};
|
||||
cvar_t *csstats_maxsize;
|
||||
cvar_t *csstats_reset;
|
||||
cvar_t *csstats_rank;
|
||||
|
||||
cvar_t* csstats_rankbots;
|
||||
cvar_t* csstats_pause;
|
||||
cvar_t init_csstats_rankbots ={"csstats_rankbots","0"};
|
||||
cvar_t init_csstats_pause = {"csstats_pause","0"};
|
||||
|
||||
struct sUserMsg
|
||||
{
|
||||
const char* name;
|
||||
int* id;
|
||||
funEventCall func;
|
||||
bool endmsg;
|
||||
} g_user_msg[] = {
|
||||
{"CurWeapon", &gmsgCurWeapon, Client_CurWeapon, false},
|
||||
{"Damage", &gmsgDamage, Client_Damage, false},
|
||||
{"Damage", &gmsgDamageEnd, Client_Damage_End, true},
|
||||
{"WeaponList", &gmsgWeaponList, Client_WeaponList, false},
|
||||
{"ResetHUD", &gmsgResetHUD, Client_ResetHUD, true},
|
||||
{"AmmoX", &gmsgAmmoX, Client_AmmoX, false},
|
||||
{"ScoreInfo", &gmsgScoreInfo, Client_ScoreInfo, false},
|
||||
{"AmmoPickup", &gmsgAmmoPickup, Client_AmmoPickup, false},
|
||||
{"SendAudio", &gmsgSendAudio, Client_SendAudio, false},
|
||||
{"TextMsg", &gmsgTextMsg, Client_TextMsg, false},
|
||||
{"BarTime", &gmsgBarTime, Client_BarTime, false},
|
||||
{"DeathMsg", &gmsgDeathMsg, Client_DeathMsg, false},
|
||||
|
||||
{0, 0, 0, false}
|
||||
};
|
||||
|
||||
int RegUserMsg_Post(const char *pszName, int iSize)
|
||||
{
|
||||
for (int i = 0; g_user_msg[ i ].name; ++i )
|
||||
{
|
||||
if ( !*g_user_msg[i].id && strcmp( g_user_msg[ i ].name , pszName ) == 0 )
|
||||
{
|
||||
int id = META_RESULT_ORIG_RET( int );
|
||||
|
||||
*g_user_msg[ i ].id = id;
|
||||
|
||||
if ( g_user_msg[ i ].endmsg )
|
||||
modMsgsEnd[ id ] = g_user_msg[ i ].func;
|
||||
else
|
||||
modMsgs[ id ] = g_user_msg[ i ].func;
|
||||
//break;
|
||||
}
|
||||
}
|
||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
}
|
||||
|
||||
const char* get_localinfo( const char* name , const char* def = 0 )
|
||||
{
|
||||
const char* b = LOCALINFO( (char*)name );
|
||||
if (((b==0)||(*b==0)) && def )
|
||||
SET_LOCALINFO((char*)name,(char*)(b = def) );
|
||||
return b;
|
||||
}
|
||||
|
||||
void ClientKill(edict_t *pEntity){
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
if ( !pPlayer->IsAlive())
|
||||
RETURN_META(MRES_IGNORED);
|
||||
|
||||
MF_ExecuteForward( iFDamage,static_cast<cell>(pPlayer->index), static_cast<cell>(pPlayer->index) ,
|
||||
static_cast<cell>(0), static_cast<cell>(0), static_cast<cell>(0), static_cast<cell>(0) ); // he would
|
||||
pPlayer->saveKill(pPlayer,0,0,0);
|
||||
MF_ExecuteForward( iFDeath,static_cast<cell>(pPlayer->index), static_cast<cell>(pPlayer->index),
|
||||
static_cast<cell>(0), static_cast<cell>(0), static_cast<cell>(0) );
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){
|
||||
|
||||
rankBots = (int)csstats_rankbots->value ? true:false;
|
||||
|
||||
for( int i = 1; i <= gpGlobals->maxClients; ++i)
|
||||
GET_PLAYER_POINTER_I(i)->Init( i , pEdictList + i );
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void PlayerPreThink_Post( edict_t *pEntity ) {
|
||||
if ( !isModuleActive() )
|
||||
return;
|
||||
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time ){
|
||||
|
||||
if ( !ignoreBots(pEntity) ){
|
||||
pPlayer->clearStats = 0.0f;
|
||||
if (pPlayer->rank)
|
||||
pPlayer->rank->updatePosition( &pPlayer->life );
|
||||
pPlayer->restartStats(false);
|
||||
}
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ServerDeactivate() {
|
||||
int i;
|
||||
for( i = 1;i<=gpGlobals->maxClients; ++i){
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
||||
if (pPlayer->rank) pPlayer->Disconnect();
|
||||
}
|
||||
if ( (g_rank.getRankNum() >= (int)csstats_maxsize->value) || ((int)csstats_reset->value == 1 ) ) {
|
||||
CVAR_SET_FLOAT("csstats_reset",0.0);
|
||||
g_rank.clear(); // clear before save to file
|
||||
}
|
||||
g_rank.saveRank( MF_BuildPathname("%s",get_localinfo("csstats")) );
|
||||
|
||||
// clear custom weapons info
|
||||
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++)
|
||||
weaponData[i].used = false;
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ){
|
||||
GET_PLAYER_POINTER(pEntity)->Connect(pszAddress);
|
||||
RETURN_META_VALUE(MRES_IGNORED, TRUE);
|
||||
}
|
||||
|
||||
void ClientDisconnect( edict_t *pEntity ) {
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
if (pPlayer->rank) pPlayer->Disconnect();
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ClientPutInServer_Post( edict_t *pEntity ) {
|
||||
GET_PLAYER_POINTER(pEntity)->PutInServer();
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) {
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
const char* name = INFOKEY_VALUE(infobuffer,"name");
|
||||
const char* oldname = STRING(pEntity->v.netname);
|
||||
|
||||
if ( pPlayer->rank ){
|
||||
if ( strcmp(oldname,name) != 0 ) {
|
||||
if ((int)csstats_rank->value == 0)
|
||||
pPlayer->rank = g_rank.findEntryInRank( name, name );
|
||||
else
|
||||
pPlayer->rank->setName( name );
|
||||
}
|
||||
}
|
||||
else if ( pPlayer->IsBot() ) {
|
||||
pPlayer->Connect( "127.0.0.1" );
|
||||
pPlayer->PutInServer();
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) {
|
||||
if (ed){
|
||||
mPlayerIndex = ENTINDEX(ed);
|
||||
mPlayer = GET_PLAYER_POINTER_I(mPlayerIndex);
|
||||
} else {
|
||||
mPlayerIndex = 0;
|
||||
mPlayer = 0;
|
||||
}
|
||||
mState = 0;
|
||||
g_CurrentMsg = msg_type;
|
||||
if ( g_CurrentMsg < 0 || g_CurrentMsg >= MAX_REG_MSGS )
|
||||
g_CurrentMsg = 0;
|
||||
function=modMsgs[g_CurrentMsg];
|
||||
endfunction=modMsgsEnd[g_CurrentMsg];
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void MessageEnd_Post(void) {
|
||||
if (endfunction) (*endfunction)(NULL);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteByte_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteChar_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteShort_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteLong_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteAngle_Post(float flValue) {
|
||||
if (function) (*function)((void *)&flValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteCoord_Post(float flValue) {
|
||||
if (function) (*function)((void *)&flValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteString_Post(const char *sz) {
|
||||
if (function) (*function)((void *)sz);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteEntity_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void StartFrame_Post(){
|
||||
if (g_bombAnnounce){
|
||||
switch (g_bombAnnounce){
|
||||
case BOMB_PLANTING:
|
||||
MF_ExecuteForward( iFBPlanting, static_cast<cell>(g_Planter) );
|
||||
break;
|
||||
case BOMB_PLANTED:
|
||||
MF_ExecuteForward( iFBPlanted, static_cast<cell>(g_Planter) );
|
||||
break;
|
||||
case BOMB_EXPLODE:
|
||||
MF_ExecuteForward( iFBExplode, static_cast<cell>(g_Planter), static_cast<cell>(g_Defuser) );
|
||||
break;
|
||||
case BOMB_DEFUSING:
|
||||
MF_ExecuteForward( iFBDefusing, static_cast<cell>(g_Defuser) );
|
||||
break;
|
||||
case BOMB_DEFUSED:
|
||||
MF_ExecuteForward( iFBDefused, static_cast<cell>(g_Defuser) );
|
||||
break;
|
||||
}
|
||||
g_bombAnnounce = 0;
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void SetModel_Post(edict_t *e, const char *m){
|
||||
|
||||
if ( !isModuleActive() )
|
||||
return;
|
||||
|
||||
if ( e->v.owner && m[7]=='w' && m[8]=='_' ){
|
||||
int w_id = 0;
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner);
|
||||
switch(m[9]){
|
||||
case 'h':
|
||||
w_id = CSW_HEGRENADE;
|
||||
g_grenades.put(e, 2.0, 4, pPlayer);
|
||||
pPlayer->saveShot(CSW_HEGRENADE);
|
||||
break;
|
||||
case 'f':
|
||||
if (m[10]=='l') w_id = CSW_FLASHBANG;
|
||||
break;
|
||||
case 's':
|
||||
if (m[10]=='m') w_id = CSW_SMOKEGRENADE;
|
||||
break;
|
||||
}
|
||||
if ( w_id )
|
||||
MF_ExecuteForward( iFGrenade, static_cast<cell>(pPlayer->index),
|
||||
static_cast<cell>(ENTINDEX(e)), static_cast<cell>(w_id));
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) {
|
||||
if (sample[0]=='w'&&sample[1]=='e'&&sample[8]=='k'&&sample[9]=='n'&&sample[14]!='d'){
|
||||
CPlayer*pPlayer = GET_PLAYER_POINTER(entity);
|
||||
pPlayer->saveShot(pPlayer->current);
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *e, TraceResult *ptr)
|
||||
{
|
||||
if (ptr->pHit && (ptr->pHit->v.flags & (FL_CLIENT|FL_FAKECLIENT))
|
||||
&& e
|
||||
&& (e->v.flags & (FL_CLIENT|FL_FAKECLIENT))
|
||||
&& ptr->iHitgroup)
|
||||
{
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(e);
|
||||
if (pPlayer->current != CSW_KNIFE)
|
||||
{
|
||||
pPlayer->aiming = ptr->iHitgroup;
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void OnMetaAttach() {
|
||||
CVAR_REGISTER (&init_csstats_maxsize);
|
||||
CVAR_REGISTER (&init_csstats_reset);
|
||||
CVAR_REGISTER (&init_csstats_rank);
|
||||
csstats_maxsize=CVAR_GET_POINTER(init_csstats_maxsize.name);
|
||||
csstats_reset=CVAR_GET_POINTER(init_csstats_reset.name);
|
||||
csstats_rank=CVAR_GET_POINTER(init_csstats_rank.name);
|
||||
|
||||
CVAR_REGISTER (&init_csstats_rankbots);
|
||||
CVAR_REGISTER (&init_csstats_pause);
|
||||
csstats_rankbots = CVAR_GET_POINTER(init_csstats_rankbots.name);
|
||||
csstats_pause = CVAR_GET_POINTER(init_csstats_pause.name);
|
||||
}
|
||||
|
||||
void OnAmxxAttach(){
|
||||
MF_AddNatives(stats_Natives);
|
||||
const char* path = get_localinfo("csstats_score");
|
||||
if ( path && *path )
|
||||
{
|
||||
char error[128];
|
||||
g_rank.loadCalc( MF_BuildPathname("%s",path) , error );
|
||||
}
|
||||
|
||||
if ( !g_rank.begin() )
|
||||
{
|
||||
g_rank.loadRank( MF_BuildPathname("%s",
|
||||
get_localinfo("csstats") ) );
|
||||
}
|
||||
}
|
||||
|
||||
void OnAmxxDetach() {
|
||||
g_grenades.clear();
|
||||
g_rank.clear();
|
||||
g_rank.unloadCalc();
|
||||
}
|
||||
|
||||
void OnPluginsLoaded(){
|
||||
iFDeath = MF_RegisterForward("client_death",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||
iFDamage = MF_RegisterForward("client_damage",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||
iFBPlanted = MF_RegisterForward("bomb_planted",ET_IGNORE,FP_CELL,FP_DONE);
|
||||
iFBDefused = MF_RegisterForward("bomb_defused",ET_IGNORE,FP_CELL,FP_DONE);
|
||||
iFBPlanting = MF_RegisterForward("bomb_planting",ET_IGNORE,FP_CELL,FP_DONE);
|
||||
iFBDefusing = MF_RegisterForward("bomb_defusing",ET_IGNORE,FP_CELL,FP_DONE);
|
||||
iFBExplode = MF_RegisterForward("bomb_explode",ET_IGNORE,FP_CELL,FP_CELL,FP_DONE);
|
||||
iFGrenade = MF_RegisterForward("grenade_throw",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||
}
|
29
dlls/cstrike/csx/msvc7/csx.sln
Executable file
29
dlls/cstrike/csx/msvc7/csx.sln
Executable file
@ -0,0 +1,29 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csx", "csx.vcproj", "{1DC4A99A-F23F-4AAE-881C-79D157C91155}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinCSX", "..\WinCSX\WinCSX.vcproj", "{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug.ActiveCfg = Debug|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug.Build.0 = Debug|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release.ActiveCfg = Release|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release.Build.0 = Release|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug.ActiveCfg = Debug|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug.Build.0 = Debug|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release.ActiveCfg = Release|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
214
dlls/cstrike/csx/msvc7/csx.vcproj
Executable file
214
dlls/cstrike/csx/msvc7/csx.vcproj
Executable file
@ -0,0 +1,214 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="csx"
|
||||
ProjectGUID="{1DC4A99A-F23F-4AAE-881C-79D157C91155}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\sdk"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;csx_EXPORTS;JIT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
StructMemberAlignment="0"
|
||||
EnableFunctionLevelLinking="FALSE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release/csx.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Release/csx_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\Release/csx_amxx.pdb"
|
||||
ImportLibrary=".\Release/csx_amxx.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/csx.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\sdk"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;csx_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/csx.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Debug/csx_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/csx_amxx.pdb"
|
||||
ImportLibrary=".\Debug/csx_amxx.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/csx.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\CMisc.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\meta_api.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\rank.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\usermsg.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\CMisc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\rank.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="SDK"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\sdk\moduleconfig.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sdk\svn_version.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="SDK Base"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Pawn Includes"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\..\plugins\include\csstats.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\plugins\include\csx.inc">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
26
dlls/cstrike/csx/msvc8/csx.sln
Normal file
26
dlls/cstrike/csx/msvc8/csx.sln
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csx", "csx.vcproj", "{1DC4A99A-F23F-4AAE-881C-79D157C91155}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinCSX", "..\WinCSX\msvc8\WinCSX.vcproj", "{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release|Win32.Build.0 = Release|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
295
dlls/cstrike/csx/msvc8/csx.vcproj
Normal file
295
dlls/cstrike/csx/msvc8/csx.vcproj
Normal file
@ -0,0 +1,295 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="csx"
|
||||
ProjectGUID="{1DC4A99A-F23F-4AAE-881C-79D157C91155}"
|
||||
RootNamespace="csx"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/csx.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\sdk"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;csx_EXPORTS;JIT"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
StructMemberAlignment="0"
|
||||
EnableFunctionLevelLinking="false"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\Release/csx.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Release/csx_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/csx_amxx.pdb"
|
||||
ImportLibrary=".\Release/csx_amxx.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/csx.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\sdk"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;csx_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\Debug/csx.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Debug/csx_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/csx_amxx.pdb"
|
||||
ImportLibrary=".\Debug/csx_amxx.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\CMisc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\meta_api.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\rank.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\usermsg.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\CMisc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRank.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\rank.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="SDK"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\sdk\moduleconfig.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sdk\svn_version.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="SDK Base"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\sdk\amxxmodule.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Pawn Includes"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\plugins\include\csstats.inc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\plugins\include\csx.inc"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
404
dlls/cstrike/csx/rank.cpp
Executable file
404
dlls/cstrike/csx/rank.cpp
Executable file
@ -0,0 +1,404 @@
|
||||
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "rank.h"
|
||||
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */
|
||||
{
|
||||
int index = params[1];
|
||||
CHECK_PLAYERRANGE(index);
|
||||
int attacker = params[2];
|
||||
CHECK_PLAYERRANGE(attacker);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->attackers[attacker].hits){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||
CPlayer::PlayerWeapon* stats = &pPlayer->attackers[attacker];
|
||||
cpStats[0] = stats->kills;
|
||||
cpStats[1] = stats->deaths;
|
||||
cpStats[2] = stats->hs;
|
||||
cpStats[3] = stats->tks;
|
||||
cpStats[4] = stats->shots;
|
||||
cpStats[5] = stats->hits;
|
||||
cpStats[6] = stats->damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = stats->bodyHits[i];
|
||||
if (params[6] && attacker && stats->name )
|
||||
MF_SetAmxString(amx,params[5],stats->name,params[6]);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */
|
||||
{
|
||||
int index = params[1];
|
||||
CHECK_PLAYERRANGE(index);
|
||||
int victim = params[2];
|
||||
CHECK_PLAYERRANGE(victim);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->victims[victim].hits){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||
CPlayer::PlayerWeapon* stats = &pPlayer->victims[victim];
|
||||
cpStats[0] = stats->kills;
|
||||
cpStats[1] = stats->deaths;
|
||||
cpStats[2] = stats->hs;
|
||||
cpStats[3] = stats->tks;
|
||||
cpStats[4] = stats->shots;
|
||||
cpStats[5] = stats->hits;
|
||||
cpStats[6] = stats->damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = stats->bodyHits[i];
|
||||
if (params[6] && victim && stats->name)
|
||||
MF_SetAmxString(amx,params[5],stats->name,params[6]);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end)
|
||||
{
|
||||
int index = params[1];
|
||||
CHECK_PLAYERRANGE(index);
|
||||
int weapon = params[2];
|
||||
if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->weaponsRnd[weapon].shots){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||
Stats* stats = &pPlayer->weaponsRnd[weapon];
|
||||
cpStats[0] = stats->kills;
|
||||
cpStats[1] = stats->deaths;
|
||||
cpStats[2] = stats->hs;
|
||||
cpStats[3] = stats->tks;
|
||||
cpStats[4] = stats->shots;
|
||||
cpStats[5] = stats->hits;
|
||||
cpStats[6] = stats->damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = stats->bodyHits[i];
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */
|
||||
{
|
||||
int index = params[1];
|
||||
CHECK_PLAYERRANGE(index);
|
||||
int weapon = params[2];
|
||||
if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->weapons[weapon].shots){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||
CPlayer::PlayerWeapon* stats = &pPlayer->weapons[weapon];
|
||||
cpStats[0] = stats->kills;
|
||||
cpStats[1] = stats->deaths;
|
||||
cpStats[2] = stats->hs;
|
||||
cpStats[3] = stats->tks;
|
||||
cpStats[4] = stats->shots;
|
||||
cpStats[5] = stats->hits;
|
||||
cpStats[6] = stats->damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = stats->bodyHits[i];
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param */
|
||||
{
|
||||
int index = params[1];
|
||||
CHECK_PLAYER(index);
|
||||
GET_PLAYER_POINTER_I(index)->restartStats();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
int index = params[1];
|
||||
CHECK_PLAYERRANGE(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->rank){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||
cpStats[0] = pPlayer->life.kills;
|
||||
cpStats[1] = pPlayer->life.deaths;
|
||||
cpStats[2] = pPlayer->life.hs;
|
||||
cpStats[3] = pPlayer->life.tks;
|
||||
cpStats[4] = pPlayer->life.shots;
|
||||
cpStats[5] = pPlayer->life.hits;
|
||||
cpStats[6] = pPlayer->life.damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = pPlayer->life.bodyHits[i];
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
int index = params[1];
|
||||
CHECK_PLAYERRANGE(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if ( pPlayer->rank ){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||
cpStats[0] = pPlayer->rank->kills;
|
||||
cpStats[1] = pPlayer->rank->deaths;
|
||||
cpStats[2] = pPlayer->rank->hs;
|
||||
cpStats[3] = pPlayer->rank->tks;
|
||||
cpStats[4] = pPlayer->rank->shots;
|
||||
cpStats[5] = pPlayer->rank->hits;
|
||||
cpStats[6] = pPlayer->rank->damage;
|
||||
|
||||
cpStats[7] = pPlayer->rank->getPosition();
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = pPlayer->rank->bodyHits[i];
|
||||
return pPlayer->rank->getPosition();
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_stats2(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
int index = params[1];
|
||||
CHECK_PLAYERRANGE(index);
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if ( pPlayer->rank ){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
|
||||
cpStats[0] = pPlayer->rank->bDefusions;
|
||||
cpStats[1] = pPlayer->rank->bDefused;
|
||||
cpStats[2] = pPlayer->rank->bPlants;
|
||||
cpStats[3] = pPlayer->rank->bExplosions;
|
||||
|
||||
return pPlayer->rank->getPosition();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 7 param */
|
||||
{
|
||||
|
||||
int index = params[1] + 1;
|
||||
|
||||
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
||||
if ((*a).getPosition() == index) {
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||
cpStats[0] = (*a).kills;
|
||||
cpStats[1] = (*a).deaths;
|
||||
cpStats[2] = (*a).hs;
|
||||
cpStats[3] = (*a).tks;
|
||||
cpStats[4] = (*a).shots;
|
||||
cpStats[5] = (*a).hits;
|
||||
cpStats[6] = (*a).damage;
|
||||
|
||||
cpStats[7] = (*a).getPosition();
|
||||
|
||||
MF_SetAmxString(amx,params[4],(*a).getName(),params[5]);
|
||||
if (params[6] > 0)
|
||||
MF_SetAmxString(amx, params[6], (*a).getUnique(), params[7]);
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = (*a).bodyHits[i];
|
||||
return --a ? index : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 4 param */
|
||||
{
|
||||
|
||||
int index = params[1] + 1;
|
||||
|
||||
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
||||
if ((*a).getPosition() == index) {
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
if (params[4] > 0)
|
||||
MF_SetAmxString(amx, params[3], (*a).getUnique(), params[4]);
|
||||
|
||||
cpStats[0] = (*a).bDefusions;
|
||||
cpStats[1] = (*a).bDefused;
|
||||
cpStats[2] = (*a).bPlants;
|
||||
cpStats[3] = (*a).bExplosions;
|
||||
|
||||
return --a ? index : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_statsnum(AMX *amx, cell *params)
|
||||
{
|
||||
return g_rank.getRankNum();
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL register_cwpn(AMX *amx, cell *params){ // name,melee=0,logname
|
||||
int i,iLen;
|
||||
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++){
|
||||
if ( !weaponData[i].used ){
|
||||
|
||||
char* szName = MF_GetAmxString(amx, params[1], 0, &iLen);
|
||||
char *szLog = MF_GetAmxString(amx, params[3], 0, &iLen);
|
||||
|
||||
strcpy(weaponData[i].name,szName);
|
||||
strcpy(weaponData[i].logname,szLog);
|
||||
|
||||
weaponData[i].used = true;
|
||||
weaponData[i].melee = params[2] ? true:false;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
MF_PrintSrvConsole("No More Custom Weapon Slots!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg,hp=0
|
||||
int weapon = params[1];
|
||||
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){ // only for custom weapons
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int att = params[2];
|
||||
CHECK_PLAYERRANGE(att);
|
||||
|
||||
int vic = params[3];
|
||||
CHECK_PLAYERRANGE(vic);
|
||||
|
||||
int dmg = params[4];
|
||||
if ( dmg<1 ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid damage %d", dmg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aim = params[5];
|
||||
if ( aim < 0 || aim > 7 ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid aim %d", aim);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPlayer* pAtt = GET_PLAYER_POINTER_I(att);
|
||||
CPlayer* pVic = GET_PLAYER_POINTER_I(vic);
|
||||
|
||||
pVic->pEdict->v.dmg_inflictor = NULL;
|
||||
pAtt->saveHit( pVic , weapon , dmg, aim );
|
||||
|
||||
if ( !pAtt ) pAtt = pVic;
|
||||
int TA = 0;
|
||||
if ( (pVic->teamId == pAtt->teamId) && ( pVic != pAtt) )
|
||||
TA = 1;
|
||||
MF_ExecuteForward( iFDamage, static_cast<cell>(pAtt->index),
|
||||
static_cast<cell>(pVic->index), static_cast<cell>(dmg), static_cast<cell>(weapon),
|
||||
static_cast<cell>(aim), static_cast<cell>(TA) );
|
||||
|
||||
if ( pVic->IsAlive() )
|
||||
return 1;
|
||||
|
||||
pAtt->saveKill(pVic,weapon,( aim == 1 ) ? 1:0 ,TA);
|
||||
MF_ExecuteForward( iFDeath, static_cast<cell>(pAtt->index), static_cast<cell>(pVic->index),
|
||||
static_cast<cell>(weapon), static_cast<cell>(aim), static_cast<cell>(TA) );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,wid
|
||||
int index = params[2];
|
||||
CHECK_PLAYERRANGE(index);
|
||||
|
||||
int weapon = params[1];
|
||||
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
pPlayer->saveShot(weapon);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_wpnname(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||
return 0;
|
||||
}
|
||||
return MF_SetAmxString(amx,params[2],weaponData[id].name,params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_wpnlogname(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||
return 0;
|
||||
}
|
||||
return MF_SetAmxString(amx,params[2],weaponData[id].logname,params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL is_melee(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||
return 0;
|
||||
}
|
||||
if ( id == 29 )
|
||||
return 1;
|
||||
return weaponData[id].melee ? 1:0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_maxweapons(AMX *amx, cell *params){
|
||||
return MAX_WEAPONS+MAX_CWEAPONS;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats_size(AMX *amx, cell *params){
|
||||
return 8;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO stats_Natives[] = {
|
||||
{ "get_stats", get_stats},
|
||||
{ "get_stats2", get_stats2},
|
||||
{ "get_statsnum", get_statsnum},
|
||||
{ "get_user_astats", get_user_astats },
|
||||
{ "get_user_rstats", get_user_rstats },
|
||||
{ "get_user_lstats", get_user_rstats }, // for backward compatibility
|
||||
{ "get_user_stats", get_user_stats },
|
||||
{ "get_user_stats2", get_user_stats2 },
|
||||
{ "get_user_vstats", get_user_vstats },
|
||||
{ "get_user_wrstats", get_user_wrstats}, // DEC-Weapon(Round) Stats
|
||||
{ "get_user_wstats", get_user_wstats},
|
||||
{ "reset_user_wstats", reset_user_wstats },
|
||||
|
||||
// Custom Weapon Support
|
||||
{ "custom_weapon_add", register_cwpn },
|
||||
{ "custom_weapon_dmg", custom_wpn_dmg },
|
||||
{ "custom_weapon_shot", custom_wpn_shot },
|
||||
|
||||
{ "xmod_get_wpnname", get_wpnname },
|
||||
{ "xmod_get_wpnlogname", get_wpnlogname },
|
||||
{ "xmod_is_melee_wpn", is_melee },
|
||||
{ "xmod_get_maxweapons", get_maxweapons },
|
||||
{ "xmod_get_stats_size", get_stats_size },
|
||||
|
||||
//***************************************
|
||||
//{ "get_weaponname", get_wpnname },
|
||||
|
||||
///*******************
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
152
dlls/cstrike/csx/rank.h
Executable file
152
dlls/cstrike/csx/rank.h
Executable file
@ -0,0 +1,152 @@
|
||||
#ifndef RANK_H
|
||||
#define RANK_H
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CMisc.h"
|
||||
#include "CRank.h"
|
||||
|
||||
#define GET_PLAYER_POINTER(e) (&players[ENTINDEX(e)])
|
||||
#define GET_PLAYER_POINTER_I(i) (&players[i])
|
||||
|
||||
extern AMX_NATIVE_INFO stats_Natives[];
|
||||
|
||||
struct weaponsVault {
|
||||
char name[32];
|
||||
char logname[16];
|
||||
short int ammoSlot;
|
||||
bool used;
|
||||
bool melee;
|
||||
};
|
||||
|
||||
extern bool rankBots;
|
||||
extern cvar_t* csstats_rankbots;
|
||||
extern cvar_t* csstats_pause;
|
||||
|
||||
extern int iFGrenade;
|
||||
extern int iFDeath;
|
||||
extern int iFDamage;
|
||||
|
||||
extern int iFBPlanted;
|
||||
extern int iFBDefused;
|
||||
extern int iFBPlanting;
|
||||
extern int iFBDefusing;
|
||||
extern int iFBExplode;
|
||||
|
||||
extern int g_bombAnnounce;
|
||||
extern int g_Planter;
|
||||
extern int g_Defuser;
|
||||
|
||||
#define BOMB_PLANTING 1
|
||||
#define BOMB_PLANTED 2
|
||||
#define BOMB_EXPLODE 3
|
||||
#define BOMB_DEFUSING 4
|
||||
#define BOMB_DEFUSED 5
|
||||
|
||||
extern weaponsVault weaponData[MAX_WEAPONS+MAX_CWEAPONS];
|
||||
|
||||
typedef void (*funEventCall)(void*);
|
||||
extern funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||
extern funEventCall modMsgs[MAX_REG_MSGS];
|
||||
|
||||
extern void (*function)(void*);
|
||||
extern void (*endfunction)(void*);
|
||||
|
||||
extern cvar_t *csstats_maxsize;
|
||||
extern cvar_t* csstats_rank;
|
||||
extern cvar_t* csstats_reset;
|
||||
|
||||
extern Grenades g_grenades;
|
||||
|
||||
extern RankSystem g_rank;
|
||||
|
||||
extern CPlayer players[33];
|
||||
|
||||
extern CPlayer* mPlayer;
|
||||
|
||||
extern int mPlayerIndex;
|
||||
|
||||
extern int mState;
|
||||
|
||||
extern int gmsgCurWeapon;
|
||||
extern int gmsgDamageEnd;
|
||||
extern int gmsgDamage;
|
||||
extern int gmsgWeaponList;
|
||||
extern int gmsgResetHUD;
|
||||
extern int gmsgAmmoX;
|
||||
extern int gmsgScoreInfo;
|
||||
extern int gmsgAmmoPickup;
|
||||
|
||||
extern int gmsgSendAudio;
|
||||
extern int gmsgTextMsg;
|
||||
extern int gmsgBarTime;
|
||||
|
||||
void Client_AmmoX(void*);
|
||||
void Client_CurWeapon(void*);
|
||||
void Client_Damage(void*);
|
||||
void Client_WeaponList(void*);
|
||||
void Client_AmmoPickup(void*);
|
||||
void Client_Damage_End(void*);
|
||||
void Client_ScoreInfo(void*);
|
||||
void Client_ResetHUD(void*);
|
||||
void Client_SendAudio(void*);
|
||||
void Client_TextMsg(void*);
|
||||
void Client_BarTime(void*);
|
||||
void Client_DeathMsg(void*);
|
||||
|
||||
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
||||
bool isModuleActive();
|
||||
|
||||
#define CHECK_ENTITY(x) \
|
||||
if (x < 0 || x > gpGlobals->maxEntities) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
|
||||
return 0; \
|
||||
} else { \
|
||||
if (x <= gpGlobals->maxClients) { \
|
||||
if (!MF_IsPlayerIngame(x)) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
|
||||
return 0; \
|
||||
} \
|
||||
} else { \
|
||||
if (x != 0 && FNullEnt(INDEXENT(x))) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
|
||||
return 0; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECK_PLAYER(x) \
|
||||
if (x < 1 || x > gpGlobals->maxClients) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", x); \
|
||||
return 0; \
|
||||
} else { \
|
||||
if (!MF_IsPlayerIngame(x) || FNullEnt(MF_GetPlayerEdict(x))) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", x); \
|
||||
return 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CHECK_PLAYERRANGE(x) \
|
||||
if (x > gpGlobals->maxClients || x < 0) \
|
||||
{ \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", x); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
#define CHECK_NONPLAYER(x) \
|
||||
if (x < 1 || x <= gpGlobals->maxClients || x > gpGlobals->maxEntities) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Non-player entity %d out of range", x); \
|
||||
return 0; \
|
||||
} else { \
|
||||
if (FNullEnt(INDEXENT(x))) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid non-player entity %d", x); \
|
||||
return 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define GETEDICT(n) \
|
||||
((n >= 1 && n <= gpGlobals->maxClients) ? MF_GetPlayerEdict(n) : INDEXENT(n))
|
||||
|
||||
#endif // RANK_H
|
||||
|
||||
|
||||
|
3119
dlls/cstrike/csx/sdk/amxxmodule.cpp
Executable file
3119
dlls/cstrike/csx/sdk/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2454
dlls/cstrike/csx/sdk/amxxmodule.h
Executable file
2454
dlls/cstrike/csx/sdk/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
494
dlls/cstrike/csx/sdk/moduleconfig.h
Executable file
494
dlls/cstrike/csx/sdk/moduleconfig.h
Executable file
@ -0,0 +1,494 @@
|
||||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
#include "svn_version.h"
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CSX"
|
||||
#define MODULE_VERSION SVN_VERSION
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org/"
|
||||
#define MODULE_LOGTAG "CSX"
|
||||
#define MODULE_LIBRARY "csx"
|
||||
#define MODULE_LIBCLASS "xstats"
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Unknown"
|
||||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
#define USE_METAMOD
|
||||
|
||||
// use memory manager/tester?
|
||||
// note that if you use this, you cannot construct/allocate
|
||||
// anything before the module attached (OnAmxxAttach).
|
||||
// be careful of default constructors using new/malloc!
|
||||
// #define MEMORY_TEST
|
||||
|
||||
// Unless you use STL or exceptions, keep this commented.
|
||||
// It allows you to compile without libstdc++.so as a dependency
|
||||
// #define NO_ALLOC_OVERRIDES
|
||||
|
||||
// Uncomment this if you are using MSVC8 or greater and want to fix some of the compatibility issues yourself
|
||||
// #define NO_MSVC8_AUTO_COMPAT
|
||||
|
||||
/**
|
||||
* AMXX Init functions
|
||||
* Also consider using FN_META_*
|
||||
*/
|
||||
|
||||
/** AMXX query */
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
|
||||
/** AMXX attach
|
||||
* Do native functions init here (MF_AddNatives)
|
||||
*/
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
|
||||
/** AMXX Detach (unload) */
|
||||
#define FN_AMXX_DETACH OnAmxxDetach
|
||||
|
||||
/** All plugins loaded
|
||||
* Do forward functions init here (MF_RegisterForward)
|
||||
*/
|
||||
#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/** All plugins are about to be unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading
|
||||
|
||||
/** All plugins are now unloaded */
|
||||
//#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded
|
||||
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
#define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
#define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
#define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
#define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
#define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
#define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
#define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
#define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
#define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
#define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
#define FN_MessageBegin_Post MessageBegin_Post
|
||||
#define FN_MessageEnd_Post MessageEnd_Post
|
||||
#define FN_WriteByte_Post WriteByte_Post
|
||||
#define FN_WriteChar_Post WriteChar_Post
|
||||
#define FN_WriteShort_Post WriteShort_Post
|
||||
#define FN_WriteLong_Post WriteLong_Post
|
||||
#define FN_WriteAngle_Post WriteAngle_Post
|
||||
#define FN_WriteCoord_Post WriteCoord_Post
|
||||
#define FN_WriteString_Post WriteString_Post
|
||||
#define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
#define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
9
dlls/cstrike/csx/sdk/svn_version.h
Normal file
9
dlls/cstrike/csx/sdk/svn_version.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef _INCLUDE_SVN_VERSION_H_
|
||||
#define _INCLUDE_SVN_VERSION_H_
|
||||
|
||||
/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */
|
||||
/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */
|
||||
|
||||
#define SVN_VERSION "1.8.0.3186"
|
||||
|
||||
#endif //_INCLUDE_SVN_VERSION_H_
|
9
dlls/cstrike/csx/sdk/svn_version.tpl
Normal file
9
dlls/cstrike/csx/sdk/svn_version.tpl
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef _INCLUDE_SVN_VERSION_H_
|
||||
#define _INCLUDE_SVN_VERSION_H_
|
||||
|
||||
/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */
|
||||
/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */
|
||||
|
||||
#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$"
|
||||
|
||||
#endif //_INCLUDE_SVN_VERSION_H_
|
257
dlls/cstrike/csx/usermsg.cpp
Executable file
257
dlls/cstrike/csx/usermsg.cpp
Executable file
@ -0,0 +1,257 @@
|
||||
#include "amxxmodule.h"
|
||||
#include "rank.h"
|
||||
|
||||
weaponsVault weaponData[MAX_WEAPONS+MAX_CWEAPONS];
|
||||
|
||||
int damage;
|
||||
int TA;
|
||||
int weapon;
|
||||
int aim;
|
||||
bool ignore;
|
||||
CPlayer *pAttacker;
|
||||
|
||||
|
||||
void Client_ResetHUD(void* mValue){
|
||||
if ( mPlayer ){
|
||||
mPlayer->clearStats = gpGlobals->time + 0.25f;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_DeathMsg(void *mValue)
|
||||
{
|
||||
static int killer_id;
|
||||
static int victim_id;
|
||||
static int is_headshot;
|
||||
const char *name;
|
||||
|
||||
switch (mState++)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
killer_id = *(int *)mValue;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
victim_id = *(int *)mValue;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
is_headshot = *(int *)mValue;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = (const char *)mValue;
|
||||
if (killer_id
|
||||
&& (strcmp(name, "knife") == 0))
|
||||
{
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(killer_id);
|
||||
pPlayer->aiming = is_headshot ? 1 : 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client_WeaponList(void* mValue){
|
||||
static int wpnList;
|
||||
static int iSlot;
|
||||
static const char* wpnName;
|
||||
|
||||
switch (mState++) {
|
||||
case 0:
|
||||
wpnName = (const char*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
iSlot = *(int*)mValue;
|
||||
break;
|
||||
case 7:
|
||||
int iId = *(int*)mValue;
|
||||
if ( (iId < 0 || iId >= MAX_WEAPONS ) || ( wpnList & (1<<iId) ) )
|
||||
break;
|
||||
|
||||
wpnList |= (1<<iId);
|
||||
weaponData[iId].ammoSlot = iSlot;
|
||||
|
||||
if ( strstr( wpnName,"weapon_") )
|
||||
{
|
||||
if ( strcmp(wpnName+7,"hegrenade") == 0 )
|
||||
strcpy(weaponData[iId].name,wpnName+9);
|
||||
else
|
||||
strcpy(weaponData[iId].name,wpnName+7);
|
||||
strcpy(weaponData[iId].logname,weaponData[iId].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client_Damage(void* mValue){
|
||||
static int bits;
|
||||
switch (mState++) {
|
||||
case 1:
|
||||
ignore = false;
|
||||
damage = *(int*)mValue;
|
||||
break;
|
||||
case 2:
|
||||
bits = *(int*)mValue;
|
||||
break;
|
||||
case 3:
|
||||
if (!mPlayer || !damage || bits){
|
||||
ignore = true;
|
||||
break;
|
||||
}
|
||||
|
||||
edict_t *enemy;
|
||||
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
||||
|
||||
if ( FNullEnt( enemy ) ){
|
||||
ignore = true;
|
||||
break;
|
||||
}
|
||||
|
||||
aim = 0;
|
||||
weapon = 0;
|
||||
pAttacker = NULL;
|
||||
|
||||
if (enemy->v.flags & (FL_CLIENT | FL_FAKECLIENT) ) {
|
||||
pAttacker = GET_PLAYER_POINTER(enemy);
|
||||
aim = pAttacker->aiming;
|
||||
weapon = pAttacker->current;
|
||||
pAttacker->saveHit( mPlayer , weapon , damage, aim);
|
||||
break;
|
||||
}
|
||||
if( g_grenades.find(enemy , &pAttacker , &weapon ) )
|
||||
pAttacker->saveHit( mPlayer , weapon , damage, aim );
|
||||
else if ( strcmp("grenade",STRING(enemy->v.classname))==0 ) // ? more checks ?
|
||||
weapon = CSW_C4;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_Damage_End(void* mValue){
|
||||
if ( ignore )
|
||||
return;
|
||||
|
||||
if ( !pAttacker ) pAttacker = mPlayer;
|
||||
TA = 0;
|
||||
if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) )
|
||||
TA = 1;
|
||||
|
||||
MF_ExecuteForward( iFDamage, static_cast<cell>(pAttacker->index) , static_cast<cell>(mPlayer->index) ,
|
||||
static_cast<cell>(damage), static_cast<cell>(weapon), static_cast<cell>(aim), static_cast<cell>(TA) );
|
||||
|
||||
if ( !mPlayer->IsAlive() ){
|
||||
if ( weapon != CSW_C4 )
|
||||
pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TA);
|
||||
MF_ExecuteForward( iFDeath, static_cast<cell>(pAttacker->index), static_cast<cell>(mPlayer->index),
|
||||
static_cast<cell>(weapon), static_cast<cell>(aim), static_cast<cell>(TA) );
|
||||
}
|
||||
}
|
||||
|
||||
void Client_CurWeapon(void* mValue){
|
||||
static int iState;
|
||||
static int iId;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
iState = *(int*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
if (!iState) break;
|
||||
iId = *(int*)mValue;
|
||||
break;
|
||||
case 2:
|
||||
if (!mPlayer || !iState ) break;
|
||||
int iClip = *(int*)mValue;
|
||||
if ((iClip > -1) && (iClip < mPlayer->weapons[iId].clip))
|
||||
mPlayer->saveShot(iId);
|
||||
mPlayer->weapons[iId].clip = iClip;
|
||||
mPlayer->current = iId;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_AmmoX(void* mValue){
|
||||
static int iAmmo;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
iAmmo = *(int*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
if (!mPlayer ) break;
|
||||
for(int i = 1; i < MAX_WEAPONS ; ++i)
|
||||
if (iAmmo == weaponData[i].ammoSlot)
|
||||
mPlayer->weapons[i].ammo = *(int*)mValue;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_AmmoPickup(void* mValue){
|
||||
static int iSlot;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
iSlot = *(int*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
if (!mPlayer ) break;
|
||||
for(int i = 1; i < MAX_WEAPONS ; ++i)
|
||||
if (weaponData[i].ammoSlot == iSlot)
|
||||
mPlayer->weapons[i].ammo += *(int*)mValue;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_ScoreInfo(void* mValue){
|
||||
static int index;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
index = *(int*)mValue;
|
||||
break;
|
||||
case 4:
|
||||
if ( index > 0 && index <= gpGlobals->maxClients )
|
||||
GET_PLAYER_POINTER_I( index )->teamId = *(int*)mValue;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_SendAudio(void* mValue){
|
||||
static const char* szText;
|
||||
if ( mState == 1 ){
|
||||
szText = (const char*)mValue;
|
||||
if ( !mPlayer && szText[7]=='B' ) {
|
||||
if ( szText[11]=='P' && g_Planter ){
|
||||
GET_PLAYER_POINTER_I(g_Planter)->saveBPlant();
|
||||
g_bombAnnounce = BOMB_PLANTED;
|
||||
}
|
||||
else if ( szText[11]=='D' && g_Defuser ){
|
||||
GET_PLAYER_POINTER_I(g_Defuser)->saveBDefused();
|
||||
g_bombAnnounce = BOMB_DEFUSED;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
mState++;
|
||||
}
|
||||
|
||||
void Client_TextMsg(void* mValue){
|
||||
static const char* szText;
|
||||
if ( !mPlayer && mState==1 ){
|
||||
szText = (const char*)mValue;
|
||||
if ( szText[1]=='T' && szText[8]=='B' && g_Planter ){
|
||||
GET_PLAYER_POINTER_I(g_Planter)->saveBExplode();
|
||||
g_bombAnnounce = BOMB_EXPLODE;
|
||||
}
|
||||
}
|
||||
mState++;
|
||||
}
|
||||
|
||||
void Client_BarTime(void* mValue){
|
||||
int iTime = *(int*)mValue;
|
||||
if ( !iTime || !mPlayer->IsAlive() ) return;
|
||||
if ( iTime == 3 ){
|
||||
g_Planter = mPlayerIndex;
|
||||
g_bombAnnounce = BOMB_PLANTING;
|
||||
g_Defuser = 0;
|
||||
}
|
||||
else {
|
||||
mPlayer->saveBDefusing();
|
||||
g_Defuser = mPlayerIndex;
|
||||
g_bombAnnounce = BOMB_DEFUSING;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user