[quote=“aster2013”][code]void ExistenceClient::LoadAccount(void)
{
String accountconfigfilename=ACCOUNTFILE;
ResoruceCache* cache = GetSubsystem<ResoruceCache>();
XMLFile* accountconfig = cache->GetResource<XMLFile>(accountconfigfilename);
// ...
}[/code][/quote]
I tried the code it seems to work. I am trying the opposite instead of reading now writing. I’m getting a compiliation error. I understand the XML is in a resource path. From what I see, there’s 2 or 3 ways to write a file so I think I’m getting confused and putting it all together somehow.
This is the response code. I am thinking of keeping the format xml but making all the account information highly encrypted.
[quote]// load account info
void ExistenceClient::SaveAccount(void)
{
String accountconfigfilename=ACCOUNTFILE;
ResourceCache* cache = GetSubsystem<ResourceCache>();
XMLFile * accountconfig = cache->GetResource<XMLFile>(accountconfigfilename);
XMLElement configElem = accountconfig -> CreateRoot("account");
XMLElement idElement = configElem.CreateChild("uniqueid");
XMLElement emailElement= configElem.CreateChild("email");
XMLElement firstnameElement = configElem.CreateChild("firstname");
XMLElement middlenameElement = configElem.CreateChild("middlename");
XMLElement lastnameElement = configElem.CreateChild("lastname");
XMLElement passwordElement = configElem.CreateChild("password");
idElement.SetString("uniqueid", "test");
emailElement.SetString("email", "test");
firstnameElement.SetString("firstname", "test");
middlenameElement.SetString("middlename", "test");
lastnameElement.SetString("lastname", "test");
passwordElement.SetString("passord", "test");
accountconfig -> Save(File(cache->GetResourceFileName<XMLFile>(accountconfigfilename), FILE_WRITE));
return;
}
[/quote]