.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Releases, Installers, Docs & Coding (http://forums.bots-united.com/forumdisplay.php?f=48)
-   -   The Bots SteamId? (http://forums.bots-united.com/showthread.php?t=1970)

Aragon 14-06-2004 13:53

The Bots SteamId?
 
Hi!
I wonder if theres a way to get rid of the zero in the bots faked "steamid"
tex
bot<1><0><CT>
Im using psychostats for the stats and it selects by the steamid. And since the bots have <0> as id theres stats are collected to. And I dont want that.

Pierre-Marie Baty 14-06-2004 14:30

Re: The Bots SteamId?
 
Yes, you just have to remove the hook for pfnGetPlayerAuthId() in the bot source code.
I had added it because some people wanted exactly the contrary: that bot stats be logged too.

KWo 14-06-2004 15:11

Re: The Bots SteamId?
 
Quote:

Originally Posted by Pierre-Marie Baty
Yes, you just have to remove the hook for pfnGetPlayerAuthId() in the bot source code.
I had added it because some people wanted exactly the contrary: that bot stats be logged too.

Yes - but for example in StatsMe2.8.x there is a special variable defining if bots have to be ranked, too, or not.

sm_rankbots 1

So - maybe in Psychostats there can be some variable for this, too.
Another thing can be some possibility of using some clients commands like Slap, Slay, etc on bots. Latest Clanmod lets use some of these commands on bots, too (if the variable cm_botsmcds 1), but nobody can say if this change You proposed above do some unwanted result for some other plugins (for example AMX) or not. If sPlOrYgOn will prepare new dll with this change, I can test it with StatsMe and Clanmod, but need somebody to test with AMX - these plugins are the most frequently used by people.:)

Aragon 14-06-2004 15:52

Re: The Bots SteamId?
 
PMB

I found this in engine.cpp

Line 324
Code:


const char *pfnGetPlayerAuthId (edict_t *e)
{
if (e->v.flags & FL_FAKECLIENT)
RETURN_META_VALUE (MRES_SUPERCEDE, "0");
RETURN_META_VALUE (MRES_IGNORED, NULL);
}

line 353
Code:


meta_engfuncs.pfnGetPlayerAuthId = pfnGetPlayerAuthId;

So would it be enough to take these away?
Will this change to the code do something strange to something else? tex. amxx?

Oki I will try and see what happends..

KWo 14-06-2004 16:31

Re: The Bots SteamId?
 
Quote:

Originally Posted by Aragon
Will this change to the code do something strange to something else? tex. amxx?

We have to check this, but taking off this can switch-off only some side-effects, unfortunally maybe used by some people until now.
Without tests nobody can say something more.

Huntkillaz 14-06-2004 22:07

Re: The Bots SteamId?
 
ehhhh we dont want this removed from the actual pb do we?..i like seeing which bot is better than me .....so i can hunt em down next round :P

sPlOrYgOn 15-06-2004 00:39

Re: The Bots SteamId?
 
After removing that code..
I didn't crash nor did anything go wrong..
in CS 1.5 their WONids became "BOT" but in CS 1.6 their steam ids became "UNKNOWN"
So in the "logging question" thread someone asked why they now show "0" instead of "BOT" and this is the reason..
I was thinking of just removing it but that would make them "UNKNOWN" in CS 1.6 so I think we should put "BOT" instead of "0" there.. anyone agree?

Pierre-Marie Baty 15-06-2004 02:37

Re: The Bots SteamId?
 
The fact why I wanted it to be a number was that some stats servers expected to see a number here, and not a character string. That's just it.

But if after all you test it and you see it works as well with a character string, sure, go ahead then.

Aragon 15-06-2004 07:39

Re: The Bots SteamId?
 
Splo!
I took that function away and in Cz theres steamid are <BOT> and not unknown..

How hard would it be to code to have the opportunity to be able to choose this on a fly? I mean do I want <BOT> or <0>?

Pierre-Marie Baty 15-06-2004 23:00

Re: The Bots SteamId?
 
very simple :)

Krush 04-07-2004 21:13

Re: The Bots SteamId?
 
Quote:

Originally Posted by Pierre-Marie Baty
very simple :)

Well how hard would it be to give each botname it's own AuthID ? I've been trying to with the code but keeps causing crashes when bot tries to login.

sPlOrYgOn 04-07-2004 21:34

Re: The Bots SteamId?
 
you shouldn't because 0 or "BOT" means it's a bot and if it's not 0 or "BOT" the game might not know it's a bot and think it's an actual player.. thats what causes the crash.. because something might send a network message to the bot that isn't connected through a network connection..

Pierre-Marie Baty 05-07-2004 02:11

Re: The Bots SteamId?
 
