SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 13/09/2017, 01:56 PM   #81
Develerux
Little Clucker
 
Join Date: Jan 2017
Posts: 49
Reputation: 0
Default Re: Discord Connector

Quote:
Originally Posted by NicK_ View Post
The plugin does not yet support accents. Examples:
Code:
б й н у ъ г к о ф х ы з
In-game, the message is not sent to the discord.
From discord, the message displayed in the game appears different (as unknown character).


Please can you update to "special chars"

Chars:
` -> like discord syntax example -> ```text```
б, й, ű, ъ, ő, у, ь, ц
utf-8 maybe or idk
__________________
sorry fcking bad english skill
Develerux is offline   Reply With Quote
Old 17/09/2017, 10:28 AM   #82
denNorske
Gangsta
 
denNorske's Avatar
 
Join Date: Nov 2011
Location: Narvik, Norway
Posts: 722
Reputation: 49
Default Re: Discord Connector

I also have an issue when the DCC_Connect is called.



Here is the code i used to debug:




I was curious on the plugin and decided to test it, but didn't get far in the process.
Anyone else who encountered the same problem that figured it out?

If not, I hope that I can be of any help figuring it out.
__________________
OBJECT PARTITIONER
Ever wondered how to split up maps easily from one file? Check: Online Map Object Partitioner (Click)
[Filterscript] Circle Speedo: http://forum.sa-mp.com/showthread.php?p=3861785

You have the people that asks for rep, and those who doesn't like it at all:


Server Trailer: https://www.youtube.com/watch?v=jSKhbMFvAUs
denNorske is offline   Reply With Quote
Old 22/09/2017, 07:08 PM   #83
Zorono
Huge Clucker
 
Zorono's Avatar
 
Join Date: Dec 2015
Location: GetPlayerPos(271055, Float:xCord, Float:yCord, Float:zCord);
Posts: 361
Reputation: 26
Default Re: Discord Connector

hello everybody, please i need help my server won't start
Code:
terminate called after throwing an instance of 'std::domain_error'

what():  type must be string, but is number





[log-core] fatal signal '6' (SIGABRT) catched   



OGP_HOME_000000001_startup_scr.sh: line 2: 13771 Aborted                 taskset -c 0,1,2,3 ./samp03svr

Server 'taskset -c 0,1,2,3 ./samp03svr ' crashed with exit code 0.  Respawning...



Started server on **********:7777, with maxplayers: 100 lanmode is ON.



terminate called after throwing an instance of 'std::domain_error'

what():  type must be string, but is number





[log-core] fatal signal '6' (SIGABRT) catched   



OGP_HOME_000000001_startup_scr.sh: line 2: 13792 Aborted                 taskset -c 0,1,2,3 ./samp03svr


Server is running, but its not responding,
there might be a some kind of
Crashdetect Logs:
Code:
[22/09/2017 | 14:05:52] [debug] Server crashed while executing .amx
[22/09/2017 | 14:05:52] [debug] AMX backtrace:
[22/09/2017 | 14:05:52] [debug] #0 native DCC_Connect () from discord-connector.so
[22/09/2017 | 14:05:52] [debug] #1 0004b684 in public DCC_OnGameModeInit () at .pwn:4459
[22/09/2017 | 14:05:52] [debug] #2 native CallLocalFunction () from samp03svr
[22/09/2017 | 14:05:52] [debug] #3 0002eadc in public IRC_OnGameModeInit () at \pawno\include\discord.inc:51
[22/09/2017 | 14:05:52] [debug] #4 native CallLocalFunction () from samp03svr
[22/09/2017 | 14:05:52] [debug] #5 0002e5c4 in public SSCANF_OnGameModeInit () at \pawno\include\irc.inc:204
[22/09/2017 | 14:05:52] [debug] #6 00007c60 in public OnGameModeInit () at \pawno\include\sscanf2.inc:205
[22/09/2017 | 14:05:52] [debug] Native backtrace:
[22/09/2017 | 14:05:52] [debug] #0 f745b180 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so
[22/09/2017 | 14:05:52] [debug] #1 f7453064 in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () from plugins/crashdetect.so
[22/09/2017 | 14:05:52] [debug] #2 f7453d64 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () from plugins/crashdetect.so
[22/09/2017 | 14:05:52] [debug] #3 f7455cdb in _ZN11CrashDetect7OnCrashERKN2os7ContextE () from plugins/crashdetect.so
[22/09/2017 | 14:05:52] [debug] #4 f745a4d5 in ?? () from plugins/crashdetect.so
[22/09/2017 | 14:05:52] [debug] #5 f77d8410 in ?? ()
[22/09/2017 | 14:05:52] [debug] #6 f77d8430 in ?? ()
[22/09/2017 | 14:05:52] [debug] #7 f74b22d7 in gsignal () from /lib/libc.so.6
[22/09/2017 | 14:05:52] [debug] #8 f74b3b13 in abort () from /lib/libc.so.6
[22/09/2017 | 14:05:52] [debug] #9 f76ee8ed in _ZN9__gnu_cxx27__verbose_terminate_handlerEv () from /lib/libstdc++.so.6
[22/09/2017 | 14:05:52] [debug] #10 f76ec3b3 in ?? () from /lib/libstdc++.so.6
[22/09/2017 | 14:05:52] [debug] #11 f76ec3ef in ?? () from /lib/libstdc++.so.6
[22/09/2017 | 14:05:52] [debug] #12 f7748a95 in ?? () from /lib/libstdc++.so.6
[22/09/2017 | 14:05:52] [debug] #13 f7794b2c in ?? () from /lib/libpthread.so.0
[22/09/2017 | 14:05:52] [debug] #14 f757c17e in clone () from /lib/libc.so.6
[22/09/2017 | 14:05:52] [debug] Registers:
[22/09/2017 | 14:05:52] [debug] EAX: 00000000 EBX: 000037c0 ECX: 000037c5 EDX: 00000006
[22/09/2017 | 14:05:52] [debug] ESI: 081a18ec EDI: f7640000 EBP: ef023900 ESP: ef9ff184
[22/09/2017 | 14:05:52] [debug] EIP: f77d8430 EFLAGS: 00200296
[22/09/2017 | 14:05:52] [debug] Stack:
[22/09/2017 | 14:05:52] [debug] ESP+00000000: ef023900 00000006 000037c5 f74b22d7
[22/09/2017 | 14:05:52] [debug] ESP+00000020: ef9ff1b4 00000000 f76a7a9c ef9ff218
[22/09/2017 | 14:05:52] [debug] ESP+00000040: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000060: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000080: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+000000a0: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+000000c0: f77c5fed f77b6ad0 f765fb30 00000001
[22/09/2017 | 14:05:52] [debug] ESP+000000e0: f77c5fed f77b6ad0 f765fbd0 00000001
[22/09/2017 | 14:05:52] [debug] ESP+00000100: 00000005 081a18ec ef001b94 ef023900
[22/09/2017 | 14:05:52] [debug] ESP+00000120: f7786000 081a18ec ef001b94 ef023900
[22/09/2017 | 14:05:52] [debug] ESP+00000140: 081a18ec ef001b94 f76ee8ed 0000000a
[22/09/2017 | 14:05:52] [debug] ESP+00000160: f77c5fed 00000000 2e35c900 00000001
[22/09/2017 | 14:05:52] [debug] ESP+00000180: 00000000 ef9ff428 f76ec3b3 ef9ff330
[22/09/2017 | 14:05:52] [debug] ESP+000001a0: f76ec3a6 f7786000 f76ec3ef f76ee750
[22/09/2017 | 14:05:52] [debug] ESP+000001c0: f76ec3d6 f7786000 f7748a95 ef001b58
[22/09/2017 | 14:05:52] [debug] ESP+000001e0: ef9ffb40 00000000 f7794b2c 09a2a0b0
[22/09/2017 | 14:05:52] [debug] ESP+00000200: 00000000 00000000 00000000 f77a6000
[22/09/2017 | 14:05:52] [debug] ESP+00000220: 12f23a39 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000240: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000260: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000280: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+000002a0: 003d0f00 00000000 f757c17e ef9ffb40
[22/09/2017 | 14:05:52] [debug] ESP+000002c0: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+000002e0: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000300: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000320: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000340: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000360: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+00000380: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+000003a0: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+000003c0: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] ESP+000003e0: 00000000 00000000 00000000 00000000
[22/09/2017 | 14:05:52] [debug] Loaded modules:
[22/09/2017 | 14:05:52] [debug] 00000000 - 00187dc3 samp03svr
[22/09/2017 | 14:05:52] [debug] f77da000 - f77da530 
[22/09/2017 | 14:05:52] [debug] f77a9000 - f77ab6ec /lib/libdl.so.2
[22/09/2017 | 14:05:52] [debug] f778e000 - f77a7b47 /lib/libpthread.so.0
[22/09/2017 | 14:05:52] [debug] f76a2000 - f7793d84 /lib/libstdc++.so.6
[22/09/2017 | 14:05:52] [debug] f7660000 - f76a1138 /lib/libm.so.6
[22/09/2017 | 14:05:52] [debug] f7644000 - f765d718 /lib/libgcc_s.so.1
[22/09/2017 | 14:05:52] [debug] f7484000 - f764b5f7 /lib/libc.so.6
[22/09/2017 | 14:05:52] [debug] f77b7000 - f77d95b0 /lib/ld-linux.so.2
[22/09/2017 | 14:05:52] [debug] f743d000 - f747fac4 plugins/crashdetect.so
[22/09/2017 | 14:05:52] [debug] f737f000 - f743d39a plugins/streamer.so
[22/09/2017 | 14:05:52] [debug] f736e000 - f7374c0c /lib/librt.so.1
[22/09/2017 | 14:05:52] [debug] f72c0000 - f736dc5b plugins/YSF.so
[22/09/2017 | 14:05:52] [debug] f72b0000 - f72bf1d4 plugins/sscanf.so
[22/09/2017 | 14:05:52] [debug] f7239000 - f72afb5d plugins/irc.so
[22/09/2017 | 14:05:52] [debug] f69a0000 - f6a3aacf plugins/discord-connector.so
[22/09/2017 | 14:05:52] [debug] f6972000 - f699eb58 /home/ogp_agent/OGP_User_Files/1/plugins/../log-core.so
[22/09/2017 | 14:05:52] [debug] f6909000 - f69730c4 /lib/libssl.so.10
[22/09/2017 | 14:05:52] [debug] f671f000 - f691f590 /lib/libcrypto.so.10
[22/09/2017 | 14:05:52] [debug] f66d4000 - f671ed68 /lib/libgssapi_krb5.so.2
[22/09/2017 | 14:05:52] [debug] f65fe000 - f66daa0c /lib/libkrb5.so.3
[22/09/2017 | 14:05:52] [debug] f77b0000 - f77b2765 /lib/libcom_err.so.2
[22/09/2017 | 14:05:52] [debug] f65ca000 - f65fd33c /lib/libk5crypto.so.3
[22/09/2017 | 14:05:52] [debug] f65b0000 - f65c8704 /lib/libresolv.so.2
[22/09/2017 | 14:05:52] [debug] f6599000 - f65ade10 /lib/libz.so.1
[22/09/2017 | 14:05:52] [debug] f658a000 - f6596b28 /lib/libkrb5support.so.0
[22/09/2017 | 14:05:52] [debug] f6585000 - f6587c38 /lib/libkeyutils.so.1
[22/09/2017 | 14:05:52] [debug] f655e000 - f6583f20 /lib/libselinux.so.1
[22/09/2017 | 14:05:52] [debug] f64f9000 - f655c584 /lib/libpcre.so.1
[22/09/2017 | 14:05:52] [debug] f5c97000 - f5ca8680 /lib/libnss_files.so.2
[22/09/2017 | 14:05:52] [debug] f5c90000 - f5c94cb8 /lib/libnss_dns.so.2
Zorono is offline   Reply With Quote
Old 23/09/2017, 12:08 PM   #84
maddinat0r
Gangsta
 
maddinat0r's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 881
Reputation: 459
Default Re: Discord Connector

v0.2 has been released.

BREAKING CHANGE
'DCC_Connect' was removed in favor of a server.cfg setting. Remove your call to `DCC_Connect` and add the following line to your server.cfg:
Code:
discord_bot_token YOURBOTTOKENHERE
other changes:
  • 13 new callbacks:
    Code:
    forward DCC_OnChannelCreate(DCC_Channel:channel);
    forward DCC_OnChannelUpdate(DCC_Channel:channel);
    forward DCC_OnChannelDelete(DCC_Channel:channel);
    
    forward DCC_OnUserUpdate(DCC_User:user);
    
    forward DCC_OnGuildCreate(DCC_Guild:guild);
    forward DCC_OnGuildUpdate(DCC_Guild:guild);
    forward DCC_OnGuildDelete(DCC_Guild:guild);
    
    forward DCC_OnGuildMemberAdd(DCC_Guild:guild, DCC_User:user);
    forward DCC_OnGuildMemberUpdate(DCC_Guild:guild, DCC_User:user);
    forward DCC_OnGuildMemberRemove(DCC_Guild:guild, DCC_User:user);
    
    forward DCC_OnGuildRoleCreate(DCC_Guild:guild, DCC_Role:role);
    forward DCC_OnGuildRoleUpdate(DCC_Guild:guild, DCC_Role:role);
    forward DCC_OnGuildRoleDelete(DCC_Guild:guild, DCC_Role:role);
  • over 30 new native functions:
    Code:
    native DCC_User:DCC_FindUserByName(const user_name[], const user_discriminator[]);
    native DCC_User:DCC_FindUserById(const user_id[]);
    
    native DCC_GetUserId(DCC_User:user, dest[], max_size = sizeof dest);
    native DCC_GetUserName(DCC_User:user, dest[], max_size = sizeof dest);
    native DCC_GetUserDiscriminator(DCC_User:user, dest[], max_size = sizeof dest);
    native DCC_GetUserEmail(DCC_User:user, dest[], max_size = sizeof dest);
    native DCC_IsUserBot(DCC_User:user, &bool:is_bot);
    native DCC_IsUserVerified(DCC_User:user, &bool:is_verified);
    
    native DCC_Role:DCC_FindRoleById(const role_id[]);
    
    native DCC_GetRoleId(DCC_Role:role, dest[], max_size = sizeof dest);
    native DCC_GetRoleName(DCC_Role:role, dest[], max_size = sizeof dest);
    native DCC_GetRoleColor(DCC_Role:role, &color);
    native DCC_GetRolePermissions(DCC_Role:role, &perm_high, &perm_low);
    native DCC_IsRoleHoist(DCC_Role:role, &bool:is_hoist);
    native DCC_IsRoleMentionable(DCC_Role:role, &bool:is_mentionable);
    
    native DCC_Guild:DCC_FindGuildByName(const guild_name[]);
    native DCC_Guild:DCC_FindGuildById(const guild_id[]);
    
    native DCC_GetGuildId(DCC_Guild:guild, dest[], max_size = sizeof dest);
    native DCC_GetGuildName(DCC_Guild:guild, dest[], max_size = sizeof dest);
    native DCC_GetGuildOwnerId(DCC_Guild:guild, dest[], max_size = sizeof dest);
    native DCC_GetGuildRole(DCC_Guild:guild, offset, &DCC_Role:role);
    native DCC_GetGuildRoleCount(DCC_Guild:guild, &count);
    native DCC_GetGuildMember(DCC_Guild:guild, offset, &DCC_User:user);
    native DCC_GetGuildMemberCount(DCC_Guild:guild, &count);
    native DCC_GetGuildMemberNickname(DCC_Guild:guild, DCC_User:user, dest[], max_size = sizeof dest);
    native DCC_GetGuildMemberRole(DCC_Guild:guild, DCC_User:user, offset, &DCC_Role:role);
    native DCC_GetGuildMemberRoleCount(DCC_Guild:guild, DCC_User:user, &count);
    native DCC_HasGuildMemberRole(DCC_Guild:guild, DCC_User:user, DCC_Role:role, &bool:has_role);
    native DCC_GetGuildMemberStatus(DCC_Guild:guild, DCC_User:user, &DCC_UserPresenceStatus:status);
    native DCC_GetGuildChannel(DCC_Guild:guild, offset, &DCC_Channel:channel);
    native DCC_GetGuildChannelCount(DCC_Guild:guild, &count);
  • improved connection stability
  • improved reconnect behavior
  • working rate-limiting system

Download on G1thub here.

I encourage everyone who previously had problems with v0.1 to try out this new update.
maddinat0r is offline   Reply With Quote
Old 23/09/2017, 12:19 PM   #85
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Location: Los Angeles
Posts: 680
Reputation: 93
Default Re: Discord Connector

You gonna add a Linux version anytime soon for 0.2?
Arthur Kane is offline   Reply With Quote
Old 23/09/2017, 12:31 PM   #86
Zorono
Huge Clucker
 
Zorono's Avatar
 
Join Date: Dec 2015
Location: GetPlayerPos(271055, Float:xCord, Float:yCord, Float:zCord);
Posts: 361
Reputation: 26
Default Re: Discord Connector

Great job sir, it 'd be great to see a Linux Build (for Centos 7 too because of libssl.so.1.0.0 errors) && please update main thread's example code so we might understand how your new functions/callbacks works

Edit: i have a suggestion, it 'd be great to see a function which checks if spefied channel is valid

Syntax:
Code:
native DCC_IsChannelValid(channel[]);
for example:
Code:
if(DCC_IsChannelValid("general")) {}
and i have just opened a new issue as i'm facing some proplems with DCC_OnChannelMessage callback's parameters: https://github.com/maddinat0r/samp-d...ctor/issues/26

Last edited by Zorono; 23/09/2017 at 07:31 PM.
Zorono is offline   Reply With Quote
Old 24/09/2017, 05:23 AM   #87
Fungi
Big Clucker
 
Fungi's Avatar
 
Join Date: Dec 2014
Location: Nuclues
Posts: 54
Reputation: 23
Default Re: Discord Connector

i get this while trying to compile on centos 7


Code:
[[email protected] build]# cmake3 ..
CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES) (found
  version "1.0.2k")
Call Stack (most recent call first):
  /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake3/Modules/FindOpenSSL.cmake:370 (find_package_handle_standard_args)
  CMakeLists.txt:19 (find_package)


-- Configuring incomplete, errors occurred!
__________________
Fungi is offline   Reply With Quote
Old 24/09/2017, 10:04 AM   #88
maddinat0r
Gangsta
 
maddinat0r's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 881
Reputation: 459
Default Re: Discord Connector

Added Linux downloads for CentOS 7 and Debian Stretch (couldn't compile it on Jessie because of broken package dependencies).

Quote:
Originally Posted by Zorono View Post
Edit: i have a suggestion, it 'd be great to see a function which checks if spefied channel is valid

Syntax:
Code:
native DCC_IsChannelValid(channel[]);
for example:
Code:
if(DCC_IsChannelValid("general")) {}
and i have just opened a new issue as i'm facing some proplems with DCC_OnChannelMessage callback's parameters: https://github.com/maddinat0r/samp-d...ctor/issues/26
You can use
Code:
if (DCC_FindChannelByName("general") != DCC_INVALID_CHANNEL) {}
Quote:
Originally Posted by Fungi View Post
i get this while trying to compile on centos 7


Code:
[[email protected] build]# cmake3 ..
CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES) (found
  version "1.0.2k")
Call Stack (most recent call first):
  /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake3/Modules/FindOpenSSL.cmake:370 (find_package_handle_standard_args)
  CMakeLists.txt:19 (find_package)


-- Configuring incomplete, errors occurred!
You have to manually set OPENSSL_CRYPTO_LIBRARY and OPENSSL_SSL_LIBRARY, cmake can't automatically find them for some reason.
maddinat0r is offline   Reply With Quote
Old 24/09/2017, 10:33 AM   #89
Develerux
Little Clucker
 
Join Date: Jan 2017
Posts: 49
Reputation: 0
Default Re: Discord Connector

Please add "special" characters.
ц ь у ő ъ й б ű and `
__________________
sorry fcking bad english skill
Develerux is offline   Reply With Quote
Old 24/09/2017, 10:43 AM   #90
maddinat0r
Gangsta
 
maddinat0r's Avatar
 
Join Date: Jun 2010
Location: Germany
Posts: 881
Reputation: 459
Default Re: Discord Connector

Quote:
Originally Posted by Develerux View Post
Please add "special" characters.
ц ь у ő ъ й б ű and `
I'll take a look at this.
maddinat0r is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] Teamspeak Connector maddinat0r Plugin Development 314 09/06/2017 08:46 AM
Route Connector James_Braga Русский/Russian 9 15/05/2015 09:24 AM
[Map] Connector Gas Tellken Maps 4 01/06/2012 04:04 AM
PSU connector help! patchkinson Everything and Nothing 3 20/03/2010 10:24 PM


All times are GMT. The time now is 03:43 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.