Courseplay / courseplay

Courseplay for Farming Simulator 2019
http://courseplay.github.io/courseplay
GNU General Public License v3.0
952 stars 528 forks source link

MP related: Callstack on Dedi Server #4689

Closed 820fahrer closed 4 years ago

820fahrer commented 4 years ago

Hey guys,

I know that it's christmas and I don't expect that there will be a reaction in the next few days, but I think it's helpful to submit this issue.

We have an issue caused by courseplay with several tools: sprayers, hay dryers, I think there are more tools with this problem but I didn't had the time to test all

serverlog

The issue appears with activated and deactived wages.

Issue ingame: the worker uses the tool without problems, after a reconnect the work is undone. e.g. the grass isn't dry, the field isn't fertilized.

Tensuko commented 4 years ago

@davboecki

davboecki commented 4 years ago

Error: Can't change money of spectator farm

What is your farm setup? Do you have one setup? Any Idea why your machine is associated to a spectator farm?

820fahrer commented 4 years ago

Hi,

I hope you had some nice christmas days. :)

We have 4 farms on our server, 3 farms for each player and 1 farm for common machinery.

I've just used my tractor (owned from my farm, I'm farm manager of this farm).

There is no machinery which is not assigned to one farm. In our common farm, we have a combine but we didn't test courseplay with this one.

Yesterday I've tested CP with a tractor owned by my farm and a rental spreader. In this case I had no issue. Also I've tested the same combination of tractor and mowing units yesterday with no issues, today it doesn't work.

I've deleted AutoDrive and FollowMe today, but as I expected there is no change..

I've checked the vehicles.xml and farms.xml, the machines are correctly assigned to my farm. (with propertyState = "1", -> not a rental machine)

Noch so nebenbei: Kommunikation weiterhin auf englisch? Hab das von anfangs so gemacht, weil ich mir davon erhofft hab dass jeder der Entwickler dann mitlesen kann. Nur seid ihr ja größtenteils deutsch wenn ich das richtig sehe.

820fahrer commented 4 years ago

Because we had some working machines, I've tested several things:

All machines that worked in the past days (some spreaders, mowing grass, spreading manure) don't work anymore. I've no idea what has changed, but we courseplay did some jobs in the past and we had no issue.

Now I've restarted the server, connected and rented/bought a new tractor and a spreader, filled this thing with lime and let courseplay drive some meters on my field. In both cases the result was the known issue.

At the moment I don't find any configuration that works.. I had some jobs that work: spreading manure, seeding, spreading lime But at the moment nothing works.

davboecki commented 4 years ago

Would you mind somehow sending that savegame to me, maybe that can help me...

820fahrer commented 4 years ago

savegame1.zip

Here it is.

davboecki commented 4 years ago

OK, so this seems to be related to https://github.com/Courseplay/courseplay/issues/4512 or to be more precise https://github.com/Courseplay/courseplay/commit/a594e8fe78b697b591b6ad398d9b5469350becb5 While I understand most of the changes, I don't get the switch from vehicle.ownerFarmId to g_currentMission.player.farmId. I have no idea what that actually is in multiplayer. Maybe it should be something like vehicle.controllerFarmId... @pvaiko I'm actually going to need your help on this one. Maybe you can shine some light on that change for me.

Actually reproducing this is going to get hard. But maybe some more questions to @820fahrer can help. Was there a different number of people online when it first worked and when it did not anymore? Was there maybe an Admin logged in when it worked before and none afterwards?

Unrelated: Und um deine Frage bezüglich der Sprache zu beantworten. Meiner Meinung nach sollten alle solche Sachen immer auf Englisch gemacht werden, damit jeder die Möglichkeit hat nachzuvollziehen was vor sich geht/gegangen ist. Manchmal kann die kleinste Information dazu führen, dass ein Bug gefunden und Behoben werden kann (siehe folgende Tweetreihe https://twitter.com/_taylorswope/status/1205252714680045568) und nur duch eine einheitliche Sprache, kann man allen die Möglichkeit geben daran Teilzuhaben. Grade bei OpenSouce Projekten, welche auf Comunity Beteiligung (Wie aktuell meine zu MP) basieren, sollen alle teilhaben können.

820fahrer commented 4 years ago

Hey,

at the moment I have no idea when we were 1 or more people logged in.

My last test was while I was logged in as admin.

I will do some tests with/without admin. With 1 or 2 people on the server. (0/1/2 admins) I will also test the difference between farm-manager/no farm-manager, only worker

820fahrer commented 4 years ago

First result: I'm a bit confused but I found it working in my first test. I've played with a friend for several hours (I was logged in as admin, he wasn't admin). We reconnected in this time a few times, but the server wasn't restarted. The tractor was used by my friend and then I entered it and started courseplay, no issue appeared. I have no idea what has happened to the tractor that this worked.. My friend has disconnected from the server before I entered the tractor and started courseplay.

Then I began some more tests: every time: I've restarted the game and then I've connected tractor is assigned to player's farm

  1. 1 player, not as admin, is farm manager in his own farm -> issue appears
  2. 1 player, is admin, is farm manager in his own farm -> issue appears
  3. 2 players, 1 is admin, both are farm managers in their own farms -> issue appears

The tractor I use for my tests is the same every time. (the fendt 1046, which is included in the game without any changes, just the original tractor, no mod). Attached to this are two grass mowing units, the original poettinger front unit, and the poettinger a10 Based on my other tests, I think it's not important which tool is attached.

While I understand most of the changes, I don't get the switch from vehicle.ownerFarmId to g_currentMission.player.farmId. I have no idea what that actually is in multiplayer.

I think that this change was made, because the wages are paid by the player who starts the AI and not by the owner of the vehicle. The owner of the vehicle doesn't have to be the same as the guy who starts the AI. So maybe the problem is, that there is not the correct farm ID available to change the money.

davboecki commented 4 years ago

I think that this change was made, because the wages are paid by the player who starts the AI and not by the owner of the vehicle. The owner of the vehicle doesn't have to be the same as the guy who starts the AI. So maybe the problem is, that there is not the correct farm ID available to change the money.

If that is the only case, maybe a switch to self.vehicle.controllerFarmId will solve this. If you want to try it: courseplay.zip

820fahrer commented 4 years ago

Many thanks for your help!

I've tested it now several times with server restarts etc. (admin, no admin) I tested vehicles of my own farm and vehicles owned by other farms. Maybe we should test it with deactived wages, but my workers are happy to receive the money ;)

The issue didn't appear again.

So at the moment courseplay is working on our server.

pvaiko commented 4 years ago

@davboecki I'm innocent in this one, back when I was working on the wages I asked our friends at Giants what to use they said they use g_currentMission.player.farmId, they probably did not think of the MP use case. Whatever works is fine, just open a pull request.

davboecki commented 4 years ago

https://github.com/Courseplay/courseplay/pull/4707

820fahrer commented 4 years ago

In my opinion the problem is solved.

Thanks for your great work!