Re[2]: [hlcoders] NULL player problem

2002-03-11 Thread Cruise

-BEGIN PGP SIGNED MESSAGE-
Hash: MD5

 Now there are a few other things i have thought of and taken into
 consideration and i dunno if these may affect it in anyway but i better
 mention it. I changed the default spawn behavior and made an extra variable
 called b_canrespawn this way while players were rechoosing equipment etc
 they remained dead to the world and spectators etc had this set too. In the
 player::prethink i then changed the line that was something like
if(deadflag = dead_no) or something to if(b_canrespawn  deadflag =
 dead_no)
 although i am sure that doesn't effect it in any way.
[snip]
 But the next thing i am going to mention makes it appear real funny.
 Once i reset the round in the gamerules function all players that
 disconnected don't then effect it at all :/ it only seems to effect the
 current round and i have looked at it many times and can't see the problem
 so i'll post some stuff here.
 in the round restart it just does
[snip]
 cbaseplayer *plr = NULL;
 for(int i = 1; i = gpglobals-maxclients; i++)
 {
 remove from spectator mode;
 put player in observer mode;
 show plr vgui equipment menu;
 }

First impressions here is that the disconnected could be getting stuck
in spectator mode, or some kind of mishmash of alive/spectator...

However, we had a similar problem with The Opera in our rounds where
ClientDisconnect wasn't actually called for all disconnects.

Also, wasn't there a thread on here a while back about player
structures being cached on a disconnect? And so a simple IsNull
check wouldn't return false even tho' the player had left the game.


Hope one of those are of use...

[ Cruise / www.casual-tempest.net ]

-BEGIN PGP SIGNATURE-
Version: 2.6

iQCVAwUAPIysvvdi0Z5STRufAQGmZgP/d2CuvtyOZf+uCx/2HkyfF2nmXLuKPwAP
11ZiiLMlqcgwWasGSIQIGJtAsxMOA+aFPA1oHle1TA02/b1vmt9/ul+JzOpCL9LD
lL24QS++V8E5vAM+ahiDgDFkz64eS18sxoan6dNv/JMtwKKW2Ifc357diT6tHmFQ
re39w5r91dI=
=AHVt
-END PGP SIGNATURE-

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




Re: Re[2]: [hlcoders] NULL player problem

2002-03-11 Thread Christopher Long

actually now that you mention it i may have a problem with not removing them
from spectator mode correctly hmm with what your saying and how they are
getting locked in it if it can indeed happen then i think you may have
solved my problem.

That or you reckon a isNull check on the player in the gamerules check eh?

Anyways i'll give it a belt and get back to you :) thanks for taking the
time to reply.
- Original Message -
From: Cruise [EMAIL PROTECTED]
To: Christopher Long [EMAIL PROTECTED]
Sent: Monday, March 11, 2002 11:10 PM
Subject: Re[2]: [hlcoders] NULL player problem


 -BEGIN PGP SIGNED MESSAGE-
 Hash: MD5

  Now there are a few other things i have thought of and taken into
  consideration and i dunno if these may affect it in anyway but i better
  mention it. I changed the default spawn behavior and made an extra
variable
  called b_canrespawn this way while players were rechoosing equipment etc
  they remained dead to the world and spectators etc had this set too. In
the
  player::prethink i then changed the line that was something like
 if(deadflag = dead_no) or something to if(b_canrespawn  deadflag =
  dead_no)
  although i am sure that doesn't effect it in any way.
 [snip]
  But the next thing i am going to mention makes it appear real funny.
  Once i reset the round in the gamerules function all players that
  disconnected don't then effect it at all :/ it only seems to effect the
  current round and i have looked at it many times and can't see the
problem
  so i'll post some stuff here.
  in the round restart it just does
 [snip]
  cbaseplayer *plr = NULL;
  for(int i = 1; i = gpglobals-maxclients; i++)
  {
  remove from spectator mode;
  put player in observer mode;
  show plr vgui equipment menu;
  }

 First impressions here is that the disconnected could be getting stuck
 in spectator mode, or some kind of mishmash of alive/spectator...

 However, we had a similar problem with The Opera in our rounds where
 ClientDisconnect wasn't actually called for all disconnects.

 Also, wasn't there a thread on here a while back about player
 structures being cached on a disconnect? And so a simple IsNull
 check wouldn't return false even tho' the player had left the game.


 Hope one of those are of use...

 [ Cruise / www.casual-tempest.net ]

 -BEGIN PGP SIGNATURE-
 Version: 2.6

 iQCVAwUAPIysvvdi0Z5STRufAQGmZgP/d2CuvtyOZf+uCx/2HkyfF2nmXLuKPwAP
 11ZiiLMlqcgwWasGSIQIGJtAsxMOA+aFPA1oHle1TA02/b1vmt9/ul+JzOpCL9LD
 lL24QS++V8E5vAM+ahiDgDFkz64eS18sxoan6dNv/JMtwKKW2Ifc357diT6tHmFQ
 re39w5r91dI=
 =AHVt
 -END PGP SIGNATURE-

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




Re: [hlcoders] NULL player problem

2002-03-09 Thread botman

 I have set a gamerules up that checks if all players are dead on the
 current team testing if they are a player and if they are alive or not and
 i check if it is a nullent so that after all players on one team are
 eliminated it respawns all players to go at it again BUT it's not working
 correctly. Here is the problem.

It sounds like you aren't properly removing the player that left the game.
Look at the ClientDisconnect() function.  The default behaviour is to set
pev-takedamage to DAMAGE_NO and set the pev-solid to SOLID_NOT.

Jeffrey botman Broome

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




Re: [hlcoders] NULL player problem

2002-03-09 Thread Christopher Long

already ahead of you botman. I checked it out and many other things before i
chose to bother this list. the client.cpp clientdisconnect has

// since the edict doesn't get deleted, fix it so it doesn't interfere.
 pEntity-v.takedamage = DAMAGE_NO;// don't attract autoaim
 pEntity-v.solid = SOLID_NOT;// nonsolid
 UTIL_SetOrigin ( pEntity-v, pEntity-v.origin );

 g_pGameRules-ClientDisconnected( pEntity );

Now there are a few other things i have thought of and taken into
consideration and i dunno if these may affect it in anyway but i better
mention it. I changed the default spawn behavior and made an extra variable
called b_canrespawn this way while players were rechoosing equipment etc
they remained dead to the world and spectators etc had this set too. In the
player::prethink i then changed the line that was something like
if(deadflag = dead_no) or something to if(b_canrespawn  deadflag =
dead_no)
although i am sure that doesn't effect it in any way.

But the next thing i am going to mention makes it appear real funny.
Once i reset the round in the gamerules function all players that
disconnected don't then effect it at all :/ it only seems to effect the
current round and i have looked at it many times and can't see the problem
so i'll post some stuff here.

basically in the main function i perform a think every 10 seconds that
checks the rounds state.

// the below functions returns alive people in the requesting team name
int CheckTeamStatus(char *TeamName)
{
int alive = 0;
cbaseplayer *plr = NULL;

for(int i = 1; i = gpglobals-maxclients; i++)
{
plr = UTIL_PlayerByIndex(i);
if(plr != NULL  plr-isPlayer() )
{
if(!strcmp(TeamName, plr-m_szTeamName) )
alive++;
}
return alive;
}

i have a check that detects if the round should be restarted in the main
think first up
next i have a check that runs every 10 seconds and passes the teams names to
check.
if all teams bar 1 are eliminated completely with no players in them then it
sets the round restart var to true and the round gets
restarted next 10 second check.

in the round restart it just does

cbaseplayer *plr = NULL;
for(int i = 1; i = gpglobals-maxclients; i++)
{
remove from spectator mode;
put player in observer mode;
show plr vgui equipment menu;
}

after the player does equipment selection the resulting button action signal
causes the players state to be set to dead_respawnable and b_can respawn set
to true, and thus they respawn and are ready to rock.

I dunno if this extra info helps at all botman but it'd be great if i could
knock this problem over as it is most annoying. I've searched it over and
over but i'll keep going till i get it.

As usual any extra help would be greatly appreciated.
soz to all that read the huge post :) are your eyes bleeding yet.

- Original Message -
From: botman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 09, 2002 10:16 PM
Subject: Re: [hlcoders] NULL player problem


  I have set a gamerules up that checks if all players are dead on the
  current team testing if they are a player and if they are alive or not
and
  i check if it is a nullent so that after all players on one team are
  eliminated it respawns all players to go at it again BUT it's not
working
  correctly. Here is the problem.

 It sounds like you aren't properly removing the player that left the game.
 Look at the ClientDisconnect() function.  The default behaviour is to set
 pev-takedamage to DAMAGE_NO and set the pev-solid to SOLID_NOT.

 Jeffrey botman Broome

 ___
 To unsubscribe, edit your list preferences, or view the list archives,
please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlcoders


___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




[hlcoders] NULL player problem

2002-03-08 Thread Christopher Long

This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
I have set a gamerules up that checks if all players are dead on the current team 
testing if they are a player and if they are alive or not and i check if it is a 
nullent so that after all players on one team are eliminated it respawns all players 
to go at it again BUT it's not working correctly. Here is the problem.

start an 8 player server and 3 people join
players 1(server) and 2 join join team 1 and player 3 joins team 2.
player 2 hits escape and disconnects from the game.
player 1 is killed by player 2 and enters spectator mode(kudos to robin walker for 
this) BUT the spectator mode follows player 3 and can also lock onto player 2 which is 
listed as NULL in the name field and sits at a spawn location, invisible.

Due to the disconnected player still being there for some reason it still includes 
them in the count but doesn't see them as dead I remember seeing something like 
this is past versions of counter-strike around 6.0-6.5 i think i remember, where 
disconnected players were seen as NULL and inivisible.

Has anyone encountered this problem before and is there a fix?
Thanks in advance to any that try to help.
--

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders