Move some stuff, hook up connect/disconnect cbs
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
#include "discord-rpc.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "connection.h"
|
||||
#include "yolojson.h"
|
||||
|
||||
@ -20,6 +18,8 @@ void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handler
|
||||
}
|
||||
|
||||
MyConnection = RpcConnection::Create();
|
||||
MyConnection->onConnect = Handlers.ready;
|
||||
MyConnection->onDisconnect = Handlers.disconnected;
|
||||
MyConnection->Open();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
This is as simple of a json writing thing as possible; does not try to keep you
|
||||
from overflowing buffer, so make sure you have room.
|
||||
*/
|
||||
|
||||
// if only there was a standard library function for this
|
||||
inline size_t StringCopy(char* dest, const char* src, size_t maxBytes = UINT32_MAX) {
|
||||
if (!dest || !src || !maxBytes) {
|
||||
|
Reference in New Issue
Block a user