From bdb2835b624b2fe7802e65523daf5ac88c7a033c Mon Sep 17 00:00:00 2001 From: yellows8 Date: Wed, 6 Apr 2016 16:32:25 -0400 Subject: [PATCH] Added udsEjectSpectator(). --- libctru/include/3ds/services/uds.h | 5 +++++ libctru/source/services/uds.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/libctru/include/3ds/services/uds.h b/libctru/include/3ds/services/uds.h index 28e2495..371de37 100644 --- a/libctru/include/3ds/services/uds.h +++ b/libctru/include/3ds/services/uds.h @@ -287,6 +287,11 @@ Result udsDisconnectNetwork(void); */ Result udsEjectClient(u16 NetworkNodeID); +/** + * @brief This can be used by the host to force-disconnect the spectator. + */ +Result udsEjectSpectator(); + /** * @brief This can be used by the host to update the network attributes. If bitmask 0x4 is clear in the input bitmask, this clears that bit in the value before actually writing the value into state. * @param bitmask Bitmask to clear/set in the attributes. See the UDSNETATTR enum values. diff --git a/libctru/source/services/uds.c b/libctru/source/services/uds.c index cd34397..3d760ca 100644 --- a/libctru/source/services/uds.c +++ b/libctru/source/services/uds.c @@ -325,6 +325,18 @@ Result udsEjectClient(u16 NetworkNodeID) return cmdbuf[1]; } +Result udsEjectSpectator() +{ + u32* cmdbuf=getThreadCommandBuffer(); + + cmdbuf[0]=IPC_MakeHeader(0x6,0,0); // 0x60000 + + Result ret=0; + if(R_FAILED(ret=svcSendSyncRequest(__uds_servhandle)))return ret; + + return cmdbuf[1]; +} + Result udsUpdateNetworkAttribute(u16 bitmask, bool flag) { u32* cmdbuf=getThreadCommandBuffer();