Discord Plugin

Started by Luckshya, Mar 05, 2019, 05:38 AM

Previous topic - Next topic

Luckshya

#30
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

#31
Nice! :)
Major update, really useful. Can you further explain the onDiscordUpdate though?

Razor.

#32
I think it would be a type of event callback used in Discord. Try:
function onDiscordUpdate(connID, eventType, ...)
{
switch(eventType)
{
case SqDiscordEvent.Message:
print( "lol" );
break;
}
}
If i'm wrong, correct me.

Anish87

Quote from: Razor. on Jul 10, 2020, 07:03 PMI think it would be a type of event callback used in Discord. Try:
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.

Anish87

I have a suggestion Luckshya... Please add the SetPresence parameter for the bot and AvatarURL for SqDiscord.User.

KrOoB_

#35
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

Quote from: KrooB on Aug 07, 2020, 10:54 PMif 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_

how can i select/detect someone in voice channel ?

Hendrix

I'm having problems loading the plugin
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

Quote from: Hendrix on Jun 03, 2022, 12:58 PMI'm having problems loading the plugin
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
@mR_Sk@

habi

QuoteHi 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

I'm having this problem when trying to connect:
[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

Quote from: Samir_HG on Aug 04, 2022, 05:13 PMI'm having this problem when trying to connect:
[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

Damn, was really wondering what happened to my server...

Samir_HG

Apparently it's a certificate issue.