Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Teamspeak plugin

Discuss anything to do with plugins

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
vesa
Plugin Author
Posts: 2
Joined: April 15th, 2005, 10:05 pm

Teamspeak plugin

Post by vesa »

Some days ago I received my Crystalfontz-display and I started using LCD Smartie with it. Great program, but I couldn't find plugin for Team Speak. So I made one myself, here it is for everyone to use and to develop it.

It's written with C# and I used Microsoft .Net Framework v2.0.40607. Download it from here.

Other thing I used is the great .NET Wrapper for using Team Speak SDK functions from .Net. The wrapper is made by James Mimeault and I used revision 02/22/2005. Get the wrapper from here. The file is named TSRemote.zip, unzip it to somewhere.

To compile the plugin, put the source code (you'll find it from below) of TSPlugin to file named as TSPlug.cs and copy TSRemote.cs to the same directory. Next open TSRemote.cs to text editor and change line
namespace YourNameSpaceHere
to
namespace TSPlug
and save file.

The C#-compiler comes with .NET Framework and should be in folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607. Add this to path to use the compiler (csc.exe) from anywhere. But of course it's possible to use it by entering the whole path with the compiler file name while compiling.

Now, go to command prompt and to the folder containing files TSPlug.cs and TSRemote.cs. To Compile type the following command and press enter:
csc /target:library *.cs
Or if you didn't add framework directory to the system path, use the following string instead:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\csc.exe /target:library *.cs
And after a little bit of waiting you'll find file TSPlug.dll from the same directory. Copy DLL-file to plugins\ -directory under your LCD Smartie directory. Also copy file TSRemote.dll from directory client_sdk under your team speak directory to the plugins directory.

In LCD Smartie I have following config on TS screen:
line 1:
$dll(TSPlug,1,param1,param2)
Continue on next line is on for lines 1 and 2.
Line 4:
$dll(TSPlug,2,param1,param2)
Center the text if wanted.

I hope it works and there are not so bad typos on this message.

And finally, here is the source code for TSPlugin:

Code: Select all


using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace TSPlug
{
    public class LCDSmartie
    {
        private bool bOpen = false;
        public LCDSmartie()
        {

            if (TSRemote.Open() == 0)
            {
                bOpen = true;
            }

        }

	public string function1(string param1, string param2)
	{
            try
            {
                string strPlayers = "Not connected to TS";
                if (bOpen)
                {
                    TSRemote.TtsrPlayerInfo[] tpia = TSRemote.Players;
                    strPlayers = tpia.Length.ToString();
                    strPlayers += " ";
                    for (int index = 0; index < tpia.Length; index++)
                    {
                        strPlayers += tpia[index].NickName;
                        strPlayers += "|";
                    }
                }
                return strPlayers;
            }
            catch (Exception e)
            {
                return e.Message;
            }
        }

	public string function2(string param1, string param2)
	{
            try
            {
                string strSpeakers = "Not connected to TS";
                if (bOpen)
                {
                    int[] iSpeakers = TSRemote.SpeakerIds;
                    strSpeakers = iSpeakers.Length.ToString() + " ";
                    for (int index = 0; index < iSpeakers.Length; index++)
                    {
                        TSRemote.TtsrPlayerInfo tpi = TSRemote.GetPlayerInfo(iSpeakers[index]);
                        strSpeakers += tpi.NickName + "|";
                    }

                }
                return strSpeakers;
            }
            catch (Exception e)
            {
                return e.Message;
            }
        }
    }
}
Last edited by vesa on April 16th, 2005, 5:52 am, edited 1 time in total.
IFR
Plugin Author
Posts: 201
Joined: April 6th, 2005, 12:59 am
Location: Canada
Contact:

Post by IFR »

coooool !!!! ...huh what does the team speak plugin ?
vesa
Plugin Author
Posts: 2
Joined: April 15th, 2005, 10:05 pm

Post by vesa »

IFR wrote:coooool !!!! ...huh what does the team speak plugin ?
I kind of forgot to add that to my post last night.

It shows who is on line and who is talking at the time in Teamspeak communication system.

Function 1 returns string with number of people on channel and names of people separated by character |. Function 2 returns string with number of people talking at the moment and names of them, again separated by character |.

I think there was something else I needed to clarify too, but I seem to have forgotten it.

edit:

I use this plugin on it's own theme, so it always shows the status of TS when that theme is selected.
maximus
Posts: 24
Joined: May 14th, 2005, 10:56 pm

Post by maximus »

hi,
thx for this plugin...i will use it daily :D
maltone
Posts: 17
Joined: May 22nd, 2005, 6:45 am

Post by maltone »

hmm,
lcd smartie crashed if i use this plugin in games...
penz
Posts: 4
Joined: June 6th, 2005, 8:57 pm

Post by penz »

maltone wrote:hmm,
lcd smartie crashed if i use this plugin in games...
I started to find that as well especially BF2, i think it is memory related as it has stopped crashing since i upgraded to 2gig, in fact the whole thing seems to be snappier now that i have more memory in my machine - next page action used to take forever to complete and now it just zips along.
maltone
Posts: 17
Joined: May 22nd, 2005, 6:45 am

Post by maltone »

its happen now not only in games.
here is the errorlog.

madExcept version : 2.7e
exception class : EInvalidPointer
exception message : Invalid pointer operation.

main thread ($510):
004027f8 LCDSmartie.exe

thread $b4c:
7c91eb94 +0 ntdll.dll KiFastSystemCallRet
7c91e397 +a ntdll.dll NtReplyWaitReceivePortEx
>> created by thread $b44 at:
77e6760d +0 RPCRT4.dll

thread $ee0:
7c91eb94 +00 ntdll.dll KiFastSystemCallRet
7c91e286 +0a ntdll.dll NtReadFile
7c80186f +61 kernel32.dll ReadFile

thread $f08:
7c91eb94 +00 ntdll.dll KiFastSystemCallRet
7c91e286 +0a ntdll.dll NtReadFile
7c80186f +61 kernel32.dll ReadFile

thread $d9c:
7c91eb94 +00 ntdll.dll KiFastSystemCallRet
7c91e9a9 +0a ntdll.dll NtWaitForMultipleObjects
7c8094ec +00 kernel32.dll WaitForMultipleObjectsEx
7c809c81 +13 kernel32.dll WaitForMultipleObjects

thread $e90: <priority:2>
7c91eb94 +00 ntdll.dll KiFastSystemCallRet
7c91e9a9 +0a ntdll.dll NtWaitForMultipleObjects
7c8094ec +00 kernel32.dll WaitForMultipleObjectsEx
7c809c81 +13 kernel32.dll WaitForMultipleObjects

thread $ff8:
7c91eb94 +00 ntdll.dll KiFastSystemCallRet
7c91e9be +0a ntdll.dll NtWaitForSingleObject
7c8025d5 +85 kernel32.dll WaitForSingleObjectEx
7c80253d +0d kernel32.dll WaitForSingleObject

thread $f48:
7c91eb94 +00 ntdll.dll KiFastSystemCallRet
7c91e9be +0a ntdll.dll NtWaitForSingleObject
7c8025d5 +85 kernel32.dll WaitForSingleObjectEx
7c80253d +0d kernel32.dll WaitForSingleObject

here is the list of the modules and my hardware

disassembling:
004027f8 sub_4027f8: ; function entry point
004027f8 > jmp loc_4027fc
004027f8
004027f8 ; ---------------------------------------------------------
004027f8
004027fc loc_4027fc:
004027fc mov eax, ebx
004027fe pop ebx
004027ff ret

this message will show also on the lcd

system.outofmemory.exception
maltone
Posts: 17
Joined: May 22nd, 2005, 6:45 am

Post by maltone »

i have found the problem.
it is an bug in the tsremote.dll. after i looked in ts-forum i downloaded an new dll that fixed the bug and smartie works now stabile. but i haven`t the link. the new dll is 95 kb instead 95.5 kb
D_Zarster
Posts: 1
Joined: September 11th, 2005, 1:19 pm

help

Post by D_Zarster »

can someone please make a fully made file and upload it somewhere?... cant get it wokring by my selfe... :roll:
Cyberwizzard
Posts: 2
Joined: September 23rd, 2005, 2:09 pm

Post by Cyberwizzard »

Brilliant plugin ;)

I compiled it using .NET v1.1.4322 and that works like a charm as well :)

The only thing I missed was to allow to show speakers per line so I modified the code to use a function 3 for that.

Usage:
$dll(TSPlug,3,#,param2)
where # is a positive number (starting at 0) indicating the index of the speaker (they are in a list). If you have 4 lines you could use for example:
$dll(TSPlug,3,0,param2)
$dll(TSPlug,3,1,param2)
$dll(TSPlug,3,2,param2)
$dll(TSPlug,3,3,param2)
thus showing the first 4 speakers.
However, at my TS server we usually talk with loadsa people so just 4 names won't cut it, thats why the new mode has a remainder function: show the remainder of the speakers on one scrolling line - a lot like the mode 2 of the current plugin although this one can skin the first x names as you probably have them on a line above.

Example:
$dll(TSPlug,3,-1,3)
The first 3 once again indicates the new mode, -1 tells the plugin to show a list of names instead of 1 and the last 3 tells it to skip the first 3 names as we have them on another line.

Adapting the example from above this would become:
$dll(TSPlug,3,0,param2)
$dll(TSPlug,3,1,param2)
$dll(TSPlug,3,2,param2)
$dll(TSPlug,3,-1,3)

For a 4 line display :)

Let me know if anybody finds a bug in the new stuff because its working like a charm over here :D

Source code follows:

Code: Select all

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace TSPlug
{
    public class LCDSmartie {
        private bool bOpen = false;
        public LCDSmartie()
        {

            if (TSRemote.Open() == 0)
            {
                bOpen = true;
            }

        }

   public string function1(string param1, string param2)
   {
            try
            {
                string strPlayers = "Not connected to TS";
                if (bOpen)
                {
                    TSRemote.TtsrPlayerInfo[] tpia = TSRemote.Players;
                    strPlayers = tpia.Length.ToString();
                    strPlayers += " ";
                    for (int index = 0; index < tpia.Length; index++)
                    {
                        strPlayers += tpia[index].NickName;
                        strPlayers += "|";
                    }
                }
                return strPlayers;
            }
            catch (Exception e)
            {
                return e.Message;
            }
        }

   public string function2(string param1, string param2)
   {
            try
            {
                string strSpeakers = "Not connected to TS";
                if (bOpen)
                {
                    int[] iSpeakers = TSRemote.SpeakerIds;
                    strSpeakers = iSpeakers.Length.ToString() + " ";
                    for (int index = 0; index < iSpeakers.Length; index++)
                    {
                        TSRemote.TtsrPlayerInfo tpi = TSRemote.GetPlayerInfo(iSpeakers[index]);
                        strSpeakers += tpi.NickName + "|";
                    }

                }
                return strSpeakers;
            }
            catch (Exception e)
            {
                return e.Message;
            }
    }
    
    
    public string function3(string param1, string param2) {
				int line = 1;
    		try {
   					line = int.Parse(param1);
				} catch(Exception) {
   					// give user a beating
   					return "Param1 should be an int";
				}
    				
        try {
            string strSpeakers = "Not connected to TS";
            if (bOpen) {
            		int[] iSpeakers = TSRemote.SpeakerIds;
                    
                if (line >= 0) {
                		if (line > iSpeakers.Length - 1) {
                				return "-";
                		} else {
                				TSRemote.TtsrPlayerInfo tpi = TSRemote.GetPlayerInfo(iSpeakers[line]);
                				return tpi.NickName;
                		}
            		} else {
             				// This will show the remainder
             				if (iSpeakers.Length == 0) return " -=Nobody speaking=-";
             				
             				int offset = 0;
             				try {
   											offset = int.Parse(param2);
										} catch(Exception) {
   											// give user a beating
   											return "Param2 should be an int when using negative Param1";
										}
												
										strSpeakers = "";
                		for (int index = offset; index < iSpeakers.Length; index++) {
                    		TSRemote.TtsrPlayerInfo tpi = TSRemote.GetPlayerInfo(iSpeakers[index]);
                    		strSpeakers += tpi.NickName + "|";
                		}
                		if (strSpeakers == "") strSpeakers = "-";
                		
        				}
           	}
           	return strSpeakers;
        } catch (Exception e) {
        		return e.Message;
        }
    }
}
}
Cyberwizzard
Posts: 2
Joined: September 23rd, 2005, 2:09 pm

Post by Cyberwizzard »

Update: I've added the new version to my site as well and uploaded the binary version of the dll. Don't ask me about compatibility - I'd say download it and see if it works. If the versions of .NET mismatch and it refuses to work you're on your own. Let me know if that happens so I can add it to the download information.

Click here to jump to my site
bryon3642
Posts: 1
Joined: November 1st, 2005, 9:16 pm
Location: Wisconsin
Contact:

Help

Post by bryon3642 »

Would it to difficult to create an installer and or something for us folks that just cant understand how to do this in the manner stated. I use TS 24/7 and my lcd and would love to be using this plug-in.
Workshed
Posts: 26
Joined: November 10th, 2005, 11:07 pm

Post by Workshed »

Loved the idea of the plugin for TeamSpeak but I only wanted to show the appropriate screen when TeamSpeak was running so I've delved into the LCDSmartie source and added an option to skip the screen if TS is in/active. If anyone wants it/would like me to upload it to somewhere then let me know, I would stick the modified exe/source up on my website but I wasnt sure if that is against the license....
Hepcat17
Posts: 1
Joined: July 8th, 2006, 1:07 am

Post by Hepcat17 »

This is a great plugin, very useful and stable. I've used it for months with no problems. However, collecting the various parts and info required is a hassle.

So, I've put together a complete package for this TeamSpeak plugin, including everything needed: Instructions and examples, the compiled and updated DLLs, and source code.

I hope this makes this excellent plugin more accessible.

Complete TeamSpeak Plugin Package for LCD Smartie
tehjay
Posts: 3
Joined: December 2nd, 2010, 1:37 pm

Re: Teamspeak plugin

Post by tehjay »

Does anyone have this, all the links are dead...
Post Reply