View Full Version : c++
dan_love
17-07-2004, 12:59
how can i get the current person speaking in the channel im in from c++?
If you are looking for a callback or delegate it doesn't exist, otherwise you can get the people currently speaking when you make the call to tsrGetSpeakers.
See the SDK documentation for this function.
There are other applications that hook the client for data, but I haven't even looked at this, so I couldn't begin to tell you how.
dan_love
25-07-2004, 15:32
struct TtsrGetSpeakers
{
int PlayerID;
char NickName[30];
};
is that right?
I'm not very good at C++. I could get by if I had to, but I'm sure there are others who could just pipe right in and help you out without doing lots of research. If no one pipes in here, then I will try to help.
Basically, All the function does is return an array of integers. You'd have to use that array to match the array of users logged in to get the names.
Here is the Delphi declaration for tsrGetSpeakers, since it was missing from the SDK:
//################################################## ############################
//#
//# Function tsrGetSpeakers( tsrPlayerIDs:Pinteger; PlayerRecords:Pinteger ):Integer;
//#
//# Description:
//# Get Currently Speaking Players in the Channel
//#
//# Input:
//# tsrPlayerIDs: A pointer to an array of Player IDs
//# PlayerRecords: pointer to a integer which specifies how many
//# TtsrPlayerInfo records tsrPlayerIDs can hold.
//#
//# Output:
//# Result: 0 = OK, else the error number
//#
//################################################## ############################
Type TtsrGetSpeakers = Function ( tsrPlayerIDs:Pointer; PlayerRecords:Pinteger ):Integer;
{$ifdef linux}cdecl;{$endif} {$ifdef mswindows}stdcall;{$endif}
var tsrGetSpeakers : TtsrGetSpeakers;
Const fn_tsrGetSpeakers='tsrGetSpeakers';
dan_love
25-07-2004, 18:41
i think i have it, does this look correct?
//################################################## ############################
//#
//# Function tsrGetSpeakers( tsrPlayerIDs:Pinteger; PlayerRecords:Pinteger ):Integer;
//#
//# Description:
//# Get Currently Speaking Players in the Channel
//#
//# Input:
//# tsrPlayerIDs: A pointer to an array of Player IDs
//# PlayerRecords: pointer to a integer which specifies how many
//# TtsrPlayerInfo records tsrPlayerIDs can hold.
//#
//# Output:
//# Result: 0 = OK, else the error number
//#
//################################################## ############################
typedef int (__stdcall *LPtsrGetSpeakers)(TtsrPlayerInfo *tsrPlayers,
int *PlayerRecords);
LPtsrGetSpeakers tsrGetSpeakers = NULL;
From my limited experience with static dlls, I have no answer. The params are the only thing that I could confirm as looking correct. There is a C header and cpp (is there such a thing as a "C" "CPP", I don't think so), here:
http://www.teamspeak.org/forums/showthread.php?threadid=5948
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.