Commit graph

149 commits

Author SHA1 Message Date
Kenny McCormick 34ce3ac803 fix "destopFileFormat" typo (#283)
resolution for #282
2019-04-30 11:39:14 -07:00
msciotti c59fd6df20
Revert "Choose pipe number on initialize (#250)"
This reverts commit 4824b20f28.
2019-01-24 13:23:35 -08:00
Mason Sciotti 4824b20f28
Choose pipe number on initialize (#250)
* Choose pipe number on initialize

* Get pipe from base connection instance

* UE4 support

* Warnings as errors yelling

* Fix windows connection

* Oops all variables

* maybe this fixes it

* This one actually works!!!!

* Fix double function declaration
2019-01-14 00:16:22 -08:00
Mason Sciotti 4e53fa0392
Fix code signing for macOS 10.10 (#260)
* Fix code signing for macOS 10.10
- Fixes #259

* Maybe this works
2018-12-19 08:40:51 -08:00
Florian Spieß dd47c7c66d Improve handling of disconnects and reconnects (#228)
* Check response 0 on disconnect

From recv(): The return value will be 0 when the peer has performed an orderly shutdown

* Add persistent presence and handlers

* Use buffer instead of raw struct

* Clear presence data on shutdown

* Remove CurrentPresence and add boolean instead

This removes the need for having 2 big buffers in favor of using a small boolean
2018-11-16 10:41:49 -08:00
Michał Janiszewski ac2d064cb0 Flatten the condition to get rid of empty branch (#247) 2018-11-06 14:48:59 -08:00
Michał Janiszewski 3d3ae7129d Fix mismatched signs in comparison after b44defe (#209)
```
../src/discord_register_linux.cpp: In function ‘void Discord_Register(const char*, const char*)’:
../src/discord_register_linux.cpp:37:31: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘long unsigned int’ [-Wsign-compare]
         if (size <= 0 || size >= sizeof(exePath)) {
                          ~~~~~^~~~~~~~~~~~~~~~~~
```
2018-07-30 12:50:49 -07:00
Sander in 't Veld b44defe60a [Linux] Null-terminate output from readlink in Discord_Register. (#208)
* Explicitly null-terminate the output from readlink in discord_register_linux.cpp.

* The return value of readlink is a signed size_t.
2018-07-27 10:04:04 -07:00
Sleepy Flower Girl 7c41a8ec19 Fixed issue with Discord RPC not updating presence during shutdown (#189) 2018-06-07 16:10:40 -07:00
Ted John ba9fe00c4d Dynamically create IoThread... (#179)
So that it doesn't get deleted before Discord is destroyed.
2018-05-16 13:21:16 -07:00
Michał Janiszewski 7e0480e2ef Apply formatting (#178) 2018-05-14 09:25:17 -07:00
Ben Morse 566076e3d8
add WARNINGS_AS_ERRORS cmake option (#176) 2018-05-10 17:46:11 -07:00
Mason Sciotti 64027b336f
Adding user object to READY event (#159)
* Pass the READY event data down in onConnect

* Changes made for UE4 and Unity wrappers

* Changing object name from joinRequest to DiscordUser
2018-04-16 10:25:44 -07:00
Codecat 2ce9fe068b Syntax change to avoid gcc 4.8 segfaulting (#162) 2018-04-04 10:00:24 -07:00
Mason Sciotti be8a8e9380 ACTUALLY register the handlers on init 2018-03-29 14:33:46 -07:00
Mason Sciotti 087282cd4b
Dynamic Event Handler Registration (#135)
- Discord_RegisterHandlers() exported
- C# wrapper updated
- Dynamically sub/unsub to events
- Better mutex locking, for safety!
2018-03-23 10:25:28 -07:00
Michał Janiszewski d279c24c6a Add advapi32 to linked libraries (#140)
Required by `RegCreateKeyExW` and others.
2018-03-13 13:00:47 -07:00
Mason Sciotti e8091f5137 Changing kebab case filenames in source to snake case for consistency 2018-02-27 13:33:00 -08:00
Michał Janiszewski 578eb6de7c Provide fake DllMain declaration to fix missing-declarations warning (#130) 2018-02-15 14:36:31 -08:00
Michał Janiszewski 4e61b9c82c Fix mingw compilation with -Werror=missing-declarations (#128) 2018-02-14 13:33:02 -08:00
Michał Janiszewski 8ec10dc011 Fix compilation with -Werror=missing-declarations (#127) 2018-02-14 11:42:29 -08:00
Mason Sciotti 453222075b
partyMax is mandatory if partySize is included (#122) 2018-02-12 13:44:49 -08:00
Dmitry c7b4e6b2fc Fix segfaults in Discord_RegisterW in MinGW builds (#105)
* Add MinGW and WinXP support, remove Win SDK dep when using MinGW

* Remove Win SDK dependency when compiled with MinGW

* Remap the Win SDK-depended functions to string.h substitutes

* Remap missing WinAPI call RegSetKeyValueW to a substitute function

* Remove warnings by pragma when using MinGW

* Fix segfaults in Discord_RegisterW in MinGW builds
2018-02-02 09:40:33 -08:00
Nicolas Adamoglou eee5085e9b Exported Discord_Register and Discord_RegisterSteam (#109)
* Update CMakeLists.txt

* Update and rename src/discord_register.h to include/discord_register.h

* Update CMakeLists.txt

* Update discord_register_win.cpp

* Update discord_register_linux.cpp
2018-02-01 16:42:17 -08:00
Ben Morse b85758ec19 fix decls 2018-01-09 10:41:16 -08:00
Glenn Smith 2c609b1d5f Fix buffer overflows in RegisterCommand on mac (#99) 2018-01-05 16:59:44 -08:00
Ben Morse 6a59509b7b
add Discord_ClearPresence() (#104)
send-presence example updated - start a line with 'c' to toggle
whether presence information is sent or not.

Added ClearPresence to .cs bindings

Added ClearPresence to UE4 blueprint class.
2018-01-05 15:17:23 -08:00
Dmitry b0e31a9e25 MinGW and WinXP support (issue #102) (#103)
* Add MinGW and WinXP support, remove Win SDK dep when using MinGW

Was meant to add MinGW support only, WinXP support was made by accident.
Changes:
* Remove Win SDK dependency when compiled with MinGW
* Remap the Win SDK-depended functions to string.h substitutes
* Remap missing WinAPI call RegSetKeyValueW to a substitute function

* Remove warnings by pragma when using MinGW
2018-01-05 10:56:55 -08:00
Ben Morse 2d0661c906 fix debug build with static crt
CMAKE_BUILD_TYPE is not set at configuration time, so we can't test
against it.  So, we string-replace /MD with /MT in the c[xx] flags for
the different targets.  CF:

https://stackoverflow.com/questions/14172856/cmake-compile-with-mt-instead-of-md
2018-01-05 10:42:44 -08:00
Chris Marsh 1a278528a2 Add discriminator to join request 2017-12-01 14:41:20 -08:00
Chris Marsh b01d0a8af3 Move the signing stuff out of cmake 2017-11-29 14:00:37 -08:00
Chris Marsh 8af28e46be Disable code formatting on CI builds. 2017-11-29 09:50:30 -08:00
Michał Janiszewski 2af5adca3d Use simpler version of GetModuleFileNameW
As per
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683198(v=vs.85).aspx,
the advised use for getting the file name of a module from `<current
process>` is to use the simplified version. Additionally, this clears
the confusion introduced in Win7's PSAPI which moved
`GetModuleFileNameExW` into the kernel, changing its signature to
`K32GetModuleFileNameExW`, effectively breaking pre-Win7 uses unless
actively mitigated with `#define PSAPI_VERSION 1`
2017-11-29 08:08:47 -08:00
Chris Marsh 7c3e28870e wip more build script, add signing 2017-11-28 10:27:40 -08:00
Chris Marsh 9130707086 Wrap std::thread in a holder that joins it on destruction. 2017-11-28 09:16:00 -08:00
Michał Janiszewski 95be02d4ce Add Travis CI support 2017-11-17 10:53:59 -08:00
Chris Marsh c834a2e6d9 Thanks, paranoia 2017-11-17 09:15:24 -08:00
Chris Marsh 6a963456ed Thanks, Danny. 2017-11-17 09:13:22 -08:00
Michał Janiszewski 2b248a6cef Don't use hardcoded paths for installation targets 2017-11-16 09:03:17 -08:00
Ted John c9cf6b3f41 Move /MT directive to MSVC only 2017-11-16 09:03:17 -08:00
Ted John 704c56d13f Add option for building with /MT 2017-11-16 09:03:17 -08:00
Ted John 5085d23dd1 Improve cmakelists for vcpkg building
- Remove forced /MT directive.
- Allow building for debug.
- Add option to prevent building of example apps.
2017-11-16 09:03:17 -08:00
Michał Janiszewski b206dd44f0 Use -fPIC option when building shared libs 2017-11-15 09:22:07 -08:00
Michał Janiszewski d121bbe709 Use cmake-standard flag BUILD_SHARED_LIBS
This removes custom `BUILD_DYNAMIC_LIB` option and replaces it with a
standard BUILD_SHARED_LIBS:
https://cmake.org/cmake/help/v3.7/variable/BUILD_SHARED_LIBS.html

Although not mentioned in the documentation there, this flag is
implicitly available.
2017-11-15 09:22:07 -08:00
Michał Janiszewski cfd6470946 Add a comment explaining WINVER macros for MinGW 2017-11-15 08:20:48 -08:00
Michał Janiszewski f22f299330 Fix mingw builds 2017-11-15 08:20:48 -08:00
Michał Janiszewski a1ab6c96f2 Fix unused result 2017-11-13 10:38:18 -08:00
Max Kamps 0ea7ddbd5a Fix CMake issue when ENABLE_IO_THREAD=OFF (#28)
This was probably just a typo.
2017-11-13 08:01:58 -08:00
Chris Marsh 2f54e62c23 fix include order 2017-11-10 13:14:00 -08:00
Ivan Molodetskikh 54abef2624 Fix unused parameter warning triggering 2017-11-10 09:59:51 -08:00