I don't think that's the reason.

@Krush: HOW did you try that ?

Krush 05-07-2004 21:45

Re: The Bots SteamId?
 
Quote:

Originally Posted by Pierre-Marie Baty
I don't think that's the reason.

@Krush: HOW did you try that ?

I ended up fixing the crash. What I did was giving each bot a id like STEAM_0:0:0000001 that was going up. But the prob was for some reason everytime const char *pfnGetPlayerAuthId (edict_t *e) was called the id would do something weird and go STEAM_0:0:00000011 and keep adding up til it was so damn big the game didn't know what to do and it would crash the server. So I decided maybe for now I should hard code alist of ids for the bots just til I did a better way. Only prob is now it was crashing on map change if anybots were left on the server.

So I just removed them entirely and made it be BOT. The reason I"m trying to give them fake STEAM IDs is I want killing of them to count towards psychostats.
Let me explain what I think could be done:

void ServerActivate (edict_t *pEdictList, int edictCount, int clientMax)

in there where it's reading the BotNames.txt we could have the line directly under the name be it's Steam ID and shove that into an array. Just like botnames. My only issue is if there are multiple bots on the server when it tries to get the AuthID for a kill or something how do we retreive the ID from that array. Just assume the array is char* szBotIDs[100][32] like the botnames. I've tried doing something with hardcoding in steamIDs for the anmes I have in my BotNames and it worked fine for setting them up at the start but after that everytime it wanted a botid it got the last one it sent in. So I made a function CheckNameID where it just did a compare to find the name of the bot and then set the value we give to the output in the AuthID function to the right value. Only prob with that is getting it to update enough for it to always be right. But like I said I ran out of ideas and just made it BOT for now until someone has an idea.

Krush 05-07-2004 21:49

Re: The Bots SteamId?
 
I should add the STEAM ids I made up worked fine in fooling PsychoStats to thinking they are real players, but due to the AuthID not getting sent out right each time none of the players meet ranking criteria except in one case where the bot managed to kill it's own steam id like 30 times. (prob when it was getting stuck on the 1 id.

Pierre-Marie Baty 06-07-2004 01:24

Re: The Bots SteamId?
 
Add a field in the bot_t structure

char steamid[32];

once the bot gets attributed a name in BotCreate(), fill up this bot's steamid as well

strcpy (pBot->steamid, "0123456789");

Make sure you give this bot the right steamid that is associated with its name

then for each pfnGetPlayerAuthId() call, do a

RETURN_META (MRES_SUPERCEDE, bots[INDEXENT (edict) - 1].steamid);

in my opinion that should work.

Krush 06-07-2004 01:35

Re: The Bots SteamId?
 
Quote:

Originally Posted by Pierre-Marie Baty
Add a field in the bot_t structure

char steamid[32];

once the bot gets attributed a name in BotCreate(), fill up this bot's steamid as well

strcpy (pBot->steamid, "0123456789");

Make sure you give this bot the right steamid that is associated with its name

then for each pfnGetPlayerAuthId() call, do a

RETURN_META (MRES_SUPERCEDE, bots[INDEXENT (edict) - 1].steamid);

in my opinion that should work.

I'll try that but I just found out if the id is BOT it does work for stats but the issue comes up where it's not basing the id on name so that's still a problem. i'll try this.

Krush 06-07-2004 04:05

Re: The Bots SteamId?
 
What's the (edict) in there cause I'm not sure and the compiler don't know either.

Krush 06-07-2004 04:56

Re: The Bots SteamId?
 
I thought maybe you meant it was the edict_t passed into the function but INDEXENT can't convert it to a int.

Krush 06-07-2004 05:14

Re: The Bots SteamId?
 
Got it all coded in testing now.

Krush 06-07-2004 06:11

Re: The Bots SteamId?
 
Works fine except if the bot spawns with bot when it spawns the game reads it's id as BOT


-added
Well i updated to the latest code and added my stuff in the only problme is the authid part is stubbed out, and even if i uncomment it the steamid is always BOT

-added
now i got it back to using my steamids bot when the bot is disconnected or spawns with the bot (only 2 cases found so far) it's making it's ID BOT

-added
i'm going to guess the disconnect part is because we delete the bots info before it calls the AuthID function? not sure about the bomb though.

KWo 06-07-2004 06:19

Re: The Bots SteamId?
 
Try to use EDIT function to re-edit Your latest post. In this case You will not be a multi-poster...:D

Krush 06-07-2004 07:36

Re: The Bots SteamId?
 
OK i found it

Code:

const char *pfnGetPlayerAuthId (edict_t *e)
{
  if (e->v.flags & FL_FAKECLIENT)
                  RETURN_META_VALUE (MRES_SUPERCEDE, bots[ENTINDEX (e) - 1].steamid);

  RETURN_META_VALUE (MRES_IGNORED, NULL);
}

what was happening was either e->v.flags or FL_FAKECLIENT wasn't true in those cases

so what i think to do is this

Code:

const char *pfnGetPlayerAuthId (edict_t *e)
{
  RETURN_META_VALUE (MRES_SUPERCEDE, bots[ENTINDEX (e) - 1].steamid);

  //RETURN_META_VALUE (MRES_IGNORED, NULL);
}

Please tell me if anyone sees a problem with me doing that. Because it does fix the problem i had.

-added
right now Im testing it on my server with a full load of bots. I don't think there should be a problem since that function shouldn't be called on anyone but a bot.

-added
it fixes the bomb problem but the dsconnect is now getting UNKNOWN when it shows the console kick and just <> (nothing in the id) on the drop

-added
this is what the logs look like
Code:

L 07/05/2004 - 22:57:45: Kick: "[AGR][43]E3<22><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[AGR][43]E3<22><><CT>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[DEF][33]Laser<4><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[DEF][33]Laser<4><><CT>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[NRM][78]GameCube<5><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[NRM][78]GameCube<5><><TERRORIST>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[NRM][31]Ultimate<6><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[NRM][31]Ultimate<6><><TERRORIST>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[NRM][45]X<7><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[NRM][45]X<7><><TERRORIST>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[DEF][92]PlayStation2<8><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[DEF][92]PlayStation2<8><><TERRORIST>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[AGR][55]Fart<9><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[AGR][55]Fart<9><><CT>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[AGR][39]Terminator<10><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[AGR][39]Terminator<10><><CT>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[DEF][95]Brutalix<11><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[DEF][95]Brutalix<11><><CT>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[DEF][67]Neo<12><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[DEF][67]Neo<12><><TERRORIST>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[AGR][56]Player<13><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[AGR][56]Player<13><><CT>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[DEF][100]Lag Killer<14><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[DEF][100]Lag Killer<14><><TERRORIST>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[AGR][65]The Lagger<15><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[AGR][65]The Lagger<15><><TERRORIST>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[DEF][38]Brain<16><UNKNOWN><>" was kicked by "Console"
L 07/05/2004 - 22:57:45: "[DEF][38]Brain<16><><CT>" disconnected
L 07/05/2004 - 22:57:45: Kick: "[DEF][87]Fridge<17><UNKNOWN><>" was kicked by "Console"


sPlOrYgOn 06-07-2004 07:46

Re: The Bots SteamId?
 
that'll make it stop every call even for players..
and FL_FAKECLIENT check does work.. I used it to change the authid of the bots to all sorts of things :D

Krush 06-07-2004 08:53

Re: The Bots SteamId?
 
Quote:

Originally Posted by sPlOrYgOn
that'll make it stop every call even for players..
and FL_FAKECLIENT check does work.. I used it to change the authid of the bots to all sorts of things :D

Hm well I see what you mean It just ranked all my bots and ignored me.

How do I fix the part that has the bots not getting the correct STEAM ID when they spawn with bomb or when they disconnect then? (bomb is the main one)

-added
Somehow when it calls to get the AuthID when they spawn with the bomb or they disconnect it is getting the ID as BOT still look, i'm including the logs above it showing they do ahve the ids i gave them
Code:

L 07/06/2004 - 00:14:35: "[AGR][62]Jesus<3><STEAMID_0:0:0000008><>" entered the game
L 07/06/2004 - 00:14:35: "[AGR][62]Jesus<3><STEAMID_0:0:0000008><>" joined team "TERRORIST"
L 07/06/2004 - 00:14:35: World triggered "Game_Commencing"
L 07/06/2004 - 00:14:35: World triggered "Game_Commencing" (CT "0") (T "0")
L 07/06/2004 - 00:14:35: World triggered "Round_End"
L 07/06/2004 - 00:14:35: [STATSX] Reset game stats
L 07/06/2004 - 00:14:35: "[NRM][42]OneShot<4><STEAMID_0:0:0000016><>" entered the game
L 07/06/2004 - 00:14:35: "[NRM][42]OneShot<4><STEAMID_0:0:0000016><>" joined team "CT"
L 07/06/2004 - 00:14:36: "[DEF][70]Violent<5><STEAMID_0:0:0000027><>" entered the game
L 07/06/2004 - 00:14:36: "[DEF][70]Violent<5><STEAMID_0:0:0000027><>" joined team "TERRORIST"
L 07/06/2004 - 00:14:36: "[AGR][44]The Lagger<6><STEAMID_0:0:0000036><>" entered the game
L 07/06/2004 - 00:14:36: "[AGR][44]The Lagger<6><STEAMID_0:0:0000036><>" joined team "TERRORIST"
L 07/06/2004 - 00:14:37: "[DEF][30]Smoke<7><STEAMID_0:0:0000032><>" entered the game
L 07/06/2004 - 00:14:37: "[DEF][30]Smoke<7><STEAMID_0:0:0000032><>" joined team "CT"
L 07/06/2004 - 00:14:37: "[NRM][89]Jackass<8><STEAMID_0:0:0000045><>" entered the game
L 07/06/2004 - 00:14:37: "[NRM][89]Jackass<8><STEAMID_0:0:0000045><>" joined team "CT"
L 07/06/2004 - 00:14:38: "[AGR][65]Tester<9><STEAMID_0:0:0000033><>" entered the game
L 07/06/2004 - 00:14:38: "[AGR][65]Tester<9><STEAMID_0:0:0000033><>" joined team "TERRORIST"
L 07/06/2004 - 00:14:38: "[AGR][62]Jesus<3><BOT><TERRORIST>" triggered "Spawned_With_The_Bomb"

see there at the bottom when he got the bomb he was BOT as id

Krush 07-07-2004 02:52

Re: The Bots SteamId?
 
-update
well I'm stumped, although i know it's this check
Code:

  if (e->v.flags & FL_FAKECLIENT)
          RETURN_META_VALUE (MRES_SUPERCEDE, bots[ENTINDEX (e) - 1].steamid);

  RETURN_META_VALUE (MRES_IGNORED, NULL);

that is the problem with the bomb case. some how those conditions are not being met when they spawn with the bomb or when they leave the game.

sPlOrYgOn 07-07-2004 02:54

Re: The Bots SteamId?
 
Try intercepting pfnGetPlayerWONId, maybe for the bomb person they use that..

Krush 07-07-2004 03:36

Re: The Bots SteamId?
 
Quote:

Originally Posted by sPlOrYgOn
Try intercepting pfnGetPlayerWONId, maybe for the bomb person they use that..

No it's definitely the AuthID cause if I remove the check that's currently in there it works for the bots but if any player joins they have no ID it's just <>

Can't figure out why the bomb one is getting false as the condition

-added
and if it was the WONId then the id wouldn't show up as BOT it'd show as 0 since Wonid is expecting a number

sPlOrYgOn 07-07-2004 03:43

Re: The Bots SteamId?
 
try this
Code:

const char *pfnGetPlayerAuthId (edict_t *e)
{
  if (e->v.flags & FL_FAKECLIENT)
      RETURN_META_VALUE (MRES_SUPERCEDE, "ASDF");

  RETURN_META_VALUE (MRES_IGNORED, NULL);
}

see if all the bots are ASDF.
this shouldn't affect humans..

Pierre-Marie Baty 07-07-2004 06:11

Re: The Bots SteamId?
 
replace
Code:

        if (e->v.flags & FL_FAKECLIENT)
          RETURN_META_VALUE (MRES_SUPERCEDE, bots[ENTINDEX (e) - 1].steamid);

with
Code:

        if (bots[ENTINDEX (e) - 1].is_used)
          RETURN_META_VALUE (MRES_SUPERCEDE, bots[ENTINDEX (e) - 1].steamid);


sPlOrYgOn 07-07-2004 06:31

Re: The Bots SteamId?
 
yea I think thats more smart than looping through the entire structure to see if the edict was the same as the edict in the bot structure, like how i told him in the irc channel :|

Krush 07-07-2004 06:51

Re: The Bots SteamId?
 
Problem on dedicated server.

Well before when we used the old check on the Players tab of the server I could see the AuthID i changed it to. But now all I'm getting is UNKNOWN. I'll test it some more and see what happens.

Krush 21-07-2004 23:15

Re: The Bots SteamId?
 
Put this in for now. There is still a bug though when the bot gets kicked the ID becomes UNKNOWN.
Code:

if(e->v.flags &FL_FAKECLIENT)
  RETURN_META_VALUE (MRES_SUPERCEDE, bots[ENTINDEX (e) - 1].steamid);
else if(bots[ENTINDEX (e) - 1].is_used)
  RETURN_META_VALUE (MRES_SUPERCEDE, bots[ENTINDEX (e) - 1].steamid);


GBLTeam 05-07-2013 22:20

Re: The Bots SteamId?
 
Can anyone give me plugin for bots with steam id?

tomav 16-08-2013 01:16

Re: The Bots SteamId?
 
Same needed here, since bots are not considered like real players, server seems to be empty from Steam, event if server is full of bots.

I don't think we can find a solution, but could you confirm?
(any solution about this "feature" is welcome)

Regards.


All times are GMT +2. The time now is 18:04.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.