Forum

Page 2 of 5 FirstFirst 1234 ... LastLast
Results 16 to 30 of 72
  1. #16
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    That was it, thanks!

    And I suppose I can mute myself by using
    Code:
    ts3Functions.setClientSelfVariableAsInt(schid, CLIENT_INPUT_MUTED, 1);
    Right? Just like, it is not working. It does not mute the client's input.
    Last edited by Jhhhj_original; March 10th, 2017 at 04:45 PM.

  2. #17
    Join Date
    September 2012
    Posts
    6,079
    If you want to see updates reflected instantly you have to call flushClientSelfUpdates after you're done setting all your variables.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  3. #18
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    Alright, got that working...
    Now:
    if I try to compare the keyword to get the right action from the right hotkey, it can't compare it.
    I mean, I know the keyword is "sre_start"... And if I compare it:
    Code:
    void ts3plugin_onHotkeyEvent(const char* keyword) {
            uint64 schid = ts3Functions.getCurrentServerConnectionHandlerID();
            ts3Functions.logMessage("Hotkey pressed!", LogLevel_DEBUG, "Plugin", schid)
            
            /* It works just fine until this point. The if-part does not return true, it does not log the keyword. */
            if (keyword == "sre_start") {
                    ts3Functions.logMessage(keyword, LogLevel_DEBUG, "Plugin", schid);
            }
            /* This does not work either */
            if (strcmp(keyword, "sre_start") == 1) {
                    ts3Functions.logMessage(keyword, LogLevel_DEBUG, "Plugin", schid);
            }
    }
    Both ways do not log the Keyword. Any idea why?
    Well, the if-statements somehow seems to return false...
    Even though it should be true.
    Last edited by Jhhhj_original; March 11th, 2017 at 10:18 AM.

  4. #19
    Join Date
    May 2016
    Location
    Idar-Oberstein
    Posts
    163
    if no. 1: You cannot compare two const char* that way, as it will compare the pointers not their content.
    if no. 2:
    Return value
    Negative value if lhs appears before rhs in lexicographical order.
    Zero if lhs and rhs compare equal.
    Positive value if lhs appears after rhs in lexicographical order.

  5. #20
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    I've found the solution...
    It is not strcmp(), you have to use _strcmpi() for this.

  6. #21
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    My plugin crashes the client...
    I opened the Crashdump file in VS, is says the Errorcode is 0xC0000005.
    Error information is "The threat tryed to write or read from a virtual address that it does not have permissions for."

    Somehow, this happens at exactly that moment when my DLL calls System::Speech::Recognition::SpeechRecognitionEngi ne.
    This only happens in TS3, on a standalone exe this does not happen.
    Last edited by Jhhhj_original; March 11th, 2017 at 11:38 AM.

  7. #22
    Join Date
    February 2017
    Posts
    45
    maybe you wanna take a look at my example code again?? it uses hot keys, too and i hat problems
    http://forum.teamspeak.com/threads/1...685#post443685

    btw my plugin is an overlay, that allows you to interact with the server while being ingame.
    For now it only works with window mod and the game looses focus when you switch to another channel. But i'm working on it. And you can change the designe to what ever you like using Qt stylesheet.

    @Thomas do you remember my problem with the variable change. I think it's may caused because i get the variable as string not as int. Just an idea.

  8. #23
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    GT-Anakin, my Hotkeys are implemented and working...
    The only problem I have now is, as I said, that my DLL crashes as soon as it gehts to the
    Code:
     using namespace System::Speech::Recognition;
     SpeechRecognitionEngine^ recogn = gcnew SpeechRecognitionEngine();
    call.
    Do you have any idea why, or how to fix it?
    (Btw: I use C++/CLI for my plugin. Thats why I can use .NET and normal C++ in one program.)

    (And mine is some kind of overlay too)

  9. #24
    Join Date
    February 2017
    Posts
    45
    sry, i don't know .net

    seams that i didn't see the 2nd page, so i thought the hotkey is still under development. What kind of overlay?? And does it work over Fullscreen games??

  10. #25
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    It is basically supposed not to really be an overlay, but more like a way to control your TS via SR.
    So basically, perform actions like Move, Switch, Kick, ban and stuff via Voice control.

    I got that idea playing CSGO, then people join your TS and wanna get moved... You have to tab out and stuff, and the only overlay I like (and use) is the Steam Overlay.
    Overwolf has the problem of using quite a bit of power, and that annoying wheel at the side makes it unconvenient for me.
    Basically having a hotkey that you press, which activates a Speech Recognition that takes your words and translate it to text. Then perform actions based on your words.

    The thing:
    The Voicecontrol works
    The Hotkeys work

    The only problem is, the TS crashes when I start the SR (Speech Recognition)

    So yes, it (would, if it does at all) work over all kinds of applications. Fullscreen, Windowed, Even Notepad if you want to
    (That the theory, the reality looks more complicated... It's just not working so far )
    Like, it just crashes. It does not even say "... stopped working", it just kills the process. No warning.


    The easiest option would be to just use SQ for that and make some SQ Forms app in C#... But then I'd not have the TS3 Keybinds again... And the user would have to have the permission to create an SQ client...
    Same for the CQ, but here I don't have the problem with the permissions...

    I am just trying to narrow the problem down with logging, but I'll see...

    EDIT:
    So I narrowed it down to this section of code:

    Code:
    if (resChL == ERROR_ok) {
    	for (int i = 0; sizeof(*channelListPtr) / sizeof(uint64); i++) {
    	char* resultChannelVar;
    	ts3Functions.getChannelVariableAsString(schid, channelListPtr[i], CHANNEL_NAME, &resultChannelVar);
    	String^ resChVarStr = Char::ToString(*resultChannelVar);
    	array<String^>^ resChVarStrArr = resChVarStr->Split(' ');
    	for each (String^ a in resChVarStrArr) {
    		channel->Add(a);
    	}
    	ts3Functions.freeMemory(resultChannelVar);
    }
    I narrowed it further down, it is the
    Code:
    for each (String^ a in resChVarStrArr) { // Result Channel Variable String Array
        channel->Add(a);
    }
    part.

    The loop mentioned above is a part and the error source.
    It gets every channel, gets the name of the channels and pushes them into a String array.
    Last edited by Jhhhj_original; March 11th, 2017 at 06:15 PM.

  11. #26
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    Sooo, I packed it into a try / catch statement, and logged the error message.
    It gave me:
    Code:
     System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. bei tsapi.assembleGrammar() 
           System.NullReferebceException: The Objectreference was not set to the Objectinstance, occured in tsapi.assembleGrammar()

  12. #27
    Join Date
    August 2013
    Location
    Germany
    Posts
    540
    Teamspeak plugins and error handling is the most terrible thing i can imagine.

    The best thing is to wrap your whole plugin into a try/catch. I still wonder why teamspeak doesn't do that by default.

    Name:  sYMbpRy.png
Views: 59
Size:  3.2 KB
    Last edited by Bluscream; April 30th, 2017 at 05:42 AM.

  13. #28
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    The problem with wrapping it all into a try / catch is that if it does not work once, it will never work.
    It is much more efficient to just use try / Except when you really need it to either catch an exception that you are looking for to fix it (like me) or something like that, but you usually also specify the exception you are looking for.
    Like, if you just say "Filter for any exception" you can log the exception, or you filter it for a specific exception to avoid it or to work around it.

    But wrapping everything into a single try / catch is a bad idea. Sometimes as a developer you actually want your plugin to crash so you know why it crashes and fix it so it will not happen again.

  14. #29
    Join Date
    August 2013
    Location
    Germany
    Posts
    540
    Thats true, but i as user of not selfmade closed source plugins would rather have plugins that don't work sometimes instead of plugins that crash my whole client sometimes.

  15. #30
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    144
    Thats true.
    You can create the plugin with good exception handling, later, on release, you can create a single exception handling, and just log the error message.
    Maybe even make it prompts the user to explain the problem (like the TS3 crashes) only for your plugin, which it then mails you or smth...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ts3Functions.requestChannelGroupClientList
    By Bluscream in forum Suggestions and Feedback
    Replies: 1
    Last Post: October 26th, 2016, 06:44 AM
  2. Problem with ts3Functions.getClientID()
    By Dione in forum Client Plugins / Lua Scripts
    Replies: 2
    Last Post: August 30th, 2014, 11:40 AM
  3. Replies: 1
    Last Post: March 14th, 2013, 10:06 AM
  4. ts3Functions.createIdentity - where the heck is it?
    By sea212 in forum Client Plugins / Lua Scripts
    Replies: 7
    Last Post: March 1st, 2010, 07:14 PM
  5. [Solved] ts3Functions.requestClientMove
    By tomix in forum Client Plugins / Lua Scripts
    Replies: 2
    Last Post: February 22nd, 2010, 10:31 AM

Posting Permissions

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