godarklight / DarkMultiPlayer

DarkMultiPlayer - A multiplayer mod for Kerbal Space Program
MIT License
280 stars 120 forks source link

Attempt to fix random reputation loss #361

Closed citruspress closed 8 years ago

citruspress commented 8 years ago

I found at least part of this issue is that you lose reputation when other players crash vehicles (sometimes several times aswell, I think). I worked around the issue by always reimbursing reputation lost because of vessel losses. Instead I'm keeping track of the kerbals that the client uses and whenever a kerbal that has been used by the client dies, reputation will be lost.

There are a few problems with this, like disconnecting and connecting will reset the used kerbals list. Also if several players has been in control of a vehicle both of them will lose reputation if it crashes.

Do with this what you want, I found it to be an improvement :).

rremer commented 8 years ago

+1

Obviously, this is only in Career mode, but I actually believe the problem exists in Client/KerbalReassigner.cs as the result of syncing subspaces via the (only?) interface available: killing/destroying ships and kerbals and then recreating them.

Assuming this is the only interface for moving kerbals and ships around, your implementation is the correct one imho - reimburse after susbpace sync.

Xinayder commented 8 years ago

There are a few problems with this, like disconnecting and connecting will reset the used kerbals list. Also if several players has been in control of a vehicle both of them will lose reputation if it crashes.

Maybe DMP should save the kerbals for each client, and then each client wouldn't be allowed to use a kerbal that is owned by another player. I think this has some complications with spectating, but I might be wrong.

Your PR is great, I think it is a workaround for the reputation loss. If we want to get deep into it, I suggest doing what I stated above (account-bound kerbals). It's up to @godarklight to decide whether to merge this.

opensesame11 commented 8 years ago

Maybe each vessel should keep the uuid of the last user to fly the vessel. That way when it crashes the server can be responsible for removing appropriate rep from the user

godarklight commented 8 years ago

How did I miss this... also opensesame's idea is not a bad one. I'll have a play with this branch when I start trying to fix DMP for 1.1