Luckshya

  • Full Member
  • Posts: 108
Re: Discord Plugin
« Reply #30,  »Last edited
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,  »Last edited
Nice! :)
Major update, really useful. Can you further explain the onDiscordUpdate though?

Razor.

  • Jr. Member
  • Posts: 97
Re: Discord Plugin
« Reply #32,  »Last edited
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,  »
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,  »
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,  »Last edited
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,209
Re: Discord Plugin
« Reply #36,  »
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,  »
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: 70
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: 389
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.