Skip to content

Commit f17a7ed

Browse files
committed
Begin unwinding the ClientSource/ directory.
1 parent a6b8f2e commit f17a7ed

File tree

17 files changed

+81
-108
lines changed

17 files changed

+81
-108
lines changed

ClientSource/Connection/PABotBaseConnection.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include "Common/CRC32.h"
88
#include "Common/SerialPABotBase/SerialPABotBase_Protocol.h"
9-
#include "ClientSource/Libraries/Logging.h"
109
#include "ClientSource/Libraries/MessageConverter.h"
1110
#include "BotBaseMessage.h"
1211
#include "PABotBaseConnection.h"

ClientSource/Connection/PABotBaseConnection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
#include <memory>
1818
#include <deque>
19+
#include "Common/Cpp/SerialConnection/StreamInterface.h"
1920
#include "Common/SerialPABotBase/SerialPABotBase_Protocol.h"
2021
#include "BotBase.h"
2122
#include "MessageSniffer.h"
22-
#include "StreamInterface.h"
2323

2424
namespace PokemonAutomation{
2525

ClientSource/Libraries/Logging.cpp

Lines changed: 0 additions & 67 deletions
This file was deleted.

ClientSource/Libraries/Logging.h

Lines changed: 0 additions & 24 deletions
This file was deleted.

Common/Cpp/PanicDump.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
#include "Common/Cpp/Exceptions.h"
8-
#include "ClientSource/Libraries/Logging.h"
98
#include "PrettyPrint.h"
109
#include "PanicDump.h"
1110

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* Serial Connection
2+
*
3+
* From: https://github.com/PokemonAutomation/
4+
*
5+
*/
6+
7+
#include <iostream>
8+
#include "Common/Cpp/Time.h"
9+
#include "SerialConnection.h"
10+
11+
namespace PokemonAutomation{
12+
13+
14+
std::mutex serial_logging_lock;
15+
16+
17+
void serial_debug_log(const std::string& msg){
18+
std::lock_guard<std::mutex> lg(serial_logging_lock);
19+
std::cout << current_time_to_str() << " - " << msg << std::endl;
20+
}
21+
22+
23+
}
File renamed without changes.

ClientSource/Connection/SerialConnectionPOSIX.h renamed to Common/Cpp/SerialConnection/SerialConnectionPOSIX.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
namespace PokemonAutomation{
2222

23+
void serial_debug_log(const std::string& msg);
24+
25+
26+
2327
class SerialConnection : public StreamConnection{
2428
public:
2529
// UTF-8

ClientSource/Connection/SerialConnectionWinAPI.h renamed to Common/Cpp/SerialConnection/SerialConnectionWinAPI.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@
1212
#include <thread>
1313
#include <windows.h>
1414
#include "Common/Compiler.h"
15+
#include "Common/Cpp/Time.h"
1516
#include "Common/Cpp/Exceptions.h"
1617
#include "Common/Cpp/Unicode.h"
1718
#include "Common/Cpp/PanicDump.h"
1819
#include "Common/Cpp/Concurrency/SpinLock.h"
19-
#include "Common/Cpp/Concurrency/SpinPause.h"
20-
#include "ClientSource/Libraries/Logging.h"
20+
//#include "Common/Cpp/Concurrency/SpinPause.h"
2121
#include "StreamInterface.h"
2222

2323
namespace PokemonAutomation{
2424

25+
void serial_debug_log(const std::string& msg);
26+
27+
28+
2529
class SerialConnection : public StreamConnection{
2630
public:
2731
// UTF-8
@@ -121,7 +125,7 @@ class SerialConnection : public StreamConnection{
121125
void process_error(const std::string& message){
122126
m_errors++;
123127
if (m_errors < 100 || m_errors % 1000 == 0){
124-
log(message);
128+
serial_debug_log(message);
125129
}
126130

127131
std::string clear_error;
@@ -134,7 +138,7 @@ class SerialConnection : public StreamConnection{
134138
}
135139

136140
if (m_errors < 100 || m_errors % 1000 == 0){
137-
log(clear_error);
141+
serial_debug_log(clear_error);
138142
}
139143
}
140144

File renamed without changes.

0 commit comments

Comments
 (0)