Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 56

Thread: Hardware bans

  1. #41
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    nvm, bugged code.
    Last edited by guiismiti; 5th January 2014 at 21:52.
    set logfile 2

  2. #42
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Sorry to bump this old thread
    Code:
    player setClientCvar( "autologin" , "openscriptmenu login Serthy|unsafepass" ); //load this to script
    player setClientCvar( "username" , "Serthy" ); //showed on login menu
    player setClientCvar( "password" , "unsafepass" ); //showed on login menu
    player setClientCvar( "autoexec" , "vstr autologin" ); //autoexec executes on connect
    player execClientCommand( "writeconfig save.cfg" ); //save the config clientside
    How does this work exactly? I find it hard to understand with the commands behind it.

  3. #43
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Code:
    player setClientCvar( "autologin" , "openscriptmenu login Jane Doe|pw1234" );
    sets a variable (could be any name of your choice), which opens a menu called login
    and passes username|password which can be caught in script via player waittill( "menuresponse" , menu , response );
    and parsed afterwards

    Code:
    player setClientCvar( "username" , "Jane Doe" );
    player setClientCvar( "password" , "pw1234" );
    those variables (name of your choice) have a dummy variable at first,
    but those will be reset after you parsed the menuresponse from above
    those also will be displayed in your login-menu
    and are also placeholders to save the username + password in a config later

    Code:
    player setClientCvar( "autoexec" , "vstr autologin" );
    autoexec is a special command in CoD2 (maybe also later and earlier CoD's)
    when a player connects to a server, this command will automatically be executed (hence the name)
    so it calls vstr cvarname:
    vstr transforms a string which is in cvarname into a config-command
    and therefore will execute what is stored in autoexec, which is the menuresponse
    and therefore the menuresponse is triggered in the frame the player connects to the server

    You have to parse the menuresponse and save its data on the server (libcod, files)

    after your player is logged in or registered, you have to set
    what will later be saved in the autologin-cvar

    Code:
    player setClientCvar( "autologin" , "openscriptmenu " + player.username + "|" + player.password );
    // maybe not needed, shuld already be set via menu, but it doesnt hurt to set them again
    player setClientCvar( "username" , player.username );
    player setClientCvar( "password" , player.password );
    (im not 100% sure about this part anylonger)

    Code:
    player execClientCommand( "writeconfig save.cfg" );
    Then you save/create/orverride a new config, which is stored on the clients pc (not the server),

    when a client connects to the server, you have to let him execute the safe.cfg
    either from within your login menu ( onOpen { exec safe.cfg } ) or via the well known execClientCommand() workaround

    so the next time he connects, the autologin is set, and does its job on connect

    if the player deletes this safe.cfg for some reason (reinstall, removed manual),
    he has to manually type in its username/password again




    so this is somewhat like cookies in a browser..

    This is all I remember for now..


    So this is what happens when a new user registers:

    - connects to the server
    - doesn't yet have a autoexec command in its config, nothing gets called
    - you let the player execute his safe.cfg, which does not yet exists, nothing happens
    - player registers himself, you safe the input on the server
    - you set the autologin-cvar accordingly
    - you create the safe.cfg

    Now if the player connects again on the server:

    - the autoexec variable is set and gets called
    - it fires the vstr command that calls the openscriptmenu one
    - now you get a menuresponse and can grab the login information and parse it
    - login the player automatically

    - (excute the safe.cfg, so autologin gets set if not already)
    Last edited by serthy; 5th October 2015 at 13:46. Reason: [c]inline code[/c], my O-key is broken, there might be some missing O's

  4. The Following 3 Users Say Thank You to serthy For This Useful Post:

    kung foo man (5th October 2015),Ni3ls (5th October 2015),YuriJurek (5th October 2015)

  5. #44
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Thanks!!
    But you cant use it to save some player variable and load it?
    For example:
    Code:
    self.admin = 1
    cant be saved and loaded via this method?

  6. #45
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by Ni3ls View Post
    Thanks!!
    But you cant use it to save some player variable and load it?
    For example:
    Code:
    self.admin = 1
    cant be saved and loaded via this method?
    You can, but its stored clientside (in the config) so every user can edit this and set admin accordingly, so its useless.
    This is meant for auto-login which is checked against on the server,
    like the Remember Password or Stay logged in in your browser...

  7. #46
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Yeah it was just an example. But how can this be achieved?

  8. #47
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by Ni3ls View Post
    Yeah it was just an example. But how can this be achieved?
    Attachment 939
    The fuck you mean?

  9. #48
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  10. #49
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Quote Originally Posted by serthy View Post
    Attachment 939
    The fuck you mean?
    Saving a player variable like self.admin=1 into a cfg on the players pc and then load it

  11. #50
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    yes, see
    10char
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •