.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 2 SDK
Half-Life 2 SDK For developments focused around the Half-Life 2 engine Half-Life 2

Reply
 
Thread Tools
Player Joining..
Old
  (#1)
FrostyCoolSlug
Member
 
FrostyCoolSlug's Avatar
 
Status: Offline
Posts: 318
Join Date: Mar 2004
Default Player Joining.. - 02-12-2004

Ok, i have spent literally HOURS looking for the code that is executed as soon as a player joins the game, does anyone else know where this is?

This is my first time playing with the SDK, and although a lot of it makes sence, a lot of the files seem rather irrelevant.. if creating a mod from scratch i dont WANT the MP5, Shotgun and Frag Nades from CS:S built into it.. its just frustrating that there is a lot of code for things that will probably never be used ;P


=====
Craig "FrostyCoolSlug" McLure
Network Administrator of the ChatSpike IRC Network
  
Reply With Quote
Re: Player Joining..
Old
  (#2)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Player Joining.. - 02-12-2004

I haven't had a chance to poke around much, but it might help to look at the serverplugin_sample code in the src\utils directory.

There's some example code in there giving function names when players connect to the server, disconnect from the server, get authorized by Steam, change their player name, etc. I assume those function names will be the same as in the multiplayer code.

botman
  
Reply With Quote
Re: Player Joining..
Old
  (#3)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Player Joining.. - 09-12-2004

I'd do a clientconnect or clientputinserver search. I already saw that most function names remain the same compared to the 'old' sdk. I think that is on purpose to make the 'shift' as painless as possible.

i already found pieces in player.cpp with FAKECLIENT, even a "IsBot()" function. I think thats pretty neat! They already think ahead on this one.

I found several files with these key words btw, search for it


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Player Joining..
Old
  (#4)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Player Joining.. - 10-12-2004

P.s. Just to get you started, pfnRunPlayerMove() became PlayerRunCommand().

(just in case you're searching for it).

botman
  
Reply With Quote
Re: Player Joining..
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Player Joining.. - 10-12-2004

haha! somehow I knew botman was already playing around quietly in his corner with the SDK. pwned, botman!

/me transports his bed outdoors near the mailbox waiting for Stefan's CDROMs...



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Player Joining..
Old
  (#6)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Player Joining.. - 10-12-2004

lol, it may take a while PM for those cd's but it will be before 2005 you have them I have to send them monday i think... (i hope!)....

PlayerRunCommand... ah, cool!


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Player Joining..
Old
  (#7)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Player Joining.. - 10-12-2004

i did a look for PlayerRunCommand,; it seems it is used for vehicles...

apart from that i cannot see the use of this command yet, nor for bots. But, that also is becuase i have no real clue yet about the code.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Player Joining..
Old
  (#8)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: Player Joining.. - 10-12-2004

Look for a pmove.cpp or a pm_move.cpp or something. You could also try looking at the player class or in client.cpp.


sfx1999.postcount++
  
Reply With Quote
Re: Player Joining..
Old
  (#9)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: Player Joining.. - 10-12-2004

Wait ignore that. I that you were talking about a player movement command.

I am going to look in the player class's constructor.


sfx1999.postcount++
  
Reply With Quote
Re: Player Joining..
Old
  (#10)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: Player Joining.. - 10-12-2004

I found a function that looks like it would work.

Declaration (game_shared/multiplay_gamerules.h):
Code:
virtual bool ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen );
Implementation (game_shared/multplay_gamerules.cpp):
Code:
bool CMultiplayRules::ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen )
   {
     GetVoiceGameMgr()->ClientConnected( pEntity );
     return true;
   }
In gamerules.h, it stated it was called when a player connects, but isn't spawned.


sfx1999.postcount++
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com