New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When enabling bots, the received player ID is invalid #6

Closed
archangelnl opened this Issue Dec 31, 2018 · 41 comments

Comments

Projects
None yet
2 participants
@archangelnl
Copy link

archangelnl commented Dec 31, 2018

This might be more related to the python scripts running, but the server itself lags a lot and the debug logs for python show this:

Retrieving Profile ID (Blitz25 [IDFA]) via HTTP/1.1 miniclient URI: /ASP/getplayerid.aspx?nick=Blitz25%20[IDFA]&ai=1 Received PID data is INVALID, length 35

But when visiting the web page, it does output some data:

O H pid D 2900137 $ 13 $

@wilson212 wilson212 added the question label Dec 31, 2018

@wilson212 wilson212 pinned this issue Dec 31, 2018

@wilson212 wilson212 self-assigned this Dec 31, 2018

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

SO I was not very clear on the installation instructions, but you must manually add the bots. Here is how you do so:

  1. Go to "Player Manager" in the ASP.
  2. Click the button labeled "Import Bot Players".
  3. You must now open the file viewer, and navigate to your bf2 server folder, and traverse "mods/bf2/ai/botNames.ai" file and click open.

All of your bots will now be imported and assigned player id numbers! I apologize for not including this in the install instructions!

@wilson212 wilson212 closed this Dec 31, 2018

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

No that's the thing, they seem perfectly added to me as I can find the bot in the ASP's player list, restarted the master server and such as well but it still seems to throw me the same error as above.

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Silly question, but did you modify the http_ settings BF2StatisticsConfig.py to match that of your setup? Also, you need to have your hosts' redirects enabled!

Look into this program (that I created) to have those redirects added programmatically: http://bf2statistics.com/resources/battlefield-2-gamespy-redirector.8/

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

I do seem to have the http settings configured correctly, as for myself the test account I have gets general like it should, as well as the redirects being in the hosts.ics file, and in the apache logs I can see the server actively querying the getplayerid file
[REMOVED] - - [31/Dec/2018:13:58:51 +0100] "GET /ASP/getplayerid.aspx?nick=Blitz25%20[IDFA]&ai=1 HTTP/1.1" 200 24

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Is this all localhost and running on the same machine?

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

If the length is 24, that that is a success! Here is a successful entry in my access.log:

"GET /ASP/getplayerid.aspx?nick=R.%20Smedberg&ai=1 HTTP/1.1" 200 24

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

It is not, the ASP / master & login server are sitting on one virtual machine with a public IP, and the game server is sitting on the other with another public IP.

That said with the length being 24 at least that is a success, but the error between Python and ASP still remains

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Is the bf2 server using a modified hosts file as well (or a hosts.ics)? In order for the bf2 server to be able to talk your master server, it will need to be redirected just like a bf2 client would be.

@wilson212 wilson212 reopened this Dec 31, 2018

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

It's redirected to the master server through hosts.ics, and I can actively see it pop up on the server browser.

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

You are using an "online" account correct (with a password)? Does this issue exist with bot players too (all getplayerid.aspx call fail), or just your's as a human player?

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

The test account I'm using is indeed a online account yes, the issue is not there for my own account as it gets the ID from my client, the issue is just mainly the bots not getting the ID's, and it keeps retrying over and over, lagging the BF2 server in the process.

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Can you do me a favor?

  1. Clear your game log from your bf2 server.
  2. Start the server, login and join the game.
  3. Exit the game, type "Exit" in the bf2 server console
  4. Upload the contents of the game log to pastebin, and post the link here so I can look it over?
@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

I presume you mean the log file in the python folder right? If so here it is: https://pastebin.com/KFXBn3RZ

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

That is the log I am looking for yes. I will need some time to figure this out, this is def. an odd issue that I have not run into yet.

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

Alright, let me know if you need anything more.

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Are you sure that the bots such as "Reaper5000 [bfsp]" are existing in the player table? If you are using a mod, the botNames.ai might have added new names that differ from the vanilla file. If that is the case, ensure you import ALL of the botNames.ai from all the mods you use.

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

I have imported the name's from AIX (Where all these name's come from) and if I have a look at the player table then I do get a result for that specific bot.

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

And you get a successful result if you type it in the browser?

/ASP/getplayerid.aspx?nick=Reaper5000%20[bfsp]&ai=1

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

I get the following result when I enter it in the browser:
O
H pid
D 2900258
$ 13 $

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

mind sending me your apache access.log over pastebin? I just need the last entries from the server trying to grab player id's

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

Here's a snippet of the apache log: https://pastebin.com/5XeijQCt

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Alright, a few things I have noticed:

  1. If the response length is 50, then the player name does not exist in the database. If the length is 24, a PID is returned in the response and is successful
  2. Some of those 50 responses, I see names like "Ti_GER_arn354 [AIXDevBo". Seems to be missing some characters?
    See request as an example (right from your access log):
    "GET /ASP/getplayerid.aspx?nick=Ti_GER_arn354%20[AIXDevBo&ai=1 HTTP/1.1" 200 50
  3. I am noticing 2-3 calls for the same player in the exact same second. That is also odd.
