maiorBoltach / bf2142stats_emu

Battlefield 2142 Statistics Emulator Server
GNU General Public License v2.0
32 stars 14 forks source link

Stats are not uploading and problem with web files. #4

Open KungPanda opened 6 years ago

KungPanda commented 6 years ago

Hello, i followed steps by steps the readme, create database, users rights, import bf2142.sql, and added python files, but still it doesn't upload any stats in the database... By the way how do you set up the statistics web files, ASP folder and files are missing... Index.php return "hi"... i tryed 127.0.0.1/BF2142/include/admin.menu.php but it returns "Restricted acces"... Some php files are missing right? I even tryed to edit those files to get it working with ASP files from bf2 without succes... install bf2142

maiorBoltach commented 6 years ago

Hello, @KungPanda, did you add server IP to authorized ones in the database?

KungPanda commented 6 years ago

Yes i did https://imgur.com/a/6zg6A So you just drag and drop the web folder in xampp, inport bf2142.sql and nothing more? How do i get acces to the admin panel like in bf2 statistics...?? Do you have Discord or something to see it by TeamViewer? server add 2

KungPanda commented 6 years ago

Update: I checked again, i was editing wrong the way to add the ip in the table. Well some stats are sent in the database like "Awards", "maps", but score, rank are not even sent in the database... And also ranks are not updating ingame.... awards map stats

maiorBoltach commented 6 years ago

@KungPanda please, upload screenshot with 'playerprogress' table.

  1. There is no admin panel (maybe, it will be done in the future with the full rework of stats)
  2. Information about ranks and different medals will be written to database only after the end of the round. Also, log out from your game account and log in after to check rank - there is a bug, when in-game stats after the end of the round don't update properly (only in interface).
maiorBoltach commented 6 years ago

I've already checked everything - works fine and i'm getting ranks and unlocks

maiorBoltach commented 6 years ago

Additional question: do you start client and server on the same machine under one system?

KungPanda commented 6 years ago

Yes i run everything on the same computer. The gamespy login server runs on the "test2142" table and the stats on the "bf2142" table. playersprogress

KungPanda commented 6 years ago

Here is a video showing my database:

https://www.youtube.com/watch?v=-DlKHxodhaw https://www.youtube.com/watch?v=3gP4NhKfy-o&feature=youtu.be

maiorBoltach commented 6 years ago

Everything should be in one database. Also, what version of the game and xampp do you use?

KungPanda commented 6 years ago

I use the 1.51 version of the game and 3.2.2 version of xampp.

KungPanda commented 6 years ago

Update: i uninstalled and installed xampp 1.7.7, stats are now recorded in the database but ranks are not updated ingame even after log out and and log in of the Account. And unlocks doesn't works, no message after the round to deblock unlocks. My server exe is hex edited, every gamespy.com urls is redirected to 127.0.0.1.

Here is some screenshots of my database. Is it normal that there is nothing in the stats_v and unlocks table? playerprogress stats_v1 stats_v2 unlocks

KungPanda commented 6 years ago

Hello, why ranks are not updating ingame? Ranks immediatly disapear after a restart server.

KungPanda commented 6 years ago

Here is the python log: https://mega.nz/#!HaJHDaBY!AQ2iU-99_YGWrRZ4v2plXXX_aYt--T9hLC4CV5uENdw

maiorBoltach commented 6 years ago

Hi, 1 more question: did you add the following lines to hosts.ics? publicIP stella.master.gamespy.com publicIP stella.prod.gamespy.com

Also, in client exe file you should find hex code 0301a8c0 (it's 3.1.168.192 in HEX) and replace it with your reversed ip. For example, your IP 192.168.4.1. You should go to this site and paste 1.4.168.192. You get the code 0104a8c0, which you should replace the old one.

maiorBoltach commented 6 years ago

I'm sorry, the instruction in the repository was written almost 5 years ago. It should be updated, but in general, it is still valid. By the way, I should simplify the installation.

KungPanda commented 6 years ago

Yes every urls of the readme are in my hosts.ics file. Here is a video showing how i set up everything, maybe i am doing some wrong things. https://www.youtube.com/watch?v=m1A4Pv2xDTo Your patched exe doesn't works... i can't even log in with the client... i have to use my patched exe. Here is a video about how i edit your patched exe: https://www.youtube.com/watch?v=igdreyOJLhg&feature=youtu.be

Do you have Discord or Skype? Would be faster to figure out the problem..

KungPanda commented 6 years ago

I checked the python log, here is a part of the log with your original python files:

"Conquest gamemode initialized. onPrePlayerConnect: kkkkkkkk kungpanda:0 stats.py[520]: Creating new record for player profileId 1 stats.py[208]: Resetting medals for player: 0(pid: 1) medals.py[324]: getting medals from gamespy medals.py[325]: Will retrieve medals from GSI... medals.py[338]: roundMedals: {} medals.py[226]: Added player 0, kkkkkkkk kungpanda (1) IP=192.168.0.20 to medal/rank checking medals.py[230]: Getting Stats... medals.py[240]: Requesting player STATS medals.py[274]: Requesting player AWARDS rank.py[58]: Added player 0 to rank checking unlocks.py[31]: Added player 0 to unlock checking medals.py[486]: Stats request failed for player 0 : TEXT_hostlookupfailed rank.py[69]: rank not found, aborting medals.py[554]: Medal request failed for player 0 : Traceback (most recent call last): File "python\bf2\stats\medals.py", line 442, in onAwardsResponse print "medals.py[554]: Medal request failed for player ", playerIndex, ": ", stats NameError: global name 'stats' is not defined medals.py[486]: Stats request failed for player 0 : TEXT"

KungPanda commented 6 years ago

So i added the following lines in medal.py and unlocks.php:

"from bf2.BF2142StatisticsConfig import http_backend_addr, http_backend_port from bf2.stats.miniclient import miniclient, http_get"

And here is the new log:

"stats.py[522]: Creating new record for player profileId 2 stats.py[210]: Resetting medals for player: 0(pid: 2) medals.py[324]: getting medals from gamespy medals.py[325]: Will retrieve medals from GSI... medals.py[338]: roundMedals: {} medals.py[226]: Added player 0, kkkkkkkk chuck (2) IP=192.168.0.20 to medal/rank checking rank.py[56]: Player 0 had no profile id, can't request rank rank.py[59]: Added player 0 to rank checking unlocks.py[29]: Player 0 had no profile id, can't request unlocks unlocks.py[30]: Added player 0 to unlock checking rank.py[32]: Destroyed timer stats.py[210]: Resetting medals for player: 0(pid: 2) stats.py[64]: Reset orderiterator to 1 based on highest pid kept stats.py[210]: Resetting medals for player: 0(pid: 2) medals.py[216]: Player id=0 found in sessionPlayerMedalMap medals.py"

Looks like something is wrong with the profile id... How to resolve it?

maiorBoltach commented 6 years ago

@KungPanda you can find me in discord @maiorBoltach#1798

KungPanda commented 6 years ago

I added you ;)