@@ -101,14 +101,20 @@ DWORD WINAPI CommandHandler(void*)
101101 std::cout
102102 << std::endl
103103 << std::left << std::setw (17 ) << " IP"
104+ << std::setw (21 ) << " Connected since"
104105 << std::setw (31 ) << " Type"
105106 << std::setw (27 ) << " State"
106107 << " Match Joined (GUID)" << std::endl
107- << std::string (115 , ' -' ) << std::endl;
108+ << std::string (134 , ' -' ) << std::endl;
108109 for (const Socket* socket : Socket::GetList ())
109110 {
111+ const std::time_t connectionTime = socket->GetConnectionTime ();
112+ std::tm localConnectionTime;
113+ localtime_s (&localConnectionTime, &connectionTime);
114+
110115 std::cout
111116 << std::setw (15 ) << socket->GetAddressString () << " "
117+ << std::put_time (&localConnectionTime, " %d/%m/%Y %H:%M:%S" ) << " "
112118 << std::setw (29 ) << Socket::TypeToString (socket->GetType ()) << " " ;
113119 if (socket->GetPlayerSocket ())
114120 {
@@ -144,17 +150,23 @@ DWORD WINAPI CommandHandler(void*)
144150 {
145151 std::cout
146152 << std::endl
147- << std::left << std::setw (8 ) << " Index"
153+ << std::left << std::setw (12 ) << " Index"
148154 << std::setw (40 ) << " GUID"
155+ << std::setw (21 ) << " Created on"
149156 << std::setw (7 ) << " Type"
150157 << std::setw (25 ) << " State"
151158 << " Game" << std::endl
152- << std::string (105 , ' -' ) << std::endl;
159+ << std::string (130 , ' -' ) << std::endl;
153160 for (const auto & match : MatchManager::Get ().GetMatchesWin7 ())
154161 {
162+ const std::time_t creationTime = match->GetCreationTime ();
163+ std::tm localCreationTime;
164+ localtime_s (&localCreationTime, &creationTime);
165+
155166 std::cout
156- << std::right << std::setw (6 ) << match->GetIndex () << " "
167+ << std::right << std::setw (10 ) << match->GetIndex () << " "
157168 << std::left << match->GetGUID () << " "
169+ << std::put_time (&localCreationTime, " %d/%m/%Y %H:%M:%S" ) << " "
158170 << std::setw (7 ) << " Win7"
159171 << std::setw (25 ) << Win7::Match::StateToString (match->GetState ())
160172 << Win7::Match::GameToNameString (match->GetGame ())
@@ -163,9 +175,14 @@ DWORD WINAPI CommandHandler(void*)
163175 }
164176 for (const auto & match : MatchManager::Get ().GetMatchesWinXP ())
165177 {
178+ const std::time_t creationTime = match->GetCreationTime ();
179+ std::tm localCreationTime;
180+ localtime_s (&localCreationTime, &creationTime);
181+
166182 std::cout
167- << std::right << std::setw (6 ) << match->GetIndex () << " "
183+ << std::right << std::setw (10 ) << match->GetIndex () << " "
168184 << std::left << match->GetGUID () << " "
185+ << std::put_time (&localCreationTime, " %d/%m/%Y %H:%M:%S" ) << " "
169186 << std::setw (7 ) << " WinXP"
170187 << std::setw (25 ) << WinXP::Match::StateToString (match->GetState ())
171188 << WinXP::Match::GameToNameString (match->GetGame ())
0 commit comments