Discord Plugin

Luckshya

  • Full Member
  • Posts: 108
Re: Discord Plugin
« Reply #30, on July 9th, 2020, 04:10 PM »Last edited on July 11th, 2020, 09:00 AM
Update v0.4.4 changelog :-
  • Switched to lock-free queues instead of mutex locks on server thread, so a boost in performance
  • Added an option to toggle internal cache
  • Added cache events (see wiki for more info)
  • Switched to a single event onDiscordUpdate for all events with variable no. of arguments (see wiki)
  • Changed message event function parameters
  • Added new script objects to identify discord objects like Guild, Channel, User, ServerMember, Role, Message
  • Added GetGuild and GetOtherChannel functions (more info about them on wiki)
  • Event callbacks are now made through lock free queue
  • Added new constants for Discord EventType, ChannelType and MessageType

Wiki has been restructured and newly added features have been added it. Make sure to see the wiki before using them.
Added example code for both internal cache enabled and disabled on wiki.

Wiki: https://github.com/Luckshya/sleepydiscord-squirrel/wiki
Release: https://github.com/Luckshya/sleepydiscord-squirrel/releases/

I recommend to keep the internal cache disabled and manage cache yourself. I have also provided an example script on wiki to cache data.

EDIT: New release has been deleted for some reason, will be available back soon.
EDIT #2: Releases have been re-uploaded, make sure you get the latest one again.

Anish87

  • Newbie
  • Posts: 23
Re: Discord Plugin
« Reply #31, on July 10th, 2020, 10:13 AM »Last edited on July 10th, 2020, 10:15 AM
Nice! :)
Major update, really useful. Can you further explain the onDiscordUpdate though?

Razor.

  • Full Member
  • Posts: 101
Re: Discord Plugin
« Reply #32, on July 10th, 2020, 08:03 PM »Last edited on July 10th, 2020, 08:06 PM
I think it would be a type of event callback used in Discord. Try:
Code: [Select]
function onDiscordUpdate(connID, eventType, ...)
{
switch(eventType)
{
case SqDiscordEvent.Message:
print( "lol" );
break;
}
}
If i'm wrong, correct me.

Anish87

  • Newbie
  • Posts: 23
Re: Discord Plugin
« Reply #33, on July 24th, 2020, 12:56 PM »
Quote from Razor. on July 10th, 2020, 08:03 PM
I think it would be a type of event callback used in Discord. Try:
Code: [Select]
function onDiscordUpdate(connID, eventType, ...)
{
switch(eventType)
{
case SqDiscordEvent.Message:
print( "lol" );
break;
}
}
If i'm wrong, correct me.
no you're not wrong. I got in touch with Luckshya after that reply and understood the thing.
Re: Discord Plugin
« Reply #34, on July 30th, 2020, 09:28 AM »
I have a suggestion Luckshya... Please add the SetPresence parameter for the bot and AvatarURL for SqDiscord.User.

KrOoB_

  • Full Member
  • Keeper
  • Posts: 171
Re: Discord Plugin
« Reply #35, on August 7th, 2020, 11:54 PM »Last edited on August 7th, 2020, 11:59 PM
if we can move player to another channel on discord with this plugin, we are able to make a basic phone call system like moving player and other player (who is calling) to a private voice channel and they speak blah blah.
 am i right ?

DizzasTeR

  • VC:MP Beta Tester
  • Infinite loops defy infinity by overflowing memory
  • Posts: 1,214
Re: Discord Plugin
« Reply #36, on August 8th, 2020, 04:57 AM »
Quote from KrooB on August 7th, 2020, 11:54 PM
if we can move player to another channel on discord with this plugin, we are able to make a basic phone call system like moving player and other player (who is calling) to a private voice channel and they speak blah blah.
 am i right ?
Yes you can probably do that but they both have to be on discord of your server

KrOoB_

  • Full Member
  • Keeper
  • Posts: 171
Re: Discord Plugin
« Reply #37, on September 30th, 2020, 09:13 PM »
how can i select/detect someone in voice channel ?

Hendrix

  • Newbie
  • Posts: 40
Re: Discord Plugin
« Reply #38,  »
I'm having problems loading the plugin
Code: [Select]
Loaded plugin: xmlconf04rel64

Loaded plugin: sqlite04rel64

Loaded plugin: squirrel04rel64

Loaded plugin: hashing04rel64

Loaded plugin: geoip04rel64

Loaded plugin: sockets04rel64

Loaded plugin: announce04rel64

Plugin error >> LoadLibrary() 'plugins/discord04rel64.dll' failed: Code 126
Failed to load plugin: discord04rel64

** Started VC:MP 0.4 Server **
 Port: 8192
 Max players: 100

[MODULE]  Loaded server.conf Loader for 0.4 by Stormeus
[MODULE]     >> Loaded server.conf for parsing
[MODULE]     >> Applied settings
[MODULE]     >> Loaded classes
[MODULE]     >> Loaded vehicles
[MODULE]     >> Loaded pickups
[MODULE]  Loaded server.conf successfully

[MODULE]  Loaded SQLite3 for VC:MP by Stormeus.

[MODULE]  Loaded SqVCMP 0.4 frontend by Stormeus. (v1.0)
[SCRIPT]  |------------------------------|
[SCRIPT]  | Server                       |
[SCRIPT]  | Made by Mack                 |
[SCRIPT]  |------------------------------|
[SCRIPT]  Vehiculos cargados: 0
[SCRIPT]  Config Loaded
[SCRIPT]  Total vehicles loaded: 221
[SCRIPT]  VEHICLES LOADED: 221
[SCRIPT]  [Loaded] Alias - 11242
[SCRIPT]  Pickups Loaded - 0
[SCRIPT]  Confirming echo bot details...
[SCRIPT]  Bot details confirmed!
[MODULE]  Loaded GeoIP for 0.4 by Crys.
            >> Loaded GeoIP.dat (GeoIP Country Edition)

[MODULE]  Loaded sq_sockets for VC:MP by the LU Dev Team (ported by Stormeus).
announcer: Ready to announce to masterlist(s)
[SCRIPT]  Attempting to set user, nick and mode....
[SCRIPT]  Task completed successfully.





and already install Win64OpenSSL_Light-3_0_3 and Win64OpenSSL-3_0_3 the full my operating system is x64

MRSK143

  • Jr. Member
  • Posts: 71
Re: Discord Plugin
« Reply #39,  »
Quote from Hendrix on June 3rd, 01:58 PM
I'm having problems loading the plugin
Code: [Select]
Loaded plugin: xmlconf04rel64

Loaded plugin: sqlite04rel64

Loaded plugin: squirrel04rel64

Loaded plugin: hashing04rel64

Loaded plugin: geoip04rel64

Loaded plugin: sockets04rel64

Loaded plugin: announce04rel64

Plugin error >> LoadLibrary() 'plugins/discord04rel64.dll' failed: Code 126
Failed to load plugin: discord04rel64

** Started VC:MP 0.4 Server **
 Port: 8192
 Max players: 100

[MODULE]  Loaded server.conf Loader for 0.4 by Stormeus
[MODULE]     >> Loaded server.conf for parsing
[MODULE]     >> Applied settings
[MODULE]     >> Loaded classes
[MODULE]     >> Loaded vehicles
[MODULE]     >> Loaded pickups
[MODULE]  Loaded server.conf successfully

[MODULE]  Loaded SQLite3 for VC:MP by Stormeus.

[MODULE]  Loaded SqVCMP 0.4 frontend by Stormeus. (v1.0)
[SCRIPT]  |------------------------------|
[SCRIPT]  | Server                       |
[SCRIPT]  | Made by Mack                 |
[SCRIPT]  |------------------------------|
[SCRIPT]  Vehiculos cargados: 0
[SCRIPT]  Config Loaded
[SCRIPT]  Total vehicles loaded: 221
[SCRIPT]  VEHICLES LOADED: 221
[SCRIPT]  [Loaded] Alias - 11242
[SCRIPT]  Pickups Loaded - 0
[SCRIPT]  Confirming echo bot details...
[SCRIPT]  Bot details confirmed!
[MODULE]  Loaded GeoIP for 0.4 by Crys.
            >> Loaded GeoIP.dat (GeoIP Country Edition)

[MODULE]  Loaded sq_sockets for VC:MP by the LU Dev Team (ported by Stormeus).
announcer: Ready to announce to masterlist(s)
[SCRIPT]  Attempting to set user, nick and mode....
[SCRIPT]  Task completed successfully.





and already install Win64OpenSSL_Light-3_0_3 and Win64OpenSSL-3_0_3 the full my operating system is x64
Hi bro, instead of 3_0_3 you should install 1_0_1 the old version because i faced that problem too

habi

  • Sr. Member
  • Posts: 400
Re: Discord Plugin
« Reply #40,  »
Quote
Hi bro, instead of 3_0_3 you should install 1_0_1 the old version because i faced that problem too
Saved my time.

Samir_HG

  • Newbie
  • Posts: 3
Re: Discord Plugin
« Reply #41,  »
I'm having this problem when trying to connect:
Code: [Select]
[2022-08-04 21:56:45] [connect] Successful connection
[2022-08-04 21:56:45] [error] handle_transport_init received error: TLS handshake failed
[2022-08-04 21:56:45] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init)
disconnect
[2022-08-04 21:56:45] [connect] Successful connection
[2022-08-04 21:56:45] [error] handle_transport_init received error: TLS handshake failed
[2022-08-04 21:56:45] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init)
disconnect

Plugin versions used: x32 and x86
Systems used: Windows 10 Pro 21H2 and Ubuntu 20.04 (both updated)
OpenSSL downloaded from https://slproweb.com/products/Win32OpenSSL.html
Tried all versions available on the website.

On Linux, I downloaded libssl-dev as instructed in this tutorial.

I'm using the exact same script that worked months ago.
As a precaution, I decided to create a new one with only the most basic functions as suggested in more recent tutorials and also the examples on GitHub pages.

Two different ISPs were used in the connection attempt. In all the above scenarios returns the same error.

Emi

  • Newbie
  • Posts: 13
Re: Discord Plugin
« Reply #42,  »
Quote from Samir_HG on August 4th, 06:13 PM
I'm having this problem when trying to connect:
Code: [Select]
[2022-08-04 21:56:45] [connect] Successful connection
[2022-08-04 21:56:45] [error] handle_transport_init received error: TLS handshake failed
[2022-08-04 21:56:45] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init)
disconnect
[2022-08-04 21:56:45] [connect] Successful connection
[2022-08-04 21:56:45] [error] handle_transport_init received error: TLS handshake failed
[2022-08-04 21:56:45] [info] asio async_shutdown error: asio.ssl:336462231 (shutdown while in init)
disconnect

Plugin versions used: x32 and x86
Systems used: Windows 10 Pro 21H2 and Ubuntu 20.04 (both updated)
OpenSSL downloaded from https://slproweb.com/products/Win32OpenSSL.html
Tried all versions available on the website.

On Linux, I downloaded libssl-dev as instructed in this tutorial.

I'm using the exact same script that worked months ago.
As a precaution, I decided to create a new one with only the most basic functions as suggested in more recent tutorials and also the examples on GitHub pages.

Two different ISPs were used in the connection attempt. In all the above scenarios returns the same error.
Plugin doesn't work anymore, for nobody
https://nwc.vcmp.net
NWC Developer
Hunter DM Developer
XE | European Moderator

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 1,201
Re: Discord Plugin
« Reply #43,  »
Damn, was really wondering what happened to my server...

Samir_HG

  • Newbie
  • Posts: 3
Re: Discord Plugin
« Reply #44,  »
Apparently it's a certificate issue.