Sign in to follow this  
Followers 0
Nanard

Onautoitexit() And Inetget

2 posts in this topic

#1 ·  Posted (edited)

Well, weird problem here :

I need to update a remote server file when I quit my server program, in case I forget to click on the disconnect button.

So I duplicate the function linked to this button into the OnAutoItExit() function :

Func OnAutoItExit()
  ;download the current server list
    $file_lobby = InetGet("http://myserver/lobby.txt", @ScriptDir & "\lobby.txt", 1, 0)
  ;update the server list locally
    IniWrite (@ScriptDir & "\lobby.txt", GuiCtrlRead($input_nickname), "Active","No")
  ;upload the updated server list
    $name_file = "\lobby.txt"
    $Open = _FTPOpen("MyFTP")
    $Conn = _FTPConnect($Open, "myFTP", "login", "password)
    If $Conn = 0 Then
    MsgBox(48, $txt_ftp_problem , $txt_ftp_diagnostic1)
    $Ftpc = _FTPClose($Open)
    Else
    $Ftpp = 0
    $Ftpp = _FtpPutFile($Conn, @ScriptDir & "\lobby.txt", "remote_path" )
    If  $Ftpp = 1 Then
    Else
        MsgBox(48,$txt_ftp_problem, $txt_ftp_diagnostic2)
    EndIf
    $Ftpc = _FTPClose($Open)
    EndIf
EndFunc

It seems the InetGet function is porked when called inside the OnAutoItExit function : it returns an empty file each and everytime... though the remote file is not empty at all...

Running 1.1.118 beta

Any idea?

Edited by Nanard

Share this post


Link to post
Share on other sites



Fixed with 1.1.124 beta, thanks... :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0