diff options
Diffstat (limited to 'src/core/gameconnection.cc')
-rw-r--r-- | src/core/gameconnection.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc index ba18bd5..982ac7d 100644 --- a/src/core/gameconnection.cc +++ b/src/core/gameconnection.cc @@ -8,6 +8,7 @@ #include <sstream> #include "sys/sys.h" +#include "filesystem/filesystem.h" #include "core/cvar.h" #include "core/gameconnection.h" #include "core/net.h" @@ -62,7 +63,28 @@ GameConnection::GameConnection(std::string const &connectionstr) game_players.push_back(localplayer()); set_playerlist_timestamp(timestamp()); - + + // generate player GUID + // we do it here because offline play doesn't require it + if (!localplayer()->guid().size()) { + + // read keys.ini + + // write keys.ini + std::string filename(filesystem::homedir()); + filename.append("keys.ini"); + + std::ofstream ofs(filename.c_str()); + if (!ofs.is_open()) { + con_warn << "Could not write " << filename << std::endl; + } else { + ofs << "; keys.ini - osirion client identification" << std::endl; + ofs << "; DO NOT EDIT OR DELETE THIS FILE" << std::endl; + ofs << "; If you do you will not be able to use existing characters on a remote server" << std::endl; + ofs.close(); + } + } + connection_running = true; } |