hello FF world

- had to move HL2DM VPC stuff INTO ff server vpc so we can start (re)moving
nonspecific code as it is implemented
This commit is contained in:
Dexter Haslem 2013-09-14 22:44:17 -06:00
parent 858bd9d3f5
commit e287b1516a
5 changed files with 560 additions and 4 deletions

View file

@ -0,0 +1,201 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
/*
===== tf_client.cpp ========================================================
HL2 client/server game specific stuff
*/
#include "cbase.h"
#include "hl2mp_player.h"
//#include "hl2mp_gamerules.h"
#include "gamerules.h"
#include "teamplay_gamerules.h"
#include "entitylist.h"
#include "physics.h"
#include "game.h"
#include "player_resource.h"
#include "engine/IEngineSound.h"
#include "team.h"
#include "viewport_panel_names.h"
#include "tier0/vprof.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
void Host_Say( edict_t *pEdict, bool teamonly );
ConVar sv_motd_unload_on_dismissal( "sv_motd_unload_on_dismissal", "0", 0, "If enabled, the MOTD contents will be unloaded when the player closes the MOTD." );
extern CBaseEntity* FindPickerEntityClass( CBasePlayer *pPlayer, char *classname );
extern bool g_fGameOver;
void FinishClientPutInServer( CHL2MP_Player *pPlayer )
{
pPlayer->InitialSpawn();
pPlayer->Spawn();
char sName[128];
Q_strncpy( sName, pPlayer->GetPlayerName(), sizeof( sName ) );
// First parse the name and remove any %'s
for ( char *pApersand = sName; pApersand != NULL && *pApersand != 0; pApersand++ )
{
// Replace it with a space
if ( *pApersand == '%' )
*pApersand = ' ';
}
// notify other clients of player joining the game
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, "#Game_connected", sName[0] != 0 ? sName : "<unconnected>" );
if ( HL2MPRules()->IsTeamplay() == true )
{
ClientPrint( pPlayer, HUD_PRINTTALK, "You are on team %s1\n", pPlayer->GetTeam()->GetName() );
}
const ConVar *hostname = cvar->FindVar( "hostname" );
const char *title = (hostname) ? hostname->GetString() : "MESSAGE OF THE DAY";
KeyValues *data = new KeyValues("data");
data->SetString( "title", title ); // info panel title
data->SetString( "type", "1" ); // show userdata from stringtable entry
data->SetString( "msg", "motd" ); // use this stringtable entry
data->SetBool( "unload", sv_motd_unload_on_dismissal.GetBool() );
pPlayer->ShowViewPortPanel( PANEL_INFO, true, data );
data->deleteThis();
}
/*
===========
ClientPutInServer
called each time a player is spawned into the game
============
*/
void ClientPutInServer( edict_t *pEdict, const char *playername )
{
// Allocate a CBaseTFPlayer for pev, and call spawn
CHL2MP_Player *pPlayer = CHL2MP_Player::CreatePlayer( "player", pEdict );
pPlayer->SetPlayerName( playername );
}
void ClientActive( edict_t *pEdict, bool bLoadGame )
{
// Can't load games in CS!
Assert( !bLoadGame );
CHL2MP_Player *pPlayer = ToHL2MPPlayer( CBaseEntity::Instance( pEdict ) );
FinishClientPutInServer( pPlayer );
}
/*
===============
const char *GetGameDescription()
Returns the descriptive name of this .dll. E.g., Half-Life, or Team Fortress 2
===============
*/
const char *GetGameDescription()
{
if ( g_pGameRules ) // this function may be called before the world has spawned, and the game rules initialized
return g_pGameRules->GetGameDescription();
else
return "Fortress Forever";
}
//-----------------------------------------------------------------------------
// Purpose: Given a player and optional name returns the entity of that
// classname that the player is nearest facing
//
// Input :
// Output :
//-----------------------------------------------------------------------------
CBaseEntity* FindEntity( edict_t *pEdict, char *classname)
{
// If no name was given set bits based on the picked
if (FStrEq(classname,""))
{
return (FindPickerEntityClass( static_cast<CBasePlayer*>(GetContainingEntity(pEdict)), classname ));
}
return NULL;
}
//-----------------------------------------------------------------------------
// Purpose: Precache game-specific models & sounds
//-----------------------------------------------------------------------------
void ClientGamePrecache( void )
{
CBaseEntity::PrecacheModel("models/player.mdl");
CBaseEntity::PrecacheModel( "models/gibs/agibs.mdl" );
CBaseEntity::PrecacheModel ("models/weapons/v_hands.mdl");
CBaseEntity::PrecacheScriptSound( "HUDQuickInfo.LowAmmo" );
CBaseEntity::PrecacheScriptSound( "HUDQuickInfo.LowHealth" );
CBaseEntity::PrecacheScriptSound( "FX_AntlionImpact.ShellImpact" );
CBaseEntity::PrecacheScriptSound( "Missile.ShotDown" );
CBaseEntity::PrecacheScriptSound( "Bullets.DefaultNearmiss" );
CBaseEntity::PrecacheScriptSound( "Bullets.GunshipNearmiss" );
CBaseEntity::PrecacheScriptSound( "Bullets.StriderNearmiss" );
CBaseEntity::PrecacheScriptSound( "Geiger.BeepHigh" );
CBaseEntity::PrecacheScriptSound( "Geiger.BeepLow" );
}
// called by ClientKill and DeadThink
void respawn( CBaseEntity *pEdict, bool fCopyCorpse )
{
CHL2MP_Player *pPlayer = ToHL2MPPlayer( pEdict );
if ( pPlayer )
{
if ( gpGlobals->curtime > pPlayer->GetDeathTime() + DEATH_ANIMATION_TIME )
{
// respawn player
pPlayer->Spawn();
}
else
{
pPlayer->SetNextThink( gpGlobals->curtime + 0.1f );
}
}
}
void GameStartFrame( void )
{
VPROF("GameStartFrame()");
if ( g_fGameOver )
return;
gpGlobals->teamplay = (teamplay.GetInt() != 0);
#ifdef DEBUG
extern void Bot_RunAll();
Bot_RunAll();
#endif
}
//=========================================================
// instantiate the proper game rules object
//=========================================================
void InstallGameRules()
{
// vanilla deathmatch
CreateGameRulesObject( "CHL2MPRules" );
}

View file

@ -0,0 +1,34 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "gameinterface.h"
#include "mapentities.h"
#include "hl2mp_gameinterface.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
// -------------------------------------------------------------------------------------------- //
// Mod-specific CServerGameClients implementation.
// -------------------------------------------------------------------------------------------- //
void CServerGameClients::GetPlayerLimits( int& minplayers, int& maxplayers, int &defaultMaxPlayers ) const
{
minplayers = 2;
maxplayers = MAX_PLAYERS; // TODO: currently 33
defaultMaxPlayers = 16;
}
// -------------------------------------------------------------------------------------------- //
// Mod-specific CServerGameDLL implementation.
// -------------------------------------------------------------------------------------------- //
void CServerGameDLL::LevelInit_ParseAllEntities( const char *pMapEntities )
{
// TODO: FF map entity parse for stuff to keep around after reset
}

View file

@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////
// includes
#include "cbase.h"
//#include "ff_scriptman.h"
//#include "ff_entity_system.h"
//#include "ff_luacontext.h"
//#include "ff_lualib.h"
//#include "ff_utils.h"
//#include "ff_item_flag.h"
#include "triggers.h"
// engine
#include "filesystem.h"
// lua
//extern "C"
//{
// #include "lua.h"
// #include "lualib.h"
// #include "lauxlib.h"
//}
//
//#undef MINMAX_H
//#undef min
//#undef max
//
//// luabind
//#include "luabind/luabind.hpp"
//#include "luabind/object.hpp"
//#include "luabind/iterator_policy.hpp"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

View file

@ -0,0 +1,8 @@
#ifndef FF_SCRIPTMAN_H
#define FF_SCRIPTMAN_H
////
/////////////////////////////////////////////////////////////////////////////
#endif

View file

@ -8,7 +8,7 @@ $Macro SRCDIR "..\.."
$Macro GAMENAME "ff" [!$SOURCESDK]
$Macro GAMENAME "FortressForever" [$SOURCESDK]
$Include "$SRCDIR\game\server\server_hl2mp.vpc"
$Include "$SRCDIR\game\server\server_base.vpc"
$Include "$SRCDIR\game\server\nav_mesh.vpc" [$SOURCESDK]
$macro VSLIBDIR "." [!$VS2010]
@ -20,6 +20,10 @@ $Configuration
{
$AdditionalIncludeDirectories "$BASE;$SRCDIR\game\shared\ff,.\ff,.\ff,$SRCDIR\game\shared\ff"
$PreprocessorDefinitions "$BASE;FF;FF_DLL"
// HL2DM SDK specific stuff (remove once all FF stuff implemented)
$AdditionalIncludeDirectories "$BASE;$SRCDIR\game\shared\hl2,.\hl2,.\hl2mp,$SRCDIR\game\shared\hl2mp"
$PreprocessorDefinitions "$BASE;HL2MP;HL2_DLL"
}
}
@ -29,12 +33,287 @@ $Project "Server (FF)"
{
$Folder "FF"
{
$File "FF\ff_client.cpp"
$File "FF\ff_gameinterface.cpp"
$File "FF\ff_scriptman.cpp"
$File "FF\ff_scriptman.h"
}
$Folder "Link Libraries"
{
//$Folder "Link Libraries"
//{
//}
// HL2DM sdk code, remove files as FF classes are implemented
$Folder "HL2MP"
{
$File "hl2mp\hl2mp_bot_temp.cpp"
$File "hl2mp\hl2mp_bot_temp.h"
//$File "hl2mp\hl2mp_client.cpp"
$File "hl2mp\hl2mp_cvars.cpp"
//$File "hl2mp\hl2mp_gameinterface.cpp"
$File "hl2mp\hl2mp_gameinterface.h"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_gamerules.cpp"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_gamerules.h"
$File "hl2mp\hl2mp_player.cpp"
$File "hl2mp\hl2mp_player.h"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_player_shared.cpp"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_player_shared.h"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_weapon_parse.cpp"
$File "$SRCDIR\game\shared\hl2mp\hl2mp_weapon_parse.h"
$Folder "Weapons"
{
$File "hl2mp\grenade_satchel.cpp"
$File "hl2mp\grenade_satchel.h"
$File "hl2mp\grenade_tripmine.cpp"
$File "hl2mp\grenade_tripmine.h"
$File "hl2mp\te_hl2mp_shotgun_shot.cpp"
$File "hl2mp\te_hl2mp_shotgun_shot.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_357.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_ar2.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_ar2.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_crossbow.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_crowbar.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_frag.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase_machinegun.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbase_machinegun.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasebasebludgeon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasehlmpcombatweapon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_hl2mpbasehlmpcombatweapon.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_physcannon.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_physcannon.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_pistol.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_rpg.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_rpg.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_shotgun.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_slam.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_slam.h"
$File "$SRCDIR\game\shared\hl2mp\weapon_smg1.cpp"
$File "$SRCDIR\game\shared\hl2mp\weapon_stunstick.cpp"
}
}
////////////////////////////////////////////////////////////////////////////////////
// HL2 base shit below, ignore
$File "ai_relationship.cpp"
$File "basegrenade_concussion.cpp"
$File "basegrenade_contact.cpp"
$File "basegrenade_timed.cpp"
$File "EntityFlame.h"
$File "hl2\Func_Monitor.cpp"
$File "grenadethrown.cpp"
$File "grenadethrown.h"
$File "h_cycler.cpp"
$File "h_cycler.h"
$File "monstermaker.cpp"
$File "monstermaker.h"
$File "physics_bone_follower.h"
$File "$SRCDIR\game\shared\predicted_viewmodel.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.h"
$File "$SRCDIR\game\shared\ragdoll_shared.h"
$File "$SRCDIR\game\shared\solidsetdefaults.h"
$File "$SRCDIR\game\shared\hl2\survival_gamerules.cpp"
$File "team_objectiveresource.cpp"
$File "team_objectiveresource.h"
$File "team_spawnpoint.cpp"
$File "team_spawnpoint.h"
$File "team_control_point.cpp"
$File "team_control_point.h"
$File "team_control_point_master.cpp"
$File "team_control_point_master.h"
$File "team_control_point_round.cpp"
$File "team_control_point_round.h"
$File "team_train_watcher.cpp"
$File "team_train_watcher.h"
$File "$SRCDIR\game\shared\teamplayroundbased_gamerules.cpp"
$File "$SRCDIR\game\shared\touchlink.h"
$File "trigger_area_capture.cpp"
$File "trigger_area_capture.h"
$File "$SRCDIR\game\shared\teamplay_round_timer.cpp"
$File "$SRCDIR\game\shared\teamplay_round_timer.h"
$Folder "HL2 DLL"
{
$File "hl2\ai_allymanager.cpp"
$File "hl2\ai_behavior_actbusy.cpp"
$File "hl2\ai_behavior_actbusy.h"
$File "hl2\ai_behavior_functank.cpp"
$File "hl2\ai_behavior_functank.h"
$File "hl2\ai_behavior_holster.cpp"
$File "hl2\ai_behavior_holster.h"
$File "hl2\ai_behavior_police.cpp"
$File "hl2\ai_behavior_police.h"
$File "hl2\ai_goal_police.cpp"
$File "hl2\ai_goal_police.h"
$File "hl2\ai_interactions.h"
$File "hl2\ai_spotlight.cpp"
$File "hl2\ai_spotlight.h"
$File "hl2\antlion_dust.cpp"
$File "hl2\antlion_dust.h"
$File "hl2\antlion_maker.cpp"
$File "hl2\antlion_maker.h"
$File "hl2\ar2_explosion.cpp"
$File "hl2\ar2_explosion.h"
$File "basebludgeonweapon.cpp"
$File "basebludgeonweapon.h"
$File "hl2\basehlcombatweapon.cpp"
$File "hl2\basehlcombatweapon.h"
$File "$SRCDIR\game\shared\hl2\basehlcombatweapon_shared.cpp"
$File "$SRCDIR\game\shared\hl2\basehlcombatweapon_shared.h"
$File "hl2\cbasehelicopter.cpp"
$File "hl2\cbasehelicopter.h"
$File "hl2\cbasespriteprojectile.cpp"
$File "hl2\cbasespriteprojectile.h"
$File "hl2\citadel_effects.cpp"
$File "$SRCDIR\game\shared\hl2\citadel_effects_shared.h"
$File "hl2\combine_mine.cpp"
$File "hl2\combine_mine.h"
$File "hl2\energy_wave.h"
$File "hl2\env_alyxemp.cpp"
$File "$SRCDIR\game\shared\hl2\env_alyxemp_shared.h"
$File "hl2\env_headcrabcanister.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.h"
$File "hl2\env_speaker.cpp"
$File "hl2\env_starfield.cpp"
$File "hl2\func_recharge.cpp"
$File "hl2\func_tank.cpp"
$File "hl2\func_tank.h"
$File "hl2\grenade_ar2.cpp"
$File "hl2\grenade_ar2.h"
$File "hl2\grenade_bugbait.cpp"
$File "hl2\grenade_bugbait.h"
$File "hl2\grenade_frag.cpp"
$File "hl2\grenade_frag.h"
$File "hl2\hl2_ai_network.cpp"
$File "hl2\hl2_eventlog.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.h"
$File "hl2\hl2_player.cpp"
$File "hl2\hl2_player.h"
$File "$SRCDIR\game\shared\hl2\hl2_player_shared.h"
$File "hl2\hl2_playerlocaldata.cpp"
$File "hl2\hl2_playerlocaldata.h"
$File "$SRCDIR\game\shared\hl2\hl2_shareddefs.h"
$File "hl2\hl2_triggers.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_usermessages.cpp"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.cpp"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.h"
$File "$SRCDIR\game\shared\hl2\hl_movedata.h"
$File "hl2\hl_playermove.cpp"
$File "hl2\info_teleporter_countdown.cpp"
$File "hl2\item_ammo.cpp"
$File "hl2\item_battery.cpp"
$File "hl2\item_dynamic_resupply.cpp"
$File "hl2\item_dynamic_resupply.h"
$File "hl2\item_healthkit.cpp"
$File "hl2\item_itemcrate.cpp"
$File "hl2\item_suit.cpp"
$File "hl2\look_door.cpp"
$File "hl2\monster_dummy.cpp"
$File "hl2\npc_alyx.cpp"
$File "hl2\npc_alyx.h"
$File "hl2\npc_antlion.cpp"
$File "hl2\npc_antlion.h"
$File "hl2\npc_antlionguard.cpp"
$File "hl2\npc_apcdriver.cpp"
$File "hl2\npc_attackchopper.cpp"
$File "hl2\npc_attackchopper.h"
$File "hl2\npc_barnacle.cpp"
$File "hl2\npc_barnacle.h"
$File "hl2\npc_barney.cpp"
$File "hl2\npc_basescanner.cpp"
$File "hl2\npc_basescanner.h"
$File "hl2\npc_BaseZombie.cpp"
$File "hl2\npc_BaseZombie.h"
$File "hl2\npc_breen.cpp"
$File "hl2\npc_bullseye.cpp"
$File "hl2\npc_bullseye.h"
$File "hl2\npc_citizen17.cpp"
$File "hl2\npc_citizen17.h"
$File "hl2\npc_combine.cpp"
$File "hl2\npc_combine.h"
$File "hl2\npc_combinecamera.cpp"
$File "hl2\npc_combinedropship.cpp"
$File "hl2\npc_combinegunship.cpp"
$File "hl2\npc_combines.cpp"
$File "hl2\npc_combines.h"
$File "hl2\npc_cranedriver.cpp"
$File "hl2\npc_crow.cpp"
$File "hl2\npc_crow.h"
$File "hl2\npc_dog.cpp"
$File "hl2\npc_eli.cpp"
$File "hl2\npc_enemyfinder.cpp"
$File "hl2\npc_fisherman.cpp"
$File "hl2\npc_gman.cpp"
$File "hl2\npc_headcrab.cpp"
$File "hl2\npc_headcrab.h"
$File "hl2\npc_ichthyosaur.cpp"
$File "hl2\npc_kleiner.cpp"
$File "hl2\npc_launcher.cpp"
$File "hl2\npc_manhack.cpp"
$File "hl2\npc_manhack.h"
$File "hl2\npc_metropolice.cpp"
$File "hl2\npc_metropolice.h"
$File "hl2\npc_monk.cpp"
$File "hl2\npc_mossman.cpp"
$File "hl2\npc_playercompanion.cpp"
$File "hl2\npc_playercompanion.h"
$File "hl2\npc_PoisonZombie.cpp"
$File "hl2\npc_rollermine.cpp"
$File "hl2\npc_rollermine.h"
$File "hl2\npc_scanner.cpp"
$File "hl2\npc_stalker.cpp"
$File "hl2\npc_stalker.h"
$File "hl2\npc_strider.cpp"
$File "hl2\npc_strider.h"
$File "npc_talker.cpp"
$File "npc_talker.h"
$File "hl2\npc_turret_ceiling.cpp"
$File "hl2\npc_turret_floor.cpp"
$File "hl2\npc_turret_ground.cpp"
$File "hl2\npc_vortigaunt_episodic.cpp"
$File "hl2\npc_vortigaunt_episodic.h"
$File "hl2\npc_zombie.cpp"
$File "hl2\point_apc_controller.cpp"
$File "hl2\prop_combine_ball.cpp"
$File "hl2\prop_combine_ball.h"
$File "hl2\prop_thumper.cpp"
$File "hl2\proto_sniper.cpp"
$File "hl2\rotorwash.cpp"
$File "hl2\rotorwash.h"
$File "hl2\script_intro.cpp"
$File "hl2\script_intro.h"
$File "$SRCDIR\game\shared\script_intro_shared.cpp"
$File "hl2\vehicle_airboat.cpp"
$File "hl2\vehicle_apc.h"
$File "hl2\vehicle_crane.cpp"
$File "hl2\vehicle_crane.h"
$File "hl2\vehicle_prisoner_pod.cpp"
$File "hl2\vehicle_viewcontroller.cpp"
$File "hl2\weapon_alyxgun.h"
$File "hl2\weapon_annabelle.cpp"
$File "hl2\weapon_bugbait.cpp"
$File "hl2\weapon_crowbar.h"
$File "weapon_cubemap.cpp"
$Folder "unused"
{
$File "hl2\grenade_beam.cpp"
$File "hl2\grenade_beam.h"
$File "hl2\grenade_homer.cpp"
$File "hl2\grenade_homer.h"
$File "hl2\grenade_pathfollower.cpp"
$File "hl2\grenade_pathfollower.h"
$File "hl2\npc_missiledefense.cpp"
$File "hl2\vehicle_apc.cpp"
$File "hl2\weapon_cguard.cpp"
$File "hl2\weapon_flaregun.cpp"
$File "hl2\weapon_flaregun.h"
}
}
}
}