Forum

Results 1 to 4 of 4
  1. #1
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    119

    Question ERROR_ok always true, even if requestClientPoke fails?

    So I wrote the following piece of code:

    PHP Code:
    void PokeUserIfRequested(uint64 schidanyID clid, const charmessage) {
    |     if (PokeData::users->Contains(clid)) {
    |        if (ts3Functions.requestClientPoke(schidclidmessageNULL) != ERROR_ok) {
    |            printf("[ RHS ] An error occured while trying to poke user %hu"clid);
    |            return;
    |        }
    |        system("timeout 1 > nul"); // Don't worry about this line, this function runs in a non-blocking thread
    |     }
    | } 
    Some sidenotes:
    • This function runs in a thread
    • This function runs in a loop
    • The language used is C++/CLI with .NET elements (PokeData::Users is a List<anyID> in the ref class PokeData class.)



    So the problem I have is that when the user disconnects, the function still attempts to poke him.
    But shouldnt that fail and print out the statement in line 3???
    I mean, when the client disconnects, shouldnt it raise ERROR_client_invalid_id or something else, but not ERROR_ok???
    Last edited by Jhhhj_original; December 14th, 2018 at 07:49 PM.

  2. #2
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    119

    Lightbulb

    For some odd reason I was able to work around that issue with the following code:
    PHP Code:
    void PokeUserIfRequested(uint64 schidanyID clid, const charmessage) {
    |     if (PokeData::users->Contains(clid)) {
    |         uint64 chid;
    |         if (ts3Functions.getChannelOfClient(schidclid, &chid) == ERROR_ok) {
    |             if (ts3Functions.requestClientPoke(schidclidmessageNULL) != ERROR_ok) {
    |                 printf("[ RHS ] An error occured while trying to poke user %hu"clid);
    |                 return;
    |             }
    |         } else {
    |             printf("[ RHS ] An error occured while trying to poke user %hu"clid);
    10|             return;
    11|         }
    12|         system("timeout 1 > nul"); // Don't worry about this line, this function runs in a non-blocking thread
    13|     }
    14| } 
    But I wouldnt see that as a permanent solution, so the issue still exists...

  3. #3
    Join Date
    August 2018
    Posts
    21
    Check the onServerErrorEvent

  4. #4
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,366
    The api is asynchronous, so the clientlib can only make validty checks (if any). So that's what the returnCode is for. If you create a returnCode and add it to your request* command, you can check for it in the onServerErrorEvent.

    Permission checks (and maybe some additional checks) are made by the server. If the request was successfull, you'll get an onServerErrorEvent as well (with returnCode, if given).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. requestClientMove only returning ERROR_ok
    By 4574312554 in forum Client Plugins / Lua Scripts
    Replies: 3
    Last Post: April 5th, 2018, 12:52 PM
  2. [Evaluation] Bug when channel_flag_maxclients_unlimited=true
    By DatDraggy in forum Bug Reports [EN/DE]
    Replies: 6
    Last Post: August 14th, 2017, 10:15 AM
  3. playWaveFile: ERROR_OK but not playing anything
    By BaumwolleHD in forum Client Plugins / Lua Scripts
    Replies: 1
    Last Post: December 11th, 2015, 02:26 AM
  4. DatabaseQuery CRITICAL ERROR_ok
    By seler in forum Server Support
    Replies: 2
    Last Post: September 24th, 2014, 09:55 PM
  5. PluginSDK getClientID returns ERROR_ok when not connected.
    By SilentStorm in forum Bug Reports [EN/DE]
    Replies: 1
    Last Post: January 26th, 2012, 12:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •