-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run format, use .hpp so github shows more of c++ (*cough* stadust)
- Loading branch information
Showing
17 changed files
with
1,004 additions
and
925 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
--- | ||
Language: Cpp | ||
# BasedOnStyle: LLVM | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveMacros: false | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: Right | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
AllowAllArgumentsOnNextLine: true | ||
AllowAllConstructorInitializersOnNextLine: true | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortBlocksOnASingleLine: Never | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: All | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: MultiLine | ||
BinPackArguments: true | ||
BinPackParameters: true | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: false | ||
AfterControlStatement: false | ||
AfterEnum: false | ||
AfterFunction: false | ||
AfterNamespace: false | ||
AfterObjCDeclaration: false | ||
AfterStruct: false | ||
AfterUnion: false | ||
AfterExternBlock: false | ||
BeforeCatch: false | ||
BeforeElse: false | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeBraces: Attach | ||
BreakBeforeInheritanceComma: false | ||
BreakInheritanceList: BeforeColon | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BreakConstructorInitializers: BeforeColon | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 80 | ||
CommentPragmas: '^ IWYU pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DeriveLineEnding: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
IncludeBlocks: Preserve | ||
IncludeCategories: | ||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' | ||
Priority: 2 | ||
SortPriority: 0 | ||
- Regex: '^(<|"(gtest|gmock|isl|json)/)' | ||
Priority: 3 | ||
SortPriority: 0 | ||
- Regex: '.*' | ||
Priority: 1 | ||
SortPriority: 0 | ||
IncludeIsMainRegex: '(Test)?$' | ||
IncludeIsMainSourceRegex: '' | ||
IndentCaseLabels: false | ||
IndentGotoLabels: true | ||
IndentPPDirectives: None | ||
IndentWidth: 2 | ||
IndentWrappedFunctionNames: false | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCBinPackProtocolList: Auto | ||
ObjCBlockIndentWidth: 2 | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakTemplateDeclaration: 10 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
PointerAlignment: Right | ||
ReflowComments: true | ||
SortIncludes: true | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyBlock: false | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInConditionalStatement: false | ||
SpacesInContainerLiterals: true | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
SpaceBeforeSquareBrackets: false | ||
Standard: Latest | ||
StatementMacros: | ||
- Q_UNUSED | ||
- QT_REQUIRE_VERSION | ||
TabWidth: 8 | ||
UseCRLF: false | ||
UseTab: Never | ||
... | ||
|
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 |
---|---|---|
@@ -1,73 +1,73 @@ | ||
#include "DRPWrap.hpp" | ||
#include "pch.h" | ||
#include "DRPWrap.h" | ||
|
||
int rpcStatus = -1; // -1 , not start | ||
int rpcStatus = -1; // -1 , not start | ||
|
||
static void handleDiscordReady(const DiscordUser* connectedUser) { | ||
rpcStatus = 0; // success is code of 0 | ||
static void handleDiscordReady(const DiscordUser *connectedUser) { | ||
rpcStatus = 0; // success is code of 0 | ||
#ifdef _DEBUG | ||
std::cout << "\nDiscord: connected to user " << connectedUser->username << "#" | ||
<< connectedUser->discriminator << " (" << connectedUser->userId | ||
<< ")\n"; | ||
std::cout << "\nDiscord: connected to user " << connectedUser->username << "#" | ||
<< connectedUser->discriminator << " (" << connectedUser->userId | ||
<< ")\n"; | ||
#endif | ||
} | ||
|
||
static void handleDiscordDisconnected(int errcode, const char* message) { | ||
static void handleDiscordDisconnected(int errcode, const char *message) { | ||
rpcStatus = errcode; | ||
std::cout << "\nDiscord: disconnected (" << errcode << " : " << message | ||
<< ")\n"; | ||
<< ")\n"; | ||
} | ||
|
||
static void handleDiscordError(int errcode, const char* message) { | ||
static void handleDiscordError(int errcode, const char *message) { | ||
rpcStatus = errcode; | ||
std::cout << "\nDiscord: error (" << errcode << " : " << message << ")\n"; | ||
} | ||
|
||
static void handleDiscordJoinGame(const char* secret) { return; } | ||
static void handleDiscordJoinGame(const char *secret) { return; } | ||
|
||
static void handleDiscordSpectateGame(const char* secret) { return; } | ||
static void handleDiscordSpectateGame(const char *secret) { return; } | ||
|
||
static void handleDiscordJoinRequest(const DiscordUser* request) { | ||
static void handleDiscordJoinRequest(const DiscordUser *request) { | ||
Discord_Respond(request->userId, DISCORD_REPLY_NO); | ||
} | ||
namespace DRP { | ||
|
||
int getPresenceStatus() { return rpcStatus; } | ||
int getPresenceStatus() { return rpcStatus; } | ||
|
||
void UpdatePresence(const char* details, const char* largeText, | ||
const char* smallText, const char* statetext, | ||
const char* smallImage, time_t timestamp) { | ||
DiscordRichPresence discordPresence; | ||
memset(&discordPresence, 0, sizeof(discordPresence)); | ||
void UpdatePresence(const char *details, const char *largeText, | ||
const char *smallText, const char *statetext, | ||
const char *smallImage, time_t timestamp) { | ||
DiscordRichPresence discordPresence; | ||
memset(&discordPresence, 0, sizeof(discordPresence)); | ||
|
||
if (statetext != "") { | ||
discordPresence.state = statetext; | ||
} | ||
if (statetext != "") { | ||
discordPresence.state = statetext; | ||
} | ||
|
||
discordPresence.details = details; | ||
discordPresence.startTimestamp = timestamp; | ||
discordPresence.largeImageKey = "logo"; | ||
discordPresence.largeImageText = largeText; | ||
discordPresence.details = details; | ||
discordPresence.startTimestamp = timestamp; | ||
discordPresence.largeImageKey = "logo"; | ||
discordPresence.largeImageText = largeText; | ||
|
||
if (smallImage != "none") { | ||
discordPresence.smallImageKey = smallImage; | ||
discordPresence.smallImageText = smallText; | ||
} | ||
Discord_UpdatePresence(&discordPresence); | ||
} | ||
if (smallImage != "none") { | ||
discordPresence.smallImageKey = smallImage; | ||
discordPresence.smallImageText = smallText; | ||
} | ||
Discord_UpdatePresence(&discordPresence); | ||
} | ||
|
||
void InitDiscord() { | ||
DiscordEventHandlers handlers; | ||
memset(&handlers, 0, sizeof(handlers)); | ||
handlers.ready = handleDiscordReady; | ||
handlers.errored = handleDiscordError; | ||
handlers.disconnected = handleDiscordDisconnected; | ||
handlers.joinGame = handleDiscordJoinGame; | ||
handlers.spectateGame = handleDiscordSpectateGame; | ||
handlers.joinRequest = handleDiscordJoinRequest; | ||
void InitDiscord() { | ||
DiscordEventHandlers handlers; | ||
memset(&handlers, 0, sizeof(handlers)); | ||
handlers.ready = handleDiscordReady; | ||
handlers.errored = handleDiscordError; | ||
handlers.disconnected = handleDiscordDisconnected; | ||
handlers.joinGame = handleDiscordJoinGame; | ||
handlers.spectateGame = handleDiscordSpectateGame; | ||
handlers.joinRequest = handleDiscordJoinRequest; | ||
|
||
// Discord_Initialize(const char* applicationId, DiscordEventHandlers* | ||
// handlers, int autoRegister, const char* optionalSteamId) | ||
Discord_Initialize(APPLICATION_ID, &handlers, 1, "322170"); | ||
} | ||
} | ||
// Discord_Initialize(const char* applicationId, DiscordEventHandlers* | ||
// handlers, int autoRegister, const char* optionalSteamId) | ||
Discord_Initialize(APPLICATION_ID, &handlers, 1, "322170"); | ||
} | ||
} // namespace DRP |
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
#pragma once | ||
#pragma comment(lib, "discord-rpc.lib") | ||
|
||
#include "DiscordSecret.hpp" | ||
#include <cstdint> | ||
#include <cstdlib> | ||
#include <discord_rpc.h> | ||
#include <iostream> | ||
#include <time.h> | ||
|
||
#ifndef DRPWRAP | ||
#define DRPWRAP | ||
|
||
namespace DRP { | ||
int getPresenceStatus(); | ||
void UpdatePresence(const char *details, const char *largeText, | ||
const char *smallText, const char *statetext, | ||
const char *smallImage, time_t timestamp); | ||
void InitDiscord(); | ||
} // namespace DRP | ||
#endif |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#include "DiscordSecret.hpp" | ||
#include "pch.h" | ||
#include "DiscordSecret.h" | ||
|
||
// fill this out .. or else | ||
const char* APPLICATION_ID = ""; | ||
const char *APPLICATION_ID = ""; |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
#pragma once | ||
#ifndef DISCORDID | ||
#define DISCORDID | ||
|
||
extern const char *APPLICATION_ID; | ||
|
||
#endif // !DISCORDID |
Oops, something went wrong.