Skip to content
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

Fixed synchronization of weathers and interiors #96

Closed
wants to merge 6 commits into from

Conversation

WhiteSpike
Copy link

@WhiteSpike WhiteSpike commented May 12, 2024

SylviBlossom and others added 4 commits April 26, 2024 21:48
- ServerRPCs can only be called by clients and ClientRPCs can only be called by server. The issue here was that the check made to call the ServerRPCs was only to see if it was a server, which doesn't make sense because the server can't make a ServerRPC call.

- Fixes IAmBatby#92
@LinkTroisUn
Copy link

For the time those bugs are not fixed into the official version, would you know how I can compile those fixes myself ? I've tried multiple times to compile the mod from source, but I'm always blocked by private or internal attributes being accessed directly from the mod, which results in compilation error.

@RicardoCst
Copy link

Yes or could you upload your version to Thunderstore?

@WhiteSpike
Copy link
Author

For the time those bugs are not fixed into the official version, would you know how I can compile those fixes myself ? I've tried multiple times to compile the mod from source, but I'm always blocked by private or internal attributes being accessed directly from the mod, which results in compilation error.

Should just need to publicize Unity.Netcode.Runtime assembly.

@RicardoCst
Copy link

RicardoCst commented May 13, 2024

@WhiteSpike I will fork this repo and implement your fixes as a temporary solution if you approve.

Route to company and desyncs.

@WhiteSpike
Copy link
Author

@WhiteSpike I will fork this repo and implement your fixes as a temporary solution if you approve.

Route to company and desyncs.

Fine by me. They worked between two local instances. I cannot guarantee that they are actually fixed as the weather/dungeon sync was a matter of data race.

Batby is thinking of an alternative solution to this as they do not wish to have all clients tell the server to execute code (which is what this fix does) but rather have server make a result and output it to all clients to use for weather/dungeon.

@RicardoCst
Copy link

Has to wait, there are a lot of libraries and referenced components locally so I need to remap those.

@LinkTroisUn
Copy link

https://thunderstore.io/c/lethal-company/p/ricardoandren/lethallevelloader_syncfix/

I'm not sure that the fixes work.
When I try to land on a planet alone, the random seed screen waits for eternity, as if the dungeon never gets generated.

When someone tried to join me, they were stuck in a black screen. This one was caused by the SetPlanetsWeather_Postfix function (that had been modified with the fix)

After messing with the code myself and making that postfix function do nothing, the other player got kicked while I got the eternal random seed screen. (I was not sure what to change actually)

Note : for those tests, I had several modded planet mods that use LethalLevelLoader

@RicardoCst
Copy link

Hello,

I've been struggling with uploading to thunderstore and went through 4 versions in 4 hours, could be that I accidentally broke something, 1.2.10 should be uploaded correctly after an eternity, could you try as soon as the thunderstore has refreshed?

@RicardoCst
Copy link

RicardoCst commented May 14, 2024

Actually, I tried with my local version (without thunderstore) and the same issue happens, I think my build has failed and I will deprecate this (unfortunately)

EDIT: Sorry for wasting time. The only tests I did was booting the game up and routing to the company (which worked)

@LinkTroisUn
Copy link

I don't think your build has failed, because when I compiled the fix by myself, the same happened. It might be the way LethalLevelLoader is made that does not allow to change that portion of code (at least without big changes).

@RicardoCst
Copy link

RicardoCst commented May 14, 2024

Then I wonder how @WhiteSpike has tested this. (No sarcasm intended)

@WhiteSpike I will fork this repo and implement your fixes as a temporary solution if you approve.
Route to company and desyncs.

Fine by me. They worked between two local instances. I cannot guarantee that they are actually fixed as the weather/dungeon sync was a matter of data race.

Batby is thinking of an alternative solution to this as they do not wish to have all clients tell the server to execute code (which is what this fix does) but rather have server make a result and output it to all clients to use for weather/dungeon.

Also thanks @LinkTroisUn for checking this aswell.

@WhiteSpike
Copy link
Author

I didn't commit the changes I did on the csproj file. So if you haven't changed the paths according to your machine, it won't recognize core components to compile.

@RicardoCst
Copy link

I didn't commit the changes I did on the csproj file. So if you haven't changed the paths according to your machine, it won't recognize core components to compile.

No we both correctly compiled it but it doesnt work

I don't think your build has failed, because when I compiled the fix by myself, the same happened. It might be the way LethalLevelLoader is made that does not allow to change that portion of code (at least without big changes).

@WhiteSpike
Copy link
Author

I didn't commit the changes I did on the csproj file. So if you haven't changed the paths according to your machine, it won't recognize core components to compile.

No we both correctly compiled it but it doesnt work

I don't think your build has failed, because when I compiled the fix by myself, the same happened. It might be the way LethalLevelLoader is made that does not allow to change that portion of code (at least without big changes).

I made sure I had the necessary dependencies and that MY .dll was the one used to be LethalLevelLoader, NOT the one in the Thunderstore.

@RicardoCst
Copy link

I ran it locally without thunderstore, I cant tell for the other person that tried it aswell, but honestly this is way too complicated for me.

This is what I had edited in my own csproj to match my paths:

dc192d9

@WhiteSpike
Copy link
Author

Don't really see a reason for it to not work.
Post the logs here and I will take a look.

@LinkTroisUn
Copy link

LinkTroisUn commented May 14, 2024

I ran it locally without thunderstore, I cant tell for the other person that tried it aswell, but honestly this is way too complicated for me.

I overwrited the dll of LethalLevelLoader in the Bepinex/plugins/"insert lethal level loader path"/ folder with my self compiled one

@RicardoCst
Copy link

RicardoCst commented May 14, 2024

The only noteworthy logs I get with Log Level: Debug, Unity logs and LethaLevelLoader logs are:

[Info : Unity Log] Now listening to dungeon generator status. <<
[Info : Unity Log] clip index: 2; current planet: 41 Experimentation
[Info : Unity Log] Current ship ambience clips length: 12
[Info : Unity Log] clip index: 7; current planet: 41 Experimentation
[Info : Unity Log] Current ship ambience clips length: 12

After this no more logs, everything just stops.

@RicardoCst
Copy link

More extensive log and screenshot:
LogOutput.log

afbeelding

@WhiteSpike
Copy link
Author

More extensive log and screenshot: LogOutput.log

afbeelding

I forgot the case of just being the host (Because if there are no clients other than host, it won't sync thus this is not a good solution). I will think of a better way for this later.

@WhiteSpike WhiteSpike closed this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants