Forum

Page 5 of 5 FirstFirst ... 345
Results 61 to 72 of 72
  1. #61
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    142
    That is why I do not really like using marshalling, because I don't get how it works...
    Code:
    Marshal::PtrToStringAnsi((IntPtr)(tmp));
    That works, the line you wrote throws an error.
    Let me check if it crashes real quick...
    EDIT: Still crashed...

  2. #62
    Join Date
    October 2015
    Location
    Austin
    Posts
    17
    Can you run the plugin while debugging it and see if channel[i] or a is null? It's possible channel[i] is null and a is perfectly fine.

  3. #63
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    142
    I now added a check for that
    Code:
    if (String:IsNullOrEmpty(a) == false) {
        channel[i] = a;
    }
    Still crashes though...
    Like, is there any other way of getting all channel names and client names other than the way I do it, maybe with a little less trouble?

  4. #64
    Join Date
    October 2015
    Location
    Austin
    Posts
    17
    No, this is the only way

  5. #65
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    142
    Maybe the List<String^>^ channel; is the problem? Even though I can't see how it even could be...
    I will try looping at 1 not at 0, maybe channel[0] has some kind of error...

  6. #66
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    142
    Oooooooh, I think I know why it crashes.
    The following is printed:
    [*spacer0]☢
    I suppose the letter ☢ cannot be handled by C++ CLI, so is there any way to work with special letters?
    EDIT:
    Alright, nevermind.
    It crashes on [*spacer0]t too.

  7. #67
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    142
    Alright then. After asking SO, they told me that I have to initialize my List<String^>^ with
    Code:
    List<String^>^ channels = gcnew List<String^>();
    And the best part:
    It does not crash anymore finally!

  8. #68
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    142
    How do I use ts3Functions.playWafeFile()?
    Like, how do I set the path?
    I tryed "vctest_cpp_ts3\\signal_vc_start.wav", "vctest_cpp_ts3/signal_vc_start.wav", R"vctest_cpp_ts3/signal_vc_start.wav"
    None did work. How do I write the path? Is it relative? Total?

  9. #69
    Join Date
    September 2012
    Posts
    6,078
    Quote Originally Posted by Jhhhj_original View Post
    How do I use ts3Functions.playWafeFile()?
    Like, how do I set the path?
    I tryed "vctest_cpp_ts3\\signal_vc_start.wav", "vctest_cpp_ts3/signal_vc_start.wav", R"vctest_cpp_ts3/signal_vc_start.wav"
    None did work. How do I write the path? Is it relative? Total?
    You are seemingly providing paths that are relative to your development environment (ie. your source tree). You are however developing a dynamic library that is going to be loaded by other processes (or a specific one in this case).
    At runtime your code will be a part of whichever process loaded your library and you'll inherit its environment. As such what you're effectively trying to load (most of the time anyway, there are exceptions) is "(TeamSpeakInstallPath)\vctest_cpp_ts3\signal_vc_s tart.wav" which obviously doesn't exist.

    You should construct an absolute path at runtime, the plugin SDK offers options to get the most important paths regarding TeamSpeak. Alternatively (for debugging / testing) you can of course hard code absolute paths, however that will obviously only work on your system , not on other people's systems when you distribute the plugin.

    tl;dr: Use absolute paths
    Last edited by Chris; March 15th, 2017 at 06:48 PM.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  10. #70
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    142
    So create absolute paths using the getPluginPath() function I suppose?
    Then add a folder to it, and the wave file?

    So it look like

    [path gotten by getPluginPath()]\[plugin_name]\[wave_file].wav

  11. #71
    Join Date
    September 2012
    Posts
    6,078
    Quote Originally Posted by Jhhhj_original View Post
    [path gotten by getPluginPath()]\[plugin_name]\[wave_file].wav
    Yes that would be an appropriate solution.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  12. #72
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    142
    But does it have to be \ or \\? Like, escapesequences and stuff?
    Or is it /?
    Like, how do I do that?

    EDIT:
    Great, nevermind.
    You have to use \\ because of escape sequences... Its just, in C# you use @ for paths, in python you use r""

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, 05:44 AM
  2. Problem with ts3Functions.getClientID()
    By Dione in forum Client Plugins / Lua Scripts
    Replies: 2
    Last Post: August 30th, 2014, 10:40 AM
  3. Replies: 1
    Last Post: March 14th, 2013, 09: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, 06:14 PM
  5. [Solved] ts3Functions.requestClientMove
    By tomix in forum Client Plugins / Lua Scripts
    Replies: 2
    Last Post: February 22nd, 2010, 09: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
  •