Changeset 8271c78 in network-game


Ignore:
Timestamp:
Aug 1, 2013, 2:15:49 AM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
f9cb9fb
Parents:
d05086b
Message:

The client has basic log files

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • client/.gitignore

    rd05086b r8271c78  
    77gameClient
    88allegro.log
     9client.log
  • client/Client/main.cpp

    rd05086b r8271c78  
    2020#include <iostream>
    2121#include <sstream>
     22#include <fstream>
    2223#include <map>
    2324
     
    126127   bool fullscreen = false;
    127128   debugging = false;
     129   ofstream outputLog;
    128130
    129131   scoreBlue = 0;
     
    136138      return -1;
    137139   }
     140
     141   outputLog.open("client.log", ios::app);
     142   outputLog << "Started client on " << getCurrentDateTimeString() << endl;
    138143
    139144   if (al_init_primitives_addon())
     
    496501   al_destroy_display(display);
    497502   al_destroy_timer(timer);
    498  
     503
     504   outputLog << "Stopped client on " << getCurrentDateTimeString() << endl;
     505   outputLog.close();
     506
    499507   return 0;
    500508}
  • common/Common.cpp

    rd05086b r8271c78  
    66#if defined WINDOWS
    77   #include <Windows.h>
    8 #elif defined LINUX
    9    #include <ctime>
    108#endif
     9
     10#include <ctime>
    1111
    1212using namespace std;
     
    4242
    4343string getCurrentDateTimeString() {
     44   ostringstream timeString;
     45
    4446   time_t millis = time(NULL);
    4547   struct tm *time = localtime(&millis);
    4648
    47    ostringstream timeString;
    4849   timeString << time->tm_hour << ":" << time->tm_min << ":"<< time->tm_sec << " " << (time->tm_mon+1) << "/" << time->tm_mday << "/" << (time->tm_year+1900);
    4950
Note: See TracChangeset for help on using the changeset viewer.