+ Reply to Thread
Results 1 to 7 of 7

Thread: Client -> Server file.Write

  1. #1
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,662
    Blog Entries
    1

    Default Client -> Server file.Write

    I'm kind of lost on the gmod lua wikipedia. How would I set up a client script so that they could write files to a specific directory on my server?

    For example: A player opens a derma menu on my server, I want them to be able to read and write text files pertaining to one specific directory such as "data/myfiles/" on the server

  2. #2
    Wirererer cooldudetb's Avatar
    Join Date
    Sep 2008
    Location
    UK
    Posts
    253

    Default Re: Client -> Server file.Write

    Maybe you should have a look at Adv. Duplicator. It seems to do that pretty well.
    [E2] Extended Timers

    Bulls pro-tip of the day:
    When you honestly think that Led3=1,0,1,0,1,0,1 can make a light blink, stop trying to make an OS and do something easier.

  3. #3
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,662
    Blog Entries
    1

    Default Re: Client -> Server file.Write

    Quote Originally Posted by cooldudetb View Post
    Maybe you should have a look at Adv. Duplicator. It seems to do that pretty well.
    Dont you think it would be easier to get a simplifed answer than browse through several lines of code though?

    Edit: Adv duplicator serverside file is 3661 lines long, no thanks.
    Last edited by Drunkie; 02-20-2010 at 01:53 AM.

  4. #4
    Wirererer silverman's Avatar
    Join Date
    Aug 2008
    Posts
    121

    Default Re: Client -> Server file.Write

    Use concommands.

  5. #5
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,662
    Blog Entries
    1

    Default Re: Client -> Server file.Write

    Can anyone more clearly define an answer?
    I'm confused, I understand that the concommand.Add works on both client and server, but what should I use it on for this specific task. A friend suggested using a datastream. Well I guess the best way to learn is to test it out, so I guess I'll do that.

  6. #6
    Wirererer Riddler's Avatar
    Join Date
    Nov 2007
    Location
    /dev/null
    Posts
    257

    Default Re: Client -> Server file.Write

    I would agree that datastream is the way to go. The way I would have the system set up is:

    1. client requests the list from the server
    2. server goes to data/drunkie'smod/<clients steam id> (May not be allowed to use _: in folder names so they might need replaced)
    3. server loads a file list using one of the file commands and then uses datastream to give the list to the client
    4. client gets the list and shows it to the user so they can pick what file they want then they request the file
    5. (repeat 2-3 with the file)
    6. client does whatever to the file (have it save localy if you want)
    7. sends to the server with uploads to the directory under there steamID

    To request the list and files I would just use concommand.Add on the server then have the client call it, the server can use it to get the players steamID then.
    To get the list and files just a datastream hook on the client



    Just the way I'd do it anyway hope it helps Also if you look at MoonGate code it should be alot smaller than adv dupe and have the info you want.
    Last edited by Riddler; 02-20-2010 at 06:59 AM.

  7. #7
    ◕␣◕ McLovin's Avatar
    Join Date
    Sep 2008
    Location
    Batman, Turkey
    Posts
    2,346
    Blog Entries
    3

    Default Re: Client -> Server file.Write

    Drunkie I told you to use datastream yesterday. >.< Look at my file functions code, its < 200 lines (I think) and its a good example, except that it doesn't write on the server, but that is self explanatory.
    Anticept - HP you are terrible at trolling. Always have been. Leave it up to the pros like Jat.
    Black Phoenix - Actually cunt goes into bullshit. Bullshit does not fit in cunt.
    Drunkie - Logically, Jat Goodwin must be a fist pumping guido.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots