Open SH4ZZY opened 2 years ago
I'm not so familiar with the gametracker website but I've checked some of the kz servers with replay bots, and haven't found where those bots were flagged as bot. The information of those bots in both player list and profile page seems to be identical with the normal players. Maybe I've missed something, I'm willing to take a look at this problem if you could provide further information.
So, I'm adding players like this:
`public void AddFakePlayers()
{
FQ_ResetA2sInfo();
FQ_RemoveAllFakePlayer();
float randomTime = GetRandomFloat(120.0, 420.0);
CreateTimer(randomTime, TimeFakePlayers, _, TIMER_FLAG_NO_MAPCHANGE);
int randomCount = GetRandomInt(20, 32);
int randomScore;
int nameIndex;
char randomName[256];
for (int i = 1; i < randomCount; i++) {
randomScore = GetRandomInt(5, 95);
nameIndex = GetRandomInt(0, 500);
g_sPlayerNames.GetString(nameIndex, randomName, 256);
FQ_AddFakePlayer(i, randomName, randomScore, GetEngineTime());
}
FQ_ToggleStatus(true);
}`
And that's an output from game tracker:
I'm not sure how gametracker is fetching players tho cause like i said in server browser everything looks legit
Seems that you're not setting the corresponding player count of the fake player's you've added. You should use the function shown below to let player count in the A2S_INFO response to be changed accordingly just as the example, otherwise the gametracker will receive conflict information from the A2S_INFO and A2S_PLAYER response so it thinks the fake players are bots.
Example:
public void AddFakePlayers()
{
FQ_ResetA2sInfo();
FQ_RemoveAllFakePlayer();
FQ_InfoResponseAutoPlayerCount(true);
float randomTime = GetRandomFloat(120.0, 420.0);
CreateTimer(randomTime, TimeFakePlayers, _, TIMER_FLAG_NO_MAPCHANGE);
int randomCount = GetRandomInt(20, 32);
int randomScore;
int nameIndex;
char randomName[256];
for (int i = 1; i < randomCount; i++) {
randomScore = GetRandomInt(5, 95);
nameIndex = GetRandomInt(0, 500);
g_sPlayerNames.GetString(nameIndex, randomName, 256);
FQ_AddFakePlayer(i, randomName, randomScore, GetEngineTime());
}
FQ_ToggleStatus(true);
}
I've done what you said and still gt treats them as bots.
url: https://www.gametracker.com/server_info/54.37.142.34:23016
I've registered an account and add my test server to check the actual behavior of the extension, it turned out to work fine. No fake players were marked as bot. Can you post the full source code of your plugin so I can try to reproduce this problem?
Yep, here you are:
#include <sourcemod>
#include <fakequeries>
ArrayList g_sPlayerNames;
public Plugin myinfo =
{
name = "Example - Fake players",
author = "yourmnbbn",
description = "Create fake players by returning fake AS2_INFO and A2S_PLAYER response",
version = "1.3.2",
url = "URL"
};
//int g_iFakePlayerCount = 0;
public void OnPluginStart()
{
g_sPlayerNames = new ArrayList();
ParsePlayerNames();
AddFakePlayers();
float randomTime = GetRandomFloat(120.0, 420.0);
CreateTimer(randomTime, TimeFakePlayers, _, TIMER_FLAG_NO_MAPCHANGE);
}
public Action TimeFakePlayers(Handle timer, int client)
{
AddFakePlayers();
}
public void AddFakePlayers()
{
FQ_ResetA2sInfo();
FQ_RemoveAllFakePlayer();
FQ_InfoResponseAutoPlayerCount(true);
float randomTime = GetRandomFloat(120.0, 420.0);
CreateTimer(randomTime, TimeFakePlayers, _, TIMER_FLAG_NO_MAPCHANGE);
int randomCount = GetRandomInt(20, 32);
int randomScore;
int nameIndex;
char randomName[256];
for (int i = 1; i < randomCount; i++) {
randomScore = GetRandomInt(5, 95);
nameIndex = GetRandomInt(0, 500);
g_sPlayerNames.GetString(nameIndex, randomName, 256);
FQ_AddFakePlayer(i, randomName, randomScore, GetEngineTime());
}
FQ_ToggleStatus(true);
}
void ParsePlayerNames() {
File file = OpenFile("addons/sourcemod/data/names.txt", "r");
if ((file == null)) {
return;
}
char line[32];
while (file.ReadLine(line, sizeof(line)) && !file.EndOfFile()) {
if (StrContains(line, "//") != -1) {
SplitString(line, "//", line, sizeof(line));
}
TrimString(line);
g_sPlayerNames.PushString(line);
}
delete file;
}
So there are some logic problems in your code. The following functions should be executed in the OnPluginStart forward instead of the timer callback since they are the steps of initialization of the extension. Your current code is reinitializing the extension repeatedly, and might still cause the unexpected behavior you've mentioned after refreshing the plugin.
FQ_ResetA2sInfo();
FQ_InfoResponseAutoPlayerCount(true);
FQ_ToggleStatus(true);
I haven't tested this but it should work after the plugin and gametrack refresh.
#include <sourcemod>
#include <fakequeries>
ArrayList g_sPlayerNames;
public Plugin myinfo =
{
name = "Example - Fake players",
author = "yourmnbbn",
description = "Create fake players by returning fake AS2_INFO and A2S_PLAYER response",
version = "1.3.2",
url = "URL"
};
//int g_iFakePlayerCount = 0;
public void OnPluginStart()
{
FQ_ResetA2sInfo();
FQ_RemoveAllFakePlayer();
FQ_InfoResponseAutoPlayerCount(true);
FQ_ToggleStatus(true);
g_sPlayerNames = new ArrayList();
ParsePlayerNames();
AddFakePlayers();
float randomTime = GetRandomFloat(120.0, 420.0);
CreateTimer(randomTime, TimeFakePlayers, _, TIMER_FLAG_NO_MAPCHANGE);
}
public Action TimeFakePlayers(Handle timer, int client)
{
AddFakePlayers();
}
public void AddFakePlayers()
{
FQ_RemoveAllFakePlayer();
float randomTime = GetRandomFloat(120.0, 420.0);
CreateTimer(randomTime, TimeFakePlayers, _, TIMER_FLAG_NO_MAPCHANGE);
int randomCount = GetRandomInt(20, 32);
int randomScore;
int nameIndex;
char randomName[256];
for (int i = 1; i < randomCount; i++) {
randomScore = GetRandomInt(5, 95);
nameIndex = GetRandomInt(0, 500);
g_sPlayerNames.GetString(nameIndex, randomName, 256);
FQ_AddFakePlayer(i, randomName, randomScore, GetEngineTime());
}
}
void ParsePlayerNames() {
File file = OpenFile("addons/sourcemod/data/names.txt", "r");
if ((file == null)) {
return;
}
char line[32];
while (file.ReadLine(line, sizeof(line)) && !file.EndOfFile()) {
if (StrContains(line, "//") != -1) {
SplitString(line, "//", line, sizeof(line));
}
TrimString(line);
g_sPlayerNames.PushString(line);
}
delete file;
}
Oh, yea that makes sense, but still gametracker treats them as bots. However if your test server is working fine with gametracker i guess It's problem with my server or hosting, maybe it also depends on host_players_show
🤔
//edit: host_players_show
is set to 2 so i guess that's not an issue
I've tested your implementation and confirmed the problem, but with my example plugin provided in this repo it works fine. Maybe there are still something wrong with it. You can try a different implementation. I'll take a look at this later.
Okey, thanks for your time.
GT treats players as bots when they have identical connection time.
With gametracker is easy to resolve but how to resolve the issue on internet server list . On favorite it appears the players but on internet list 0/32
@yourmnbbn in order for the player to be displayed, you need to authorize it https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/engine/sv_steamauth.cpp#L687
@sev4a Yeah this is a way. The function you’ve mentioned is a callback of this authentication interface in the sdk. As you can see the authentication requires a valid steamid. The auth implementation is on the master server side so we cannot change anything about it. If you want a successful authentication you have to give it a valid account. One fake player with one unique account is not a proper way at all.
The problem is not about the authentication, it's about how to proper authenticate the fake players.
Hello, I've set this extension on my test server, everything works fine in server browser/fav but at https://www.gametracker.com every fakeplayer is flagged is bot, is it my fault or extension doesen't support this type of sites?
Thank you in advance and i must admit ext in overall is pretty neat.