2016-12-01 17:50:48 +00:00
|
|
|
/*
|
|
|
|
OpenCS Project
|
|
|
|
Copyright (C) 2015 Marco "eukara" Hladik
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ClientKill( void ) {}
|
|
|
|
|
|
|
|
|
|
|
|
void ClientConnect( void ) {}
|
|
|
|
|
|
|
|
void ClientDisconnect( void ) {
|
|
|
|
// We were part of the session
|
2016-12-04 14:04:30 +00:00
|
|
|
if( self.iInGame == TRUE ) {
|
|
|
|
if ( self.team == TEAM_T ) {
|
2016-12-05 18:06:24 +00:00
|
|
|
if ( self.health > 0 ) {
|
|
|
|
iAlivePlayers_T--;
|
|
|
|
}
|
2016-12-04 14:04:30 +00:00
|
|
|
} else if ( self.team == TEAM_CT ) {
|
2016-12-05 18:06:24 +00:00
|
|
|
if ( self.health > 0 ) {
|
|
|
|
iAlivePlayers_CT--;
|
|
|
|
}
|
2016-12-04 14:04:30 +00:00
|
|
|
}
|
2016-12-01 17:50:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PlayerPreThink( void ) {
|
|
|
|
Input_Handle();
|
|
|
|
}
|
|
|
|
|
2016-12-02 23:12:10 +00:00
|
|
|
void PlayerPostThink( void ) {
|
|
|
|
|
|
|
|
}
|
2016-12-01 17:50:48 +00:00
|
|
|
|
|
|
|
void PutClientInServer( void ) {
|
|
|
|
entity eSpawn;
|
|
|
|
eSpawn = find (world, classname, "trigger_camera");
|
2016-12-04 14:04:30 +00:00
|
|
|
|
2016-12-01 17:50:48 +00:00
|
|
|
self.origin = eSpawn.origin + '0 0 1';
|
|
|
|
|
|
|
|
// Rotate camera towards a target
|
|
|
|
if( eSpawn.target ) {
|
|
|
|
entity eTarget = find( eTarget, targetname, eSpawn.target );
|
|
|
|
self.angles = vectoangles( eTarget.origin - eSpawn.origin );
|
|
|
|
self.angles_x *= -1;
|
|
|
|
} else {
|
|
|
|
self.angles = eSpawn.angles;
|
|
|
|
}
|
|
|
|
|
|
|
|
self.fixangle = TRUE;
|
2016-12-04 14:04:30 +00:00
|
|
|
self.classname = "spectator";
|
|
|
|
Spawn_MakeSpectator();
|
2016-12-01 17:50:48 +00:00
|
|
|
|
2016-12-04 14:04:30 +00:00
|
|
|
// Because we don't want to reset these when we die
|
|
|
|
self.fMoney = cvar( "mp_startmoney" );
|
2016-12-01 17:50:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SV_RunClientCommand( void ) {
|
|
|
|
|
2016-12-03 15:17:55 +00:00
|
|
|
// The individual zones will just override this behavior
|
2016-12-01 17:50:48 +00:00
|
|
|
self.fInBombZone = FALSE;
|
|
|
|
self.fInBuyZone = FALSE;
|
|
|
|
self.fInHostageZone = FALSE;
|
|
|
|
|
2016-12-04 14:04:30 +00:00
|
|
|
if( fGameState == GAME_FREEZE && self.team != 0 ) {
|
2016-12-01 17:50:48 +00:00
|
|
|
input_movevalues = '0 0 0';
|
|
|
|
input_buttons = 0;
|
|
|
|
input_impulse = 0;
|
|
|
|
}
|
|
|
|
|
2016-12-02 18:45:59 +00:00
|
|
|
Footsteps_Update();
|
2016-12-01 17:50:48 +00:00
|
|
|
runstandardplayerphysics( self );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Client_SendEvent( entity eClient, float fEVType ) {
|
|
|
|
Weapon_UpdateCurrents();
|
|
|
|
|
|
|
|
WriteByte( MSG_MULTICAST, SVC_CGAMEPACKET );
|
|
|
|
WriteByte( MSG_MULTICAST, fEVType );
|
|
|
|
|
|
|
|
msg_entity = eClient;
|
|
|
|
multicast( '0 0 0', MULTICAST_ONE );
|
|
|
|
}
|