2019-11-24 14:35:38 +01:00
|
|
|
#include <wups.h>
|
|
|
|
#include "utils/TcpReceiver.h"
|
2020-06-27 12:18:26 +02:00
|
|
|
#include <whb/log_udp.h>
|
2020-08-09 18:14:30 +02:00
|
|
|
#include <coreinit/cache.h>
|
|
|
|
#include <sysapp/launch.h>
|
2019-11-24 14:35:38 +01:00
|
|
|
|
|
|
|
WUPS_PLUGIN_NAME("Wiiload");
|
|
|
|
WUPS_PLUGIN_DESCRIPTION("Wiiload Server");
|
|
|
|
WUPS_PLUGIN_VERSION("0.1");
|
|
|
|
WUPS_PLUGIN_AUTHOR("Maschell");
|
|
|
|
WUPS_PLUGIN_LICENSE("GPL");
|
|
|
|
|
|
|
|
WUPS_USE_WUT_CRT()
|
|
|
|
|
2021-01-10 18:22:17 +01:00
|
|
|
TcpReceiver *thread = nullptr;
|
2019-11-24 14:35:38 +01:00
|
|
|
|
|
|
|
/* Entry point */
|
|
|
|
ON_APPLICATION_START(args) {
|
2020-06-27 12:18:26 +02:00
|
|
|
WHBLogUdpInit();
|
2021-01-10 18:22:17 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Start wiiload thread");
|
2020-06-03 19:45:51 +02:00
|
|
|
thread = new TcpReceiver(4299);
|
2019-11-24 14:35:38 +01:00
|
|
|
}
|
|
|
|
|
2020-06-03 19:45:51 +02:00
|
|
|
void stopThread() {
|
2021-01-10 18:22:17 +01:00
|
|
|
if (thread != nullptr) {
|
2019-11-24 14:35:38 +01:00
|
|
|
delete thread;
|
2021-01-10 18:22:17 +01:00
|
|
|
thread = nullptr;
|
2019-11-24 14:35:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-03 19:45:51 +02:00
|
|
|
ON_APPLICATION_END() {
|
2021-01-10 18:22:17 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Kill wiiload thread");
|
2019-11-24 14:35:38 +01:00
|
|
|
stopThread();
|
2021-01-10 18:22:17 +01:00
|
|
|
}
|