Client file functions to server

So I’m working on a project, think something similar to GTerminal by Chessnut.

I setup a system where people can connect to ‘addresses’ basically just checks to see if there is a folder serverside with the same name as the address, and all the contents inside it are listed as files that can be read.

Now, I hit a brick wall; as I was doing something else; it came to me that this is all well and good for singleplayer; but if this is multiplayer, the server (DATA) files are stored in a different place to the client (DATA) files.

I’m looking for a way to run file functions serverside from a client then return the data to the client, I’ve tried using the net library for it however it doesn’t work well as you cant directly return data from a net message and then setting variables serverside for the client to read has its own issues with timing.

I am really hoping someone can tell me that there is a way to read files / search for files from clientside > serverside.

Any ideas? Thanks.

No, that’s not how it works.

Send a net message to retrieve contents of a file to the server from client
Validate if the file accessed is correct, if yes, send a net message back to player using another net message. ( or multiple if the file size is too big )

I’ve already tried net messages via that method however I ran into some issues. I believe I’ve thought of a way to fix it and will post more tomorrow. Thanks for the reply Robot

I’m very stubborn, I’m always reluctant to give up on my own methods because I always think I know what I’m doing; in this case, I was very wrong. I’d like to apologise and say thank you to you @Robotboy655 after experimenting with it for some time, I found that it was just my belief that it would not work combined with me being in a rush that led me to think it would not work via the way you posted. Again, I’d like to apologise for being such a stubborn asshole and thank you :slight_smile: you’ve helped me greatly.