AndrejGobeX / TrackMania_AI

Racing game AI
GNU General Public License v3.0
99 stars 11 forks source link

Driver.py giving a "ready" but then also giving out an error message #6

Closed Kanenashi closed 2 years ago

Kanenashi commented 2 years ago

File "D:\Python399\lib\threading.py", line 973, in _bootstrap_inner self.run() File "D:\Python399\lib\threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "D:\TrackMania_AI-main\Driver.py", line 61, in data_getter_function s.connect(("127.0.0.1", 9000)) ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

AndrejGobeX commented 2 years ago

I don't know, perhaps the port is already in use. However, you cannot change it as it is in the plugin. First fire up the game, see Waiting for connection in openplanet log, then use Driver.py. You can try to create a single socket in a different script, just to see what's the problem. I can tell you the usual (restart the computer, follow the setup) but I believe you have already tried that. Also, try installing python in C:, I had issues with D: for different programs.

Kanenashi commented 2 years ago

Ok I'll check again since my C drive only has 200 MB left

Kanenashi commented 2 years ago

I didn't check the logs and I got an invalid signature error for the plugin

AndrejGobeX commented 2 years ago

Ok, so that happens if you are on EpicGames launcher. Try running the game from .exe, or use UbisoftConnect

Kanenashi commented 2 years ago

I used ubisoft connect and I got the same error still

AndrejGobeX commented 2 years ago

Did you clone this repo? It can sometimes download a scrambled file. You need to copy both plugin and signature files to the openplanet folder.

Kanenashi commented 2 years ago

I'm sorry but uh... I downloaded.

Kanenashi commented 2 years ago

and yes I have copied both files

AndrejGobeX commented 2 years ago

Ok, so download git for windows. Then, git clone this repo, and then copy the files

Kanenashi commented 2 years ago

.as and .sig right?

AndrejGobeX commented 2 years ago

yes

Kanenashi commented 2 years ago

Both files are in scripts folder for openplanet

Kanenashi commented 2 years ago

I copied both of them as you said in the instructions

AndrejGobeX commented 2 years ago

I don't know exactly. All I can do is tell you to try various things. Every issue that is solved, I put in the readme. I haven't seen this yet. Usually the solution is to use git to clone the repo and Ubisoft Connect. You can also try to hash the files so I can check if they aren't scrambled

Kanenashi commented 2 years ago

How do I hash the files? I'm new to github

AndrejGobeX commented 2 years ago

google certutil, open cmd

certutil -hashfile "plugin file" SHA1 certutil -hashfile "sig file" SHA1

save the hashes

Kanenashi commented 2 years ago

6f64dd63d8a9ee776c92d09be773b07a85a25996 for the .as 2cbc5d2206ca5c3e7483435d3b9da38b0bc966b7 for the as.sig

Kanenashi commented 2 years ago

that's it right?

AndrejGobeX commented 2 years ago

as.sig is ok, the .as is not it is 2e627700f726f9883781d61f238024c61a2f745a

don't edit that file

Kanenashi commented 2 years ago

so do I download it again?

Kanenashi commented 2 years ago

git clone it then

AndrejGobeX commented 2 years ago

Don't know, try to download it again, maybe you don't need to git clone but it will work definitely

Kanenashi commented 2 years ago

Ok on it

Kanenashi commented 2 years ago

I downloaded it again and I still got the same error of invalid signature

AndrejGobeX commented 2 years ago

Is the hash ok?

Kanenashi commented 2 years ago

I got the same hash 6f64dd63d8a9ee776c92d09be773b07a85a25996

AndrejGobeX commented 2 years ago

No, that means that the file is not ok. You need to have a file that produces the hash i gave you

Kanenashi commented 2 years ago

so gitclone it then?

AndrejGobeX commented 2 years ago

It will work.

Kanenashi commented 2 years ago

Ok I'm git cloning and it worked the hash matches

Kanenashi commented 2 years ago

But I still get an invalid signature and it says "Loading legacy plugin"

AndrejGobeX commented 2 years ago

I really don't know, try reinstalling the game or running from .exe or check if you copied files correctly. If you find a solution, let me know so I can write it in the readme for others

Kanenashi commented 2 years ago

I recopied the files again and now I get this error File "D:\Python399\lib\threading.py", line 973, in _bootstrap_inner self.run() File "D:\Python399\lib\threading.py", line 910, in run self._target(*self._args, *self._kwargs) File "D:\TrackMania_AI-main\Driver.py", line 63, in data_getter_function data = GetData.get_data(s) File "D:\TrackMania_AI-main\GetData.py", line 7, in get_data data['speed'] = unpack(b'@f', s.recv(4))[0] 3.6 # speed struct.error: unpack requires a buffer of 4 bytes

AndrejGobeX commented 2 years ago

The plugin works? If the plugin works I do not know why this won't work

Kanenashi commented 2 years ago

0 Void main() D:/TrackmaniaNext/Openplanet/Scripts/Plugin_GrabData_0_1.as as line 46

That's the error message I get when I use driver.py in the Logs

Kanenashi commented 2 years ago

sorry for being such an idiot

AndrejGobeX commented 2 years ago

Wait, how? That's from plugin, they are not connected directly

AndrejGobeX commented 2 years ago

I really recommend to place everything on C: