Obligatory ascii art introduction

master
Nicole Collings 2019-12-10 15:44:58 -08:00
parent 79cb99638b
commit 0143979e12
5 changed files with 25 additions and 5 deletions

View File

@ -28,13 +28,13 @@ std::map<std::string, std::string> parseArgs(int argc, char* argv[]) {
std::string first = (equals == -1) ? arg : arg.substr(0, equals);
if (args.count(first)) {
std::cout << Log::err << "Duplicate argument " << first << "." << Log::endl;
std::cerr << "Duplicate argument '" << first << "'" << std::endl;
exit(1);
}
if (equals == -1) args.emplace(first, "");
else {
if (equals == arg.length() - 1) {
std::cout << Log::err << "Empty equals-assignment " << first << "." << Log::endl;
std::cerr << "Empty argument '" << first << "'" << std::endl;
exit(1);
}
args.emplace(first, arg.substr(equals + 1, arg.length()));
@ -76,6 +76,18 @@ int StartGame(int argc, char* argv[]) {
}
}
// Obligatory ASCII Art is obligatory.
Log::clear();
std::cout << "\n"
"\t\t▒███████▒▓█████ ██▓███ ██░ ██ ▄▄▄ \n"
"\t\t▒ ▒ ▒ ▄▀░▓█ ▀ ▓██░ ██▒▓██░ ██▒▒████▄ \n"
"\t\t░ ▒ ▄▀▒░ ▒███ ▓██░ ██▓▒▒██▀▀██░▒██ ▀█▄ \n"
"\t\t ▄▀▒ ░▒▓█ ▄ ▒██▄█▓▒ ▒░▓█ ░██ ░██▄▄▄▄██ \n"
"\t\t▒███████▒░▒████▒▒██▒ ░ ░░▓█▒░██▓ ▓█ ▓██▒\n"
"\t\t░▒▒ ▓░▒░▒░░ ▒░ ░▒▓▒░ ░ ░ ▒ ░░▒░▒ ▒▒ ▓▒█░\n"
"\t\t░ ▒ ▒ ░ ▒ ░ ░ ░░▒ ░ ▒ ░▒░ ░ ▒ ▒▒ ░\n"
"\t\t ░ ░ ░ ░ ░░ ░ ░ ░ ▒ \n" << std::endl;
//Start the game
switch (mode) {
default: {

View File

@ -20,7 +20,9 @@ Client::Client(uptr<LocalServerInstance> localServer, glm::vec2 dimensions) :
}
void Client::init() {
if (localServer != nullptr) localServer->start();
std::cout << Log::info << "Starting Zepha Client." << Log::endl;
// if (localServer != nullptr) localServer->start();
std::unique_ptr<Scene> scene = std::make_unique<MainMenuScene>(state);
sceneManager.setScene(std::move(scene));

View File

@ -16,6 +16,8 @@ Server::Server(const std::string& path, unsigned short port, const std::string&
world.init();
config.init();
std::cout << Log::info << "Server started successfully." << Log::endl;
std::cout << Log::info << "Listening for clients." << Log::endl;
while (alive) update();
}

View File

@ -12,9 +12,13 @@ namespace Log {
static const char* info = "[INFO] ";
static const char* err = "[ERR!] ";
static const char* endl = "\n";
static void clear() { auto s = system("cls"); }
#else
static const char* info = "\033[36m[INFO] ";
static const char* err = "\033[31m[ERR!] ";
static const char* endl = "\033[0m\n";
static void clear() { auto s = system("clear"); }
#endif
}
}

View File

@ -37,7 +37,7 @@ void NetHandler::initServer(unsigned short port, short max_clients) {
return;
}
std::cout << Log::info << "Server Started. Listening for clients." << Log::endl;
std::cout << Log::info << "Starting Zepha Server." << Log::endl;
}
void NetHandler::initClient(Address hostAddress, int attempts, int timeout) {