Jump to content

What breaks a mod in multiplayer


ShuiYin

Recommended Posts

Hello i am new to this multiplayer thing and i am not sure what is causing some mod to not work in a multiplayer situation. I really dont want to accidentally make a mod useless in multiplayer just because of my lack of modding knowledge.

 

also is there a way to let say limit a code to only work for server admins too? like because recently some members asked for an option to turn off some of my mod features which if i were to implement will theoretically cause a conflict in the game (because people might set it at different settings eg. some players set to active and some other players set it to not active )

 

I hope some of the senior modders and experts can shed some light on how this works

 

Thanks before and sorry for asking too many questions

Link to comment
Share on other sites

OTTOMH:

- forgetting to transmit*ToClient / transmit*ToServer

- not using sendCommand when you should (hard to point down, really, basically every time you have an event that the other can't know about but acting on it on the wrong side anyway)

- assuming any data that is on a Lua object to be persistent, always use moddata for that (which is autosaved!). If you need data to be persistent across saves, but you don't have a java object to pin it on, it is generally done by pinning it onto the GameTime object

 

That's all that I can recall from memory right now.

Link to comment
Share on other sites

OTTOMH:

- forgetting to transmit*ToClient / transmit*ToServer

- not using sendCommand when you should (hard to point down, really, basically every time you have an event that the other can't know about but acting on it on the wrong side anyway)

- assuming any data that is on a Lua object to be persistent, always use moddata for that (which is autosaved!). If you need data to be persistent across saves, but you don't have a java object to pin it on, it is generally done by pinning it onto the GameTime object

 

That's all that I can recall from memory right now.

 

looks like its a rough and winding road ahead :P . have to learn a lot of things just to understand your reply Lol. Well at least i have just understood ModData today so its one out of the list.

 

I hooked the modData to getPlayer data (inexperienced me) hooking it to the gametime is a much better solution and multiplayer friendly too i think

 

Thanks a lot mr BlindCoder i dunno how i can continue modding without your shared wisdom :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...