From 3bdb88d918055890d9a136c7e95359bf2a017e87 Mon Sep 17 00:00:00 2001 From: Chris Marsh Date: Thu, 2 Nov 2017 11:59:45 -0700 Subject: [PATCH] Unity ajt fix --- examples/button-clicker/Assets/DiscordRpc.cs | 5 +---- .../Assets/Resources/discord-rpc.dll | Bin 62464 -> 62464 bytes include/discord-rpc.h | 6 +++--- src/discord-rpc.cpp | 11 +++++++++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/button-clicker/Assets/DiscordRpc.cs b/examples/button-clicker/Assets/DiscordRpc.cs index 206504e..fde94d9 100644 --- a/examples/button-clicker/Assets/DiscordRpc.cs +++ b/examples/button-clicker/Assets/DiscordRpc.cs @@ -50,14 +50,11 @@ public class DiscordRpc public bool instance; } - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + [System.Serializable] public struct JoinRequest { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 24)] public string userId; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 48)] public string username; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string avatar; } diff --git a/examples/button-clicker/Assets/Resources/discord-rpc.dll b/examples/button-clicker/Assets/Resources/discord-rpc.dll index 5daec3dbe31aac73275fcb9b888e2d7815ed059f..67ef7097acdc62d4ca018c0da77dc32e8de45039 100644 GIT binary patch delta 10594 zcmeHNi(ge$_TT$*FJ3^rm*5JB575g9J_%6qm7r)x1;y}z&&aTRiwcI%ivcQJNOYT0 zW0P7_>C{9XOEjxXqCjF+_qx;5X;O^j434z zao4tp67xY)S_TKkd6iFy1(yDSeqM2<5SID;1N9rrSd)pb7DKF0@m}gj)`gs(6k`JC z@<+uV1N-xpYGa^<^TpzPP&b~bwg&a*VKK`YI~j-Q6!$r_7d`iyZMoVvxF_ec#Dp%1 z{FqqZWd)xgKJRjc|56rRpM-T20to7BZl)Vkr^?T4-wT7vwFPP zkFk;_t<6?%NsRDg*I!oLRh}mJPHJg=L^VfdalTZ{=r)zNi$8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A-wG(_ng^B0i zaX8X0p;SKYAE4n{Ekp6@9=ie#x`aP_HQ16@v6x;&3qHD_k8qSiXS;mYZu2!vLLC;c zkFE~7eCUcb-6+-i6qH3!h9Cg%^Eq@zN9384Tk5;<9^%kn2jG44uS@XG{@>w_-3|9<{PcCu&>uS=dcxbFEbxSF zk|+Egln*_fC%=Gxc7w;cvIkTEJtbRVIJIlff(Lq29>QLOaN8jL0XkS3gyRr=Gb_rl z>OnuFGT~>S5ZJT=XQ$vKz$r?3(f4UMO`&H)8G8*mU=euA4GWQRWuY!*VEd58(O>j^ zvpLH0%;`9y&N?(^G=w`8X$H6b;CT{dr;JC3G-;u7L(Ng(Wpw9(Q*aBJv z{t_^HoYoj6?o-AiDCm8YZ%WGNPDG>76H%T8`i-U4NwzBMqLgbTvlW0l_yTr>y<-8cYN9gfFi{76rZ@cojqotqs^`y|%d0 zflH9MdC*u#!ggLu=JXr!Z3Uh%8k7K@@FB^k104tO`Wcn$f$KH_VdR^mQO@TEQI1E* zHe&&TC+q=Q51ud;R0W=J9HB1AJpE=HCk8_*N{m za{NMr=yHKYATlD{C;9zA`Y$=se+TSTp*28xX`DjRfH#5cxa;{1!xQh1X!4f*d5+!5jn;k6+c8Zo9U)^gt^p{DOv=lFtX;CtweK zCa_`${zDP`4q!8g{18636LSpxUSRMp*n$rMz6Htw-?|Gw)BFU1dZ~XF-|ZlZGzYjx v^7*^*V-6@E6)45096lU2gp{8j08dCcIPrudK@9fkz!|P7|JcXt?il|MzM?%u diff --git a/include/discord-rpc.h b/include/discord-rpc.h index bff30f5..a81673e 100644 --- a/include/discord-rpc.h +++ b/include/discord-rpc.h @@ -42,9 +42,9 @@ typedef struct DiscordRichPresence { } DiscordRichPresence; typedef struct DiscordJoinRequest { - char userId[24]; - char username[48]; - char avatar[128]; + const char* userId; + const char* username; + const char* avatar; } DiscordJoinRequest; typedef struct DiscordEventHandlers { diff --git a/src/discord-rpc.cpp b/src/discord-rpc.cpp index 1b846f0..1d5e6d0 100644 --- a/src/discord-rpc.cpp +++ b/src/discord-rpc.cpp @@ -32,6 +32,12 @@ struct QueuedMessage { } }; +struct JoinRequest { + char userId[24]; + char username[48]; + char avatar[128]; +}; + static RpcConnection* Connection{nullptr}; static DiscordEventHandlers Handlers{}; static std::atomic_bool WasJustConnected{false}; @@ -48,7 +54,7 @@ static char LastDisconnectErrorMessage[256]; static std::mutex PresenceMutex; static QueuedMessage QueuedPresence{}; static MsgQueue SendQueue; -static MsgQueue JoinAskQueue; +static MsgQueue JoinAskQueue; // We want to auto connect, and retry on failure, but not as fast as possible. This does expoential // backoff from 0.5 seconds to 1 minute @@ -353,7 +359,8 @@ extern "C" DISCORD_EXPORT void Discord_RunCallbacks() while (JoinAskQueue.HavePendingSends()) { auto req = JoinAskQueue.GetNextSendMessage(); if (Handlers.joinRequest) { - Handlers.joinRequest(req); + DiscordJoinRequest djr{req->userId, req->username, req->avatar}; + Handlers.joinRequest(&djr); } JoinAskQueue.CommitSend(); }