OhhLoz / HoneyPlus

Valheim mod to add new food items surrounding Honey
GNU General Public License v3.0
9 stars 5 forks source link

Suggestion - Server recipe.json Sync #12

Closed virtualbjorn closed 1 year ago

virtualbjorn commented 3 years ago

Does the mod already support this?

OhhLoz commented 3 years ago

Hi, Not quite sure what you mean by this, I'm assuming you mean having a server recipes.json to avoid users adding in their own items in their clientside json?

virtualbjorn commented 3 years ago

Is it possible to have this implemented so the client will always use the recipe.json from the server while they are connected?

baruchvlz commented 3 years ago

It is possible, especially with Jotunn's SyncManager. If it's ok with @OhhLoz I can take a look at it.

OhhLoz commented 3 years ago

@baruchvlz sure, I would have no idea where to start apart from seeing how other mods handle it

baruchvlz commented 3 years ago

@OhhLoz Well, I take back what I said. I'm not sure if this is possible because the recipes are loaded into the game before any contact to the server is made.

OhhLoz commented 3 years ago

ValheimPlus had some consistency checks so maybe its possible? I would have to see how they handle it

virtualbjorn commented 3 years ago

One of the mods that implement server JSON config is EpicLoot.

Also it may also be possible with .cfg instead of a JSON file. But that may take too much of your time.

baruchvlz commented 3 years ago

ValheimPlus had some consistency checks so maybe its possible? I would have to see how they handle it

They have a configuration sync which is easy to do with a RPC relay.

One of the mods that implement server JSON config is EpicLoot.

@virtualbjorn I don't think this is true, I've used EpicLoot before and there is no item definition sync between server and client.


~The recipes are loaded into the game when the game starts, i don't believe there is a way to change the recipes during runtime~.

Edit: After talking to the Jotunn guys, there is a way with RPC relays.

virtualbjorn commented 3 years ago

You must not have tried editing json files for EpicLoot which me and my community do for the server without even editing any client json files.

baruchvlz commented 3 years ago

@virtualbjorn Of course you can edit the JSON files for the server, this doesn't mean they are synced with the client.

virtualbjorn commented 3 years ago

lol, I don't know why you're saying that they aren't being synced to the clients. THEY ARE SYNCING that's what I'm saying as someone who manages a server with custom loottables for different tiers.

Raw EpicLoot on Clients while the server have the edited loottables and clients is getting the edited loottables with their RAW EpicLoot mod download.

So if that JSON isn't synced to the clients so how do the clients still get it while they are connected?

baruchvlz commented 3 years ago

@virtualbjorn Well, this isn't a conversation about EpicLoot and I already said this is possible via RPC relays. So feel free to give it a go if you want or wait until Loz adds it.

virtualbjorn commented 3 years ago

I'm just stating the scenario, not sure why you're getting your ego poked. When I just proved you wrong. That's why its good to add words that states youi're not sure or you have to check. And you just straight up shoot my suggestion down by saying EpicLoot doesn't do it when I just gave the example by experience. :)

BTW, where's my attitude by my reply? I was detailing how EpicLoot does it with my experience and asking a question. If that's an attitude you don't like then its not for you to answer.

baruchvlz commented 3 years ago

you just straight up shoot my suggestion down

I did? Did I? Odd.

On the EpicLoot topic, then maybe they've added the sync capabilities lately. All I know is that we removed it from the server because the admin couldn't find a way to sync the configs.

In either case, you'll have to wait for Loz to implement this or try it out yourself. You can refer to this repository for how to use RPC with Valheim.

virtualbjorn commented 3 years ago

🤷I suggested because I'm not a C# developer. 😊 Well, hopefully it will get integrated.

baruchvlz commented 3 years ago

@virtualbjorn instarted working on this and then it hit me... why is the server sync needed? The only thing you could potentially change is the material cost of the recipes, but the health/ stamina gain is in the asset themselves.