Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 02-27-2012, 02:59 AM   #1
beonard6
 
 
 
Join Date: Aug 2010
Reputation: 7
Posts: 28
CTeamplayRoundBasedRules

Scratch SDK 2007:
trying to change baseclass for CSDKGameRules
added REGISTER_GAMERULES_CLASS( CTeamplayRoundBasedRules );
changed class CSDKGameRules : public CTeamplayRoundBasedRules
and DECLARE_CLASS( CSDKGameRules, CTeamplayRoundBasedRules );
but got this:
Code:
LNK2019: unresolved external symbol "public: __thiscall CTeamplayRoundBasedRules::CTeamplayRoundBasedRules(void)" (??0CTeamplayRoundBasedRules@@QAE@XZ) referenced in function "public: __thiscall CSDKGameRules::CSDKGameRules(void)" (??0CSDKGameRules@@QAE@XZ)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "protected: virtual void __thiscall CTeamplayRoundBasedRules::CheckChatText(class CBasePlayer *,char *)" (?CheckChatText@CTeamplayRoundBasedRules@@MAEXPAVCBasePlayer@@PAD@Z)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual void __thiscall CTeamplayRoundBasedRules::HandleTimeLimitChange(void)" (?HandleTimeLimitChange@CTeamplayRoundBasedRules@@UAEXXZ)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual bool __thiscall CTeamplayRoundBasedRules::TimerMayExpire(void)" (?TimerMayExpire@CTeamplayRoundBasedRules@@UAE_NXZ)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual void __thiscall CTeamplayRoundBasedRules::SetWinningTeam(int,int,bool,bool,bool)" (?SetWinningTeam@CTeamplayRoundBasedRules@@UAEXHH_N00@Z)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual void __thiscall CTeamplayRoundBasedRules::SetStalemate(int,bool,bool)" (?SetStalemate@CTeamplayRoundBasedRules@@UAEXH_N0@Z)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual float __thiscall CTeamplayRoundBasedRules::GetNextRespawnWave(int,class CBasePlayer *)" (?GetNextRespawnWave@CTeamplayRoundBasedRules@@UAEMHPAVCBasePlayer@@@Z)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual bool __thiscall CTeamplayRoundBasedRules::HasPassedMinRespawnTime(class CBasePlayer *)" (?HasPassedMinRespawnTime@CTeamplayRoundBasedRules@@UAE_NPAVCBasePlayer@@@Z)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual bool __thiscall CTeamplayRoundBasedRules::RoundCleanupShouldIgnore(class CBaseEntity *)" (?RoundCleanupShouldIgnore@CTeamplayRoundBasedRules@@UAE_NPAVCBaseEntity@@@Z)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual bool __thiscall CTeamplayRoundBasedRules::ShouldCreateEntity(char const *)" (?ShouldCreateEntity@CTeamplayRoundBasedRules@@UAE_NPBD@Z)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual void __thiscall CTeamplayRoundBasedRules::SetSetup(bool)" (?SetSetup@CTeamplayRoundBasedRules@@UAEX_N@Z)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "public: virtual void __thiscall CTeamplayRoundBasedRules::RestartTournament(void)" (?RestartTournament@CTeamplayRoundBasedRules@@UAEXXZ)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "protected: virtual bool __thiscall CTeamplayRoundBasedRules::CheckWinLimit(void)" (?CheckWinLimit@CTeamplayRoundBasedRules@@MAE_NXZ)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "protected: virtual int __thiscall CTeamplayRoundBasedRules::CountActivePlayers(void)" (?CountActivePlayers@CTeamplayRoundBasedRules@@MAEHXZ)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "protected: virtual void __thiscall CTeamplayRoundBasedRules::RoundRespawn(void)" (?RoundRespawn@CTeamplayRoundBasedRules@@MAEXXZ)	sdk_gamerules.obj	Server
LNK2001: unresolved external symbol "protected: virtual void __thiscall CTeamplayRoundBasedRules::CleanUpMap(void)" (?CleanUpMap@CTeamplayRoundBasedRules@@MAEXXZ)	sdk_gamerules.obj	Server
LNK2019: unresolved external symbol "protected: virtual void __thiscall CTeamplayRoundBasedRules::Think(void)" (?Think@CTeamplayRoundBasedRules@@MAEXXZ) referenced in function "public: virtual void __thiscall CSDKGameRules::Think(void)" (?Think@CSDKGameRules@@UAEXXZ)	sdk_gamerules.obj	Server
what am I doing wrong?

Last edited by beonard6: 02-27-2012 at 09:23 AM.
beonard6 is offline  
Reply With Quote
Old 02-27-2012, 08:33 AM   #2
psy_commando
 
Join Date: Jul 2008
Reputation: 1
Posts: 171
you need to include teamplayroundbased_gamerules.cpp in your project.
psy_commando is offline   Reply With Quote
Old 02-28-2012, 05:47 AM   #3
beonard6
 
 
 
Join Date: Aug 2010
Reputation: 7
Posts: 28
k, another problem. no log errors,
but entities, such as func_rotationg, no longer working.
also, something weird happening with poin_viewcontrol
(first time - not working at all, later camera changes with gravity).
also2: Assertion Failed: s_bAbsQueriesValid

Last edited by beonard6: 02-28-2012 at 06:37 AM.
beonard6 is offline   Reply With Quote
Old 03-03-2012, 02:09 PM   #4
Fredrikli
 
Join Date: Sep 2009
Reputation: 0
Posts: 122
may i ask, how did you solve the linking problem?

it'd be of great help to me
thanks!
Fredrikli

Edit: might seem like i ignored phy_command's post, but all files are included in my project

edit2: oh, guess it wasn't included... but now i only have one error:
Code:
1>teamplayroundbased_gamerules.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CTeamTrainWatcher::TimerMayExpire(void)" (?TimerMayExpire@CTeamTrainWatcher@@QAE_NXZ) referenced in function "public: virtual bool __thiscall CTeamplayRoundBasedRules::TimerMayExpire(void)" (?TimerMayExpire@CTeamplayRoundBasedRules@@UAE_NXZ)
1>.\Release_sdk/Server.dll : fatal error LNK1120: 1 unresolved externals
wat

Last edited by Fredrikli: 03-04-2012 at 12:29 PM.
Fredrikli is offline   Reply With Quote
Old 03-04-2012, 09:33 PM   #5
beonard6
 
 
 
Join Date: Aug 2010
Reputation: 7
Posts: 28
@Fredrikli

ver.1/ add team_train_watcher.h and team_train_watcher.cpp to project

ver.2/
Code:
bool CTeamplayRoundBasedRules::TimerMayExpire( void )
{
#ifdef TF2_DLL
	// team_train_watchers can also prevent timer expiring ( overtime )
	CTeamTrainWatcher *pWatcher = dynamic_cast<CTeamTrainWatcher*>( gEntList.FindEntityByClassname( NULL, "team_train_watcher" ) );
	while ( pWatcher )
	{
		if ( !pWatcher->TimerMayExpire() )
		{
			return false;
		}

		pWatcher = dynamic_cast<CTeamTrainWatcher*>( gEntList.FindEntityByClassname( pWatcher, "team_train_watcher" ) );
	}

	return BaseClass::TimerMayExpire();
#endif
	return false;
}
beonard6 is offline   Reply With Quote
Old 03-05-2012, 02:01 AM   #6
Fredrikli
 
Join Date: Sep 2009
Reputation: 0
Posts: 122
Alright: now it compiles fine, but hl2.exe crashes when loading a map.. this is what the debugger says:

Code:
CreateEvent: event 'teamplay_map_time_remaining' not registered.
The thread 'Win32 Thread' (0x1564) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1318) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xa3c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1658) has exited with code 0 (0x0).
First-chance exception at 0x0fad569f in hl2.exe: 0xC0000005: Access violation reading location 0x00000004.
Unhandled exception at 0x77cc15de in hl2.exe: 0xC0000005: Access violation reading location 0x00000004.
First-chance exception at 0x77cb016e in hl2.exe: 0x00000000: Åtgärden har förts.
Unhandled exception at 0x77cc15de in hl2.exe: 0x00000000: Åtgärden har förts.
"åtgärden har s.lutförts" (swe) translates directly "operation has ended"

these error messages is pretty much jibberish to me..

has anyone else run into this problem?
Fredrikli is offline   Reply With Quote
Old 03-12-2012, 07:38 AM   #7
Fredrikli
 
Join Date: Sep 2009
Reputation: 0
Posts: 122
sorry for reviving this, but i've got problems.

I've done exactly as beonard6 has done, and the code compiles fine.
Problem is as i said that the game crashes when i load a map (during "loading resources").

I read this on VDC:
Quote:
A global object on the client is crashing within its constructor; this might be because the interfaces it uses are not initialized before the constructor. If the engine fails to load the mod's client.dll twice, it will load the DLL included in the mod's SteamAppId, creating a GameRules mismatch.

Thus initialisation will also fail when the client's or server's *.dll could not be copied to the /bin directory of your mod so you should also check the validity of your compiler's "output path" and the modify timestamp of your DLL's for debugging.

To fix this, the constructor code should be installed into an initialisation function. Starting a debug session for the mod might show the failure.
and i guess thats the problem i've got.
All the DLLs gets copied and placed in the correct directory, both the Client.dll and the Server.dll. I've also tried debugging but it does not give me any good hints.

How do you install the Constructor code into an initialisation function? and also, which constructor code?

Thanks in advance


Edit:
Code:
---- Host_NewGame ----
Network: IP 85.230.176.244, mode MP, dedicated No, ports 27015 SV / 27005 CL
Spawn Server: Asylum
SOLID_VPHYSICS static prop with no vphysics model! (models/lostcoast/props_monastery/monastery_window001b.mdl)
SOLID_VPHYSICS static prop with no vphysics model! (models/lostcoast/props_monastery/monastery_window001b.mdl)
SOLID_VPHYSICS static prop with no vphysics model! (models/lostcoast/props_monastery/monastery_window001b.mdl)
SOLID_VPHYSICS static prop with no vphysics model! (models/lostcoast/props_monastery/monastery_window001b.mdl)
SOLID_VPHYSICS static prop with no vphysics model! (models/lostcoast/props_monastery/monastery_window001b.mdl)
SOLID_VPHYSICS static prop with no vphysics model! (models/props_foliage/ivy_01.mdl)
exec: couldn't exec skill1.cfg
ConVarRef sk_suitcharger doesn't point to an existing ConVar
Executing listen server config file
CreateEvent: event 'teamplay_map_time_remaining' not registered.
Set Gravity 800.0 (0.250 tolerance)
PrecacheScriptSound 'NPC_CombineS.ElectrocuteScream' failed, no such sound script entry
PrecacheScriptSound 'npc_citizen.die' failed, no such sound script entry
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: Grid::CFs::CEndOfFileException at memory location 0x0018c560..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: Grid::CFs::CEndOfFileException at memory location 0x0018c4b0..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: Grid::CFs::CEndOfFileException at memory location 0x0018c568..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: Grid::CFs::CEndOfFileException at memory location 0x0018c4b8..
PrecacheScriptSound 'Hud.Hint' failed, no such sound script entry
player\edgar.mdl : material "models/player/edgar/german_body" not found.
player\edgar.mdl : material "models/player/edgar/red_body" not found.
player\edgar.mdl : material "models/player/edgar/red_gear" not found.
"materials/.vtf": can't be found on disk
PrecacheScriptSound 'Default.Zoom' failed, no such sound script entry
PrecacheScriptSound 'WeaponFrag.Roll' failed, no such sound script entry
Attempted to create unknown entity type teamplay_map_time_remaining!
Can't init teamplay_map_time_remaining
Created class baseline: 15 classes, 2371 bytes.
32 player server started
'hl2.exe': Loaded 'C:\Program Files (x86)\Steam\crashhandler.dll'
'hl2.exe': Loaded 'C:\Windows\SysWOW64\dhcpcsvc.dll'
'hl2.exe': Loaded 'C:\Windows\SysWOW64\netapi32.dll'
'hl2.exe': Loaded 'C:\Windows\SysWOW64\netutils.dll'
'hl2.exe': Loaded 'C:\Windows\SysWOW64\srvcli.dll'
'hl2.exe': Loaded 'C:\Windows\SysWOW64\wkscli.dll'
'hl2.exe': Unloaded 'C:\Windows\SysWOW64\netapi32.dll'
'hl2.exe': Unloaded 'C:\Windows\SysWOW64\wkscli.dll'
'hl2.exe': Unloaded 'C:\Windows\SysWOW64\srvcli.dll'
'hl2.exe': Unloaded 'C:\Windows\SysWOW64\netutils.dll'
CHTTPRequestCache took 114 milliseconds to initialize
The thread 'CHTTPCacheInitializeThread' (0x14e0) has exited with code 0 (0x0).
gameserver.cpp (112) : Assertion Failed: m_unAppIdServed != k_uAppIdInvalid
hl2.exe has triggered a breakpoint
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x254dfc60..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: common::CConnResetException at memory location 0x1e76fb78..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x254dfc60..
gameserver.cpp (735) : Assertion Failed: m_CMInterface.GetLogonState() == k_ELogonStateNotLoggedOn
hl2.exe has triggered a breakpoint
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x254dfc60..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x254dfc60..
exec: couldn't exec listenserver.cfg
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x0018e368..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x0018e368..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x0018e368..
Node Graph out of Date. Rebuilding...
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x254dfc60..
The thread 'Win32 Thread' (0xe0c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x16cc) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1320) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x16ac) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x608) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xdb0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x16c8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x17ac) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1038) has exited with code 0 (0x0).
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x254dfc60..
First-chance exception at 0x76ebb9bc in hl2.exe: Microsoft C++ exception: `anonymous namespace'::CRequestInProgressException at memory location 0x254dfc60..
The thread 'Win32 Thread' (0x111c) has exited with code 0 (0x0).
First-chance exception at 0x1013569f in hl2.exe: 0xC0000005: Access violation reading location 0x00000004.
Unhandled exception at 0x779515de in hl2.exe: 0xC0000005: Access violation reading location 0x00000004.
First-chance exception at 0x7794016e in hl2.exe: 0x00000000: Åtgärden har förts.
Unhandled exception at 0x779515de in hl2.exe: 0x00000000: Åtgärden har förts.
First-chance exception at 0x7794016e in hl2.exe: 0x00000000: Åtgärden har förts.
Unhandled exception at 0x779515de in hl2.exe: 0x00000000: Åtgärden har förts.
The thread 'Win32 Thread' (0x858) has exited with code 0 (0x0).
First-chance exception at 0x7794016e in hl2.exe: 0x00000000: Åtgärden har förts.
Unhandled exception at 0x779515de in hl2.exe: 0x00000000: Åtgärden har förts.
First-chance exception at 0x7794016e in hl2.exe: 0x00000000: Åtgärden har förts.
Unhandled exception at 0x779515de in hl2.exe: 0x00000000: Åtgärden har förts.
The program '[3620] hl2.exe: Native' has exited with code 0 (0x0).
Thats the entire debug log from when the game is being hosted.

Last edited by Fredrikli: 03-12-2012 at 07:45 AM.
Fredrikli is offline   Reply With Quote
Old 03-12-2012, 08:26 AM   #8
beonard6
 
 
 
Join Date: Aug 2010
Reputation: 7
Posts: 28
@Fredrikli
is mod based on sdk07? I can't find the 'gameserver.cpp'

----
AND I'M STILL GOT THE DAMN PROBLEM

Last edited by beonard6: 03-12-2012 at 08:28 AM.
beonard6 is offline   Reply With Quote
Old 03-12-2012, 09:23 AM   #9
Fredrikli
 
Join Date: Sep 2009
Reputation: 0
Posts: 122
neither can i :O

SDK Template mod :P guess it's sdk07
Fredrikli is offline   Reply With Quote
Old 03-12-2012, 09:33 AM   #10
beonard6
 
 
 
Join Date: Aug 2010
Reputation: 7
Posts: 28
@Fredrikli
hey, look what I just FOUND
so this offtopic is over.

----
NOW <somebody>, PLEASE, END MY SUFFERING WITH THESE... THINGS
beonard6 is offline   Reply With Quote
Old 03-13-2012, 01:35 AM   #11
Fredrikli
 
Join Date: Sep 2009
Reputation: 0
Posts: 122
thanks
Fredrikli is offline   Reply With Quote
Old 03-14-2012, 02:18 AM   #12
beonard6
 
 
 
Join Date: Aug 2010
Reputation: 7
Posts: 28
meh. seems easiest way is make own round based gamerule.
beonard6 is offline   Reply With Quote
Old 04-08-2012, 05:23 AM   #13
beonard6
 
 
 
Join Date: Aug 2010
Reputation: 7
Posts: 28
Quote:
Originally Posted by beonard6 View Post
but entities, such as func_rotationg, no longer working.
fix: put func_rotating to the list of entities that will not be recreated on new rounds
Quote:
Originally Posted by beonard6 View Post
also, something weird happening with poin_viewcontrol
(first time - not working at all, later camera changes with gravity).
fix: don't spawn player at round start if he did not pass WELCOME state, also - disable movement
Quote:
Originally Posted by beonard6 View Post
also2: Assertion Failed: s_bAbsQueriesValid
my own fail. tried to teleport entity while its spawning

Last edited by beonard6: 04-08-2012 at 05:27 AM.
beonard6 is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 11:16 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2014, All Rights Reserved.