Jump to content

Need Help w/ Client-Server Concept


Recommended Posts

Greetings.

 

I am trying to learn modding this game but I am having trouble with Client/Server concept. As far as I know, game and server both loads the lua files in both client and server directories. This is where my confusion starts. What is the purpose of files in server directory if it’s going to be loaded in both server and client? Let’s say I want to make (only) the server to save some data to a local file in server side. Then how I suppose to do it? Also does server have access to client side events and variables? Like I would like to trigger a function on player death only in server side and get player information, do something with it. Are those possible? If yes, could you explain to me? Thank you. 

Link to comment
Share on other sites

  • 3 weeks later...

When you play Solo, your game loads lua/server and lua/client.

When you Host a server, your game loads lua/server and lua/client.

When you Join a game Hosted by someone else, your game loads lua/client, but not lua/server.

When you Join a dedicated server, your game loads lua/client, but not lua/server.

The dedicated server loads lua/server, but not lua/client. (I'm not 100% sure for this one).

 

Obviously lua/shared is loaded by everyone, always.

Edited by Tchernobill
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...