AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Upload file from client (https://forums.alliedmods.net/showthread.php?t=56179)

kurian 06-08-2007 05:19

Upload file from client
 
I want the client to be able to save his CFG file on the server.
http://forums.alliedmods.net/showthr...935#post486935
How do I upload a file from the client side?

If thats not possible then can I atleast ask them to exec the cfg file and capture all the commands sent to the server and write the file on the server side ?

_Master_ 06-08-2007 05:50

Re: Upload file from client
 
I don't think that would work. Commands like "bind", "alias", etc WON'T be sent to the server as they are handled client-side.

hlstriker 06-08-2007 12:59

Re: Upload file from client
 
I don't think any of your question is possible.

[offtopic]The image in your sig is not slow connection friendly at all...[/offtopic]

stupok 06-08-2007 14:16

Re: Upload file from client
 
This is definitely doable. However, I can't figure out a way to send information from the client to the server that isn't incredibly annoying.

If you just say each line of your cfg file, that can be captured and recorded. Maybe you could do a setinfo, like setinfo crap "lots of text here" but I'm sure there's a limit to how many characters can be in the setinfo.

pRED* 06-08-2007 17:38

Re: Upload file from client
 
What about

setinfo numoflines 8
setinfo line0 "somestuff goes here"
setinfo line1 "more stuff"
..
..
setinfo line7 "end of stuff's"

And then on server side create a for loop
Code:
new String[8] get_user_info(id,"numofline",String,7) new num=str_to_num(String) for (new i=0; i<num; i++) {       new tempstring[100]       new linenum[10]       format(linenum,9,"line%i",i)       get_user_info(id,linenum,tempstring,99)       //do stuff with line here }

_Master_ 06-08-2007 19:13

Re: Upload file from client
 
Then you should be prepared for "Info string length exceeded" !!!
Oh, and another thing: How do you suppose those setinfo values would be filled ?!?

pRED* 06-08-2007 19:40

Re: Upload file from client
 
Well I was hoping that stupok had an answer for that.. I was just expanding on what he said..

stupok 06-08-2007 21:48

Re: Upload file from client
 
Quote:

Originally Posted by stupok69 (Post 487081)
... I can't figure out a way to send information from the client to the server that isn't incredibly annoying. ...


kurian 06-08-2007 23:15

Re: Upload file from client
 
Quote:

Originally Posted by pRED* | NZ (Post 487155)
What about

setinfo numoflines 8
setinfo line0 "somestuff goes here"
setinfo line1 "more stuff"
..
..
setinfo line7 "end of stuff's"


That wont be necessary as I only need to get the clients cvars.
I'll just put everysingle CVAR i can think of in a 2 dimentional string array.
And loop through it with get_user_info and write it as a file on the server.

Anyone have a list of everysingle cvar ?

kurian 06-08-2007 23:15

Re: Upload file from client
 
Let me put it this way instead... Is therer any cvar that ISNT in config.cfg ?

And what about commands. Things like +mlook and bind ? How do i get the bind status of the keys ?


All times are GMT -4. The time now is 10:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.