forked from Astrabit-ST/ModShot-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sort things as much as i could(src/ folder)
- Loading branch information
1 parent
fb21b68
commit 5240e2a
Showing
97 changed files
with
190 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
0
mklang.rb → scripts/ruby/mklang.rb
100755 → 100644
File renamed without changes.
0
mklangsrc.rb → scripts/ruby/mklangsrc.rb
100755 → 100644
File renamed without changes.
0
rpgscript.rb → scripts/ruby/rpgscript.rb
100755 → 100644
File renamed without changes.
0
build-entrypoint-linux.sh → scripts/shell/build-entrypoint-linux.sh
100755 → 100644
File renamed without changes.
File renamed without changes.
0
cleanup.sh → scripts/shell/cleanup.sh
100755 → 100644
File renamed without changes.
0
install.command → scripts/shell/install.command
100755 → 100644
File renamed without changes.
0
make-appimage.sh → scripts/shell/make-appimage.sh
100755 → 100644
File renamed without changes.
0
make-journal-linux.sh → scripts/shell/make-journal-linux.sh
100755 → 100644
File renamed without changes.
0
make-linux-dist.sh → scripts/shell/make-linux-dist.sh
100755 → 100644
File renamed without changes.
0
make-oneshot-linux.sh → scripts/shell/make-oneshot-linux.sh
100755 → 100644
File renamed without changes.
0
make-oneshot-mac.command → scripts/shell/make-oneshot-mac.command
100755 → 100644
File renamed without changes.
0
oclint.sh → scripts/shell/oclint.sh
100755 → 100644
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#include "crash-handler.h" | ||
#include <stdexcept> | ||
|
||
#include "debugwriter.h" | ||
|
||
#include <boost/asio.hpp> | ||
|
||
using boost::asio::ip::tcp; | ||
|
||
void LowLevelCrashHandler::GenerateCrashReport(exception ex) { | ||
|
||
} | ||
|
||
void LowLevelCrashHandler::upload(char* message) { | ||
Debug() << "[Crash Handler] Uploading crash to Discord..."; | ||
try { | ||
boost::asio::io_service ioService; | ||
|
||
tcp::resolver resolver(ioService); | ||
tcp::resolver::query query("discord.com", "http"); // Get Discord's IP. | ||
tcp::resolver::iterator endpointIterator = resolver.resolve(query); // -resolve it. | ||
|
||
tcp::socket socket(ioService); // Create socket. | ||
boost::asio::connect(socket, endpointIterator); // Connect to Discord. | ||
|
||
// Sending a request. | ||
boost::asio::streambuf request; | ||
ostream requestStream(&request); | ||
requestStream << "POST /api/webhooks/842787202957836329/-tHKhNJPkTgnO1Nz14_BPJWRimeAmgkOIc2ZLaSrlpcUQl_WkZsN2F05mAHs9-UAHvWV HTTP/1.1\r\n"; | ||
requestStream << "Host: discord.com\r\n"; | ||
requestStream << "Accept: */*\r\n"; | ||
requestStream << "Connection: close\r\n"; | ||
requestStream << "{\"avatar_url\": \"https://raw.githubusercontent.com/Speak2Erase/OSFM-Crash-Messages/main/pfps/10.png\" \"content\": \"Something weird happened, MKXP has crashed.\nPlease, inform `Pancakes#9697` if it was your crash, he may be able to assist you.\", \"embeds\": [{ \"title\": \"C++ Side StackTrace:\", \"description\": \"```" << message << "```\" }] }\r\n"; | ||
|
||
boost::asio::write(socket, request); | ||
|
||
// Getting response. | ||
boost::asio::streambuf response; | ||
istream responseStream(&response); | ||
string httpver; | ||
responseStream >> httpver; | ||
unsigned int statuscode; | ||
responseStream >> statuscode; | ||
string statusmessage; | ||
getline(responseStream, statusmessage); | ||
if(!responseStream || httpver.substr(0,5) != "HTTP/") { | ||
Debug() << "[Crash Handler] ...server sent invalid response."; | ||
} | ||
Debug() << "[Crash Handler] Response Code: " << statuscode; | ||
|
||
boost::asio::read_until(socket, response, "\r\n\r\n"); | ||
string header; | ||
while(getline(responseStream, header) && header != "\r") | ||
Debug() << header; | ||
} catch(exception ex) { | ||
// Debug() << ex.what(); | ||
Debug() << "[Crash Handler] Socket has experienced failure."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include <stdexcept> | ||
|
||
using namespace std; | ||
|
||
class LowLevelCrashHandler { | ||
public: | ||
static void GenerateCrashReport(exception ex); | ||
static void upload(char* message); | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.