Commit graph

140 commits

Author SHA1 Message Date
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
Ivan Molodetskikh
c5d70514ac Use steam://rungameid/ 2017-11-10 09:59:51 -08:00
Ivan Molodetskikh
57316cbaee clang-format I suppose 2017-11-10 09:59:51 -08:00
Chris Marsh
7dc663a170 Static link crt 2017-11-09 14:24:30 -08:00
ArsenArsen
ca5d70a5f9 Add more -Wflags 2017-11-09 13:08:05 -08:00
ArsenArsen
ee9c504d1c Change -Weverything to -Wall for more compilers 2017-11-09 13:08:05 -08:00
Chris Marsh
a7808a20ed Fix some sizes on join request strings. 2017-11-03 13:40:30 -07:00
Chris Marsh
3bdb88d918
Unity ajt fix 2017-11-02 11:59:45 -07:00
Mason Sciotti
dafd85c39f Rename avatarUrl -> avatar for API consistency 2017-10-17 13:34:03 -07:00
Chris Marsh
86ca320cb9 These should have been extern C. 2017-10-13 10:02:12 -07:00