Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - drhaximus

Pages: [1]
1
Network / Re: FTP cannot download file: status is 1003
« on: March 22, 2014, 10:41:24 pm »
http://sfml-dev.org/documentation/2.1/classsf_1_1Ftp.php#a20c1600ec5fd6f5a2ad1429ab8aa5df4
Quote
localPath   Where to put to file on the local computer
I don't know if this should be more explicit. Obviously eXpl0it3r and drhaximus understand this to be an absolute path to a file, whereas in the code it is implemented as the destination directory in which to create a file with the same name as the remote file. I understood it as it was coded but I guess it can be ambiguous depending on what background you come from.

Maybe rephrasing it to "The directory in which to put the file on the local computer" might make it more clear.

So I'm supposed to specify the directory ommitting the actual file name? Like "/folder/"?

This is exactly what to do.
To fix what I was doing wrong, simply specify the directory WITHOUT the filename, so the line which downloads the file is now:

sf::Ftp::Response x=ftp.download("master.txt","");

Thanks.

2
Network / Re: FTP cannot download file: status is 1003
« on: March 22, 2014, 10:39:32 pm »
http://sfml-dev.org/documentation/2.1/classsf_1_1Ftp.php#a20c1600ec5fd6f5a2ad1429ab8aa5df4
Quote
localPath   Where to put to file on the local computer
I don't know if this should be more explicit. Obviously eXpl0it3r and drhaximus understand this to be an absolute path to a file, whereas in the code it is implemented as the destination directory in which to create a file with the same name as the remote file. I understood it as it was coded but I guess it can be ambiguous depending on what background you come from.

Maybe rephrasing it to "The directory in which to put the file on the local computer" might make it more clear.

So I'm supposed to specify the directory ommitting the actual file name? Like "/folder/"?

3
Network / Re: FTP cannot download file: status is 1003
« on: March 22, 2014, 10:06:49 am »
What they meant to say is, that it should be C:/master.txt. The back-slash is an escaping character, so writing C:\"master.txt will essentially be translated as C:"master.txt.

That's entirely irrelivant, in the post above yours I stated that I have changed it to the current directory of the executable, AKA "master.txt"

4
Network / Re: FTP cannot download file: status is 1003
« on: March 22, 2014, 08:39:39 am »
Quote
"C:\"master.txt"
Look at this string twice. Nothing's wrong? :P
I've changed this to "master.txt" etc, I've also tried creating the file in that path.

Nothing.

5
Network / Re: FTP cannot download file: status is 1003
« on: March 22, 2014, 07:20:56 am »
Maybe if you searched through the documentation a bit more, you would get a slightly more meaningful FTP response code from SFML. Numbers always have a meaning. You just have to look for them.

ftp.download("master.txt","C:\"master.txt");
Windows users really have it hard...

I've already checked there, it just says this:
Quote
InvalidFile = 1003
I'm not sure what classifies an invalid file; the server says the request is fine and everything completes as shown by the server logs.
Has anybody got any information how I can fix this InvalidFile?

6
Network / [FIXED] FTP cannot download file: status is 1003
« on: March 22, 2014, 01:26:17 am »
FIXED.
Refer to the last post for how to fix it.


Hello.
When I try to download a file from a FTP server, I'm able to connect, change directories, get files inside of current directory etc, no connection issues and whatever, but I still get a 1003 error as a status of my download. There's no string inside of getMessage() either.

Here's what I do:

sf::Ftp::Response x=ftp.download("master.txt","C:\"master.txt");
std::cout<<"FTP Download: "<<x.getStatus()<<" : "<<x.getMessage()<<"\n";

It prints:
FTP Download: 1003 :
Nothing after.

Here's the server's log of the ecounter:

Quote
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 230 Logged on
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> PWD
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 257 "/" is current directory.
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> CWD 0.12/
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 250 CWD successful. "/0.12" is current directory.
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> PASV
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 227 Entering Passive Mode (127,0,0,1,199,216)
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> TYPE I
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 200 Type set to I
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> RETR /0.12//master.txt
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 150 Connection accepted
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 226 Transfer OK
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> PWD
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 257 "/0.12" is current directory.
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> PASV
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 227 Entering Passive Mode (127,0,0,1,199,218)
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> TYPE A
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 200 Type set to A
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> NLST /0.12
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 150 Connection accepted
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 226 Transfer OK
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> QUIT
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> 221 Goodbye
(000032)3/22/2014 13:25:37 PM - update (127.0.0.1)> disconnected.

Thanks.

7
Graphics / Re: sf::Text disappearing characters [SFML 2.0]
« on: February 25, 2013, 07:14:46 pm »
@Laurent
You solved the problem! Thank you very much!

@cira
That did not help... Part of the additional information is that the font is not the problem, unless I'm reading that wrong. Yes, there is always 6 messages, but the first one is obviously the first call to addChat

@exploiter
I DID, but every thread I was able to find didn't really have any solutions, I suppose I was using google instead of the forum search  ::)

8
Graphics / Re: sf::Text disappearing characters [SFML 2.0]
« on: February 25, 2013, 07:39:38 am »
Yes, I'm sure that I'm not drawing it on a black background. If you took the time to check the additional information you would see that I'm able to see the first message without having characters missing >.>

9
Graphics / sf::Text disappearing characters [SFML 2.0]
« on: February 25, 2013, 06:15:33 am »
Hello.
I have a chat function like this...

void addChat(std::string username,int rights,std::string message) {
        std::string chat;
        if(rights>0) {
                chat="[ADMIN] "+username+": "+message;
        }
        else {
                chat=username+": "+message;
        }
        std::string tempChat[6];
       
        for(int i=0;i<=5;i++) {
                tempChat[i]=chatHistory[i].getString();
        }
        chatHistory[0].setColor(sf::Color::Red);
        chatHistory[0].setString(chat);
        chatHistory[1].setString(tempChat[0]);
        chatHistory[2].setString(tempChat[1]);
        chatHistory[3].setString(tempChat[2]);
        chatHistory[4].setString(tempChat[3]);
        chatHistory[5].setString(tempChat[4]);
}

And an initialize function like this...

void chatInit() {
        chatFont.loadFromFile("interfaces/trebucbd.ttf");
        for(int i=0;i<=5;i++) {
                chatHistory[i].setFont(chatFont);
                chatHistory[i].setColor(sf::Color::Black);
                chatHistory[i].setCharacterSize(16);
                chatHistory[i].setString("a");
                chatHistory[i].setPosition(25,i*25+20);
        }
        addChat("SERVER",1,"Welcome to the server!");
}

Then I draw it like this...

void drawChat(sf::RenderWindow& window) {
        for(int i=0;i<=5;i++) {
                window.draw(chatHistory[i]);
        }
}

Before offering solutions, please read this additional information:
  • The text does not lack any characters, in the std::string format, there are no problems with the strings.
  • The text does not continue to work after the initial "Welcome to the server!" message.
  • The font is not the problem, I have tried multiple.
  • I am using SFML 2.0 on Windows 7, compiling with Visual C++ 2010
Thanks, all!

Pages: [1]
anything