It doesn't work that way in the real worldZeblote wrote: You don't have to do the work of modders, if a mod causes a desync because it is badly programmed then that's the modders fault, not yours!
![Razz :P](./images/smilies/icon_razz.gif)
It doesn't work that way in the real worldZeblote wrote: You don't have to do the work of modders, if a mod causes a desync because it is badly programmed then that's the modders fault, not yours!
But you're not breaking mods, they just won't work in the first place. The modder has to ensure it'll work before he releases it.Rseding91 wrote:It doesn't work that way in the real worldZeblote wrote: You don't have to do the work of modders, if a mod causes a desync because it is badly programmed then that's the modders fault, not yours!every mod that breaks gets blamed on the game engine and not the mod.
That would solve the problem for blueprint loading.DaveMcW wrote:A better model is the text box gui. You can paste a block of text into it, and it automatically copies to all clients.
We need a similar object that can read a file on a specific player's computer, and copy the contents to all clients.
Code: Select all
blueprints/big_station.dat | 938 | 04/10/2015 14:51:43
blueprints/station.dat | 472 | 08/10/2015 08:33:12
blueprints/somefolder/powerplant.dat | 2134 | 14/09/2015 19:16:58
Code: Select all
blueprints/somefolder/
blueprints/sometolder/anotherfolder/
They're methods on the player class. Based on other mods, that's what identifies a specific client. Gui events pass along the player who clicked buttons. Or did I miss something?ratchetfreak wrote:There is one thing missing
How do you specify which client to write/read the file to/from
I noticed that a bit later. was too lazy to clear the text.Zeblote wrote: They're methods on the player class. Based on other mods, that's what identifies a specific client. Gui events pass along the player who clicked buttons. Or did I miss something?
About headless servers, I've no idea. They would need a seperate set of methods.
I see no reason for a mod to do that. If a file is needed regularly, it can be cached in lua.ratchetfreak wrote: Also on the more technical side; the replay file must contain the file that was pulled in. That can cause the replay file to grow quite a bit if a mod is dumb and pulls a file every tick.
As I said "if a mod is dumb" and there will be dumb mods.Zeblote wrote:I see no reason for a mod to do that. If a file is needed regularly, it can be cached in lua.ratchetfreak wrote: Also on the more technical side; the replay file must contain the file that was pulled in. That can cause the replay file to grow quite a bit if a mod is dumb and pulls a file every tick.
Well, just don't install dumb mods. There shouldn't be a limit just because someone might be unable to use it correctly.ratchetfreak wrote: As I said "if a mod is dumb" and there will be dumb mods.
Doing that in multiplayer for each player will be even more hazardous because the bandwidth cost will explode.
So a rate limiter on it would be nice.
Code: Select all
str = player.read_file(path)
Code: Select all
player.readfile(path, eventHandler)
By not allowing access to the game state you can't change the game state. Allowing reading files in while you had no access to the game state or the global table would also prevent modifying the game state but it would be useless as you couldn't *do* anything with the file.Zeblote wrote:Seems like you've found a way to prevent a script from changing the game state, so I don't see what's stopping client sided scripts.
Not running everything on all clients makes way for many client sided functions in the future, especially regarding guis and files.
That's why you send a custom event to the game that can then be processed deterministically. What you're doing with a gui and files and whatever does not matter to other clients until you actually want to do something with it that changes the game state. Client sided scripts are required for many advanced APIs like files, maybe internet access, etc...Rseding91 wrote: By not allowing access to the game state you can't change the game state. Allowing reading files in while you had no access to the game state or the global table would also prevent modifying the game state but it would be useless as you couldn't *do* anything with the file.
They shouldn't be, it makes no sense. If I open the escape menu and then the Save game gui, do other client's know what I'm doing with them? Does it send the preview images to other clients when I select a save game in the list? Do other client's know whether I'm typing a chat message until I've actually sent it? If not, why do you want to force modders to use this system?Rseding91 wrote:GUIs are part of the game state. If the mod is able to read from the GUI then it is changes the game state.
Mods have read/write access to the GUI elements they and other mods create. Because they have read access the GUIs mods create have to be persisted between saves.Zeblote wrote:They shouldn't be, it makes no sense. If I open the escape menu and then the Save game gui, do other client's know what I'm doing with them? Does it send the preview images to other clients when I select a save game in the list? Do other client's know whether I'm typing a chat message until I've actually sent it? If not, why do you want to force modders to use this system?