@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

Yes, the python scripts seem to really want to keep querying the pid's for the bot's, so the many requests could be explained by that? As for why it's formatting with the missing characters I'm not sure.

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Linux or Windows bf2 server? What version are you using (1.5, 1.41 ??). Playing Aix2 mod correct?

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

1.5 based on Windows, and correct!

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Have you tried just vanilla bf2 mod and see if you have the same issues? You may need to also import the vanilla botNames.ai

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

I imported the vanilla names, and changed the server to vanilla strike at karkand, still seems to be having the same issue.

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

That is super weird. The guys at NAW who have tested this system and now have 1,000 games tested as of this morning (no seriously: http://prntscr.com/m1q5yn) and I included locally testing have never had this issue.

Is this a fresh server install? How about the python, is that fresh from the v3.0 beta archive? Was this a 2.0 server before?

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

It was a 2.0 server before, I just reinstalled the server to make sure that it's completely clean, but it still shows the same error as before while getting the bot's PID's

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

I will install aix 2.0 here in a bit (I have to leave for work soon) and see If possibly I can reproduce the problem with a fresh install. The fact that you can get the PID from the browser, but the server can't is really blowing my mind right now. I have no idea what is causing that.

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

Right, so it's not AIX.. I made a few adjustments to the python file PlayerManager.py for debugging and testing purposes, and that seemed to have worked: https://pastebin.com/XTbsa5SC

That returns: https://pastebin.com/rBLfhhNK

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Datalines 0: 18

That is the problem right there.... why is there an 18 there?

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

I'm not sure as to why there is a 18 there, but that does indeed look to be the problem yeah.

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

I will play around with this and see if I can get a fix in the official python release so this does not happen again lol. Your help here has been invaluable! Thank you! Let me know if you have any other questions or issues.

@wilson212 wilson212 closed this Dec 31, 2018

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Yea lol, your fix does not work for me:

Retrieving Profile ID (J. Norberg) via HTTP/1.1 miniclient
URI: /ASP/getplayerid.aspx?nick=J.%20Norberg&ai=1

start
O
H pid
D 2900045
$ 13 $
Datalines 0: O
Datalines 1: H pid
Datalines 2: D 2900045
Datalines 3: $ 13 $
end

Received PID data is INVALID, length 24
Creating new record for player profileId 0
Retrieving Profile ID (J. Norberg) via HTTP/1.1 miniclient
URI: /ASP/getplayerid.aspx?nick=J.%20Norberg&ai=1

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

Yeah, for some reason the 18 in what the php file returns causes the issue for it to not read it correctly, thus needing to go +1, so you request data[0] in the if statement, but with the 18 there that becomes data[1], as for why the 18 is there I have no idea, perhaps it might have to do with it being apache and PHP based off of windows?

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Well, I don't think so... Here is what I am using

Windows 10
Apache v2.4.27
PHP: 5.6.31 and 7.2.3

What is weird too is that the 18 does not show in your browser. Are you able to look up your response headers and maybe post those here? Its possible the headers are getting fuzzy and put in the response as far as the miniclient is concerned?

@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

Running the following setup here:
Windows Server 2016,
Apache v2.4.37,
PHP 7.3,
The only thing that's linux based is the database in this system, which is 10.1.34-MariaDB-0ubuntu0.18.04.1

This is the response headers I get when I open it in the browser:
HTTP/1.1 200 OK
Date: Mon, 31 Dec 2018 22:13:02 GMT
Server: Apache/2.4.37 (Win64) mod_fcgid/2.3.9
X-Powered-By: PHP/7.3.0
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain; charset=utf-8

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Those headers look pretty normal to me. I also use MariaDB (10.2.8). I think maybe our best route to determine what is going on is to see what headers are returned via the miniclient.py. Once an empty line is returned, then that switches from headers -> body:

   #Extract Headers
   headers = []
   while 1:
	line = http.readline()
	if not line:
	      break
	headers.append(line)

        http.close() # all done

       #Check we got a valid HTTP response
       if statusCode == 200:
	    return http.read()
       else:
	     return "E\nH\terr\nD\tHTTP Error %s \"%s\"\n$\tERR\t$" % (str(statusCode), str(status[2]))
@archangelnl

This comment has been minimized.

Copy link

archangelnl commented Dec 31, 2018

Here's the log again with headers: https://pastebin.com/fKSTBUJg

@wilson212

This comment has been minimized.

Copy link
Member

wilson212 commented Dec 31, 2018

Headers look good. Not sure why that 18 is there, but that is def. the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment