About Store Forum Documentation Contact



Post Reply 
Server Should save last information
Author Message
Dwight Offline
Member

Post: #1
Server Should save last information
Code:
void Shut()
{
    File file;
    file.write("C:/Esenthel MMO/Storage/Info/Information.txt");
    file.putInt(Server.clients_peak);

   Server.del(); // delete server and clients before deleting worlds
}

The above code can be found in Main.cpp from the Esenthel MMO server, except for the File commands.

It succesfully creates a .txt file in the mentioned folder, but when I open the folder, I get this symbol, and not a number "[]" (but then connected and smaller).

When the Server.clients_peak is 0, it says nothing in the file, except for a few spaces, and when it is 1, it writes that symbol.

How would I fix this small problem?

Thanks in advance!

SnowCloud Entertainment - We are recruiting!
http://www.sc-entertainment.com
01-27-2011 02:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Server Should save last information
File saves binary data
probably what you want is FileText, check for its tutorials
01-27-2011 02:40 PM
Find all posts by this user Quote this message in a reply
Dwight Offline
Member

Post: #3
RE: Server Should save last information
Code:
void Shut()
{
    {
      FileText f; // FileText object
      f.write  ("C:/Esenthel MMO/Storage/Info/Information.txt");
      f.put    ("Accounts That Were Connected Before Shutdown = ",Server.clients_peak);
    }

    Server.del(); // delete server and clients before deleting worlds
    OSLaunch("C:/Esenthel MMO/Storage/Info/Information.txt");
}

If someone needs it too, this works just sweet smile

Thanks Esenthel!

SnowCloud Entertainment - We are recruiting!
http://www.sc-entertainment.com
01-27-2011 02:51 PM
Find all posts by this user Quote this message in a reply
Post Reply