TeamTalk 5 .NET DLL Version 5.15A
Loading...
Searching...
No Matches
TeamTalk Server API

Instantiate and run a TeamTalk server. More...

Classes

class  BearWare.TeamTalk5Srv
 Instantiate this class to start a TeamTalk server. More...
 
class  BearWare.TeamTalkSrvBase
 Base class for BearWare.TeamTalk5Srv. More...
 

Functions

 BearWare.TeamTalk5Srv.TeamTalk5Srv ()
 Instantiate TeamTalk server. Call UpdateServer() and MakeChannel() to setup server properties and root channel.
 
 BearWare.TeamTalk5Srv.TeamTalk5Srv (Channel lpChannel)
 Instantiate TeamTalk server with a root channel.
 
 BearWare.TeamTalk5Srv.TeamTalk5Srv (Channel lpChannel, ServerProperties lpServerProperties)
 Instantiate TeamTalk server with root channel and server properties.
 
bool BearWare.TeamTalkSrvBase.SetEncryptionContext (string szCertificateFile, string szPrivateKeyFile)
 Set certificate and private key for encrypted server.
 
bool BearWare.TeamTalkSrvBase.SetEncryptionContext (EncryptionContext lpEncryptionContext)
 Set up encryption context for encrypted server.
 
 BearWare.TeamTalkSrvBase.TeamTalkSrvBase ()
 Create new TeamTalk server instance.
 
 BearWare.TeamTalkSrvBase.TeamTalkSrvBase (Channel lpChannel)
 
 BearWare.TeamTalkSrvBase.TeamTalkSrvBase (Channel lpChannel, ServerProperties lpServerProperties)
 
void BearWare.TeamTalkSrvBase.Close ()
 Close TeamTalk server instance.
 
bool BearWare.TeamTalkSrvBase.RunEventLoop (int pnWaitMs)
 Run the server's event loop.
 
ClientError BearWare.TeamTalkSrvBase.SetChannelFilesRoot (string szFilesRoot, Int64 nMaxDiskUsage, Int64 nDefaultChannelQuota)
 The root folder of where users should upload files to.
 
ClientError BearWare.TeamTalkSrvBase.UpdateServer ([In] BearWare.ServerProperties lpServerProperties)
 Set server properties.
 
virtual ClientError BearWare.TeamTalkSrvBase.MakeChannel (BearWare.Channel lpChannel)
 Make new channel.
 
ClientError BearWare.TeamTalkSrvBase.UpdateChannel (Channel lpChannel)
 Update an existing channel.
 
ClientError BearWare.TeamTalkSrvBase.RemoveChannel (int nChannelID)
 Remove a channel.
 
ClientError BearWare.TeamTalkSrvBase.AddFileToChannel (string szLocalFilePath, BearWare.RemoteFile lpRemoteFile)
 Add a file to an existing channel.
 
ClientError BearWare.TeamTalkSrvBase.RemoveFileFromChannel (RemoteFile lpRemoteFile)
 Remove a file from a channel.
 
ClientError BearWare.TeamTalkSrvBase.MoveUser (int nUserID, BearWare.Channel lpChannel)
 Move a user from one channel to another.
 
ClientError BearWare.TeamTalkSrvBase.SendTextMessage (BearWare.TextMessage lpTextMessage)
 Send text message from server to clients.
 
bool BearWare.TeamTalkSrvBase.StartServer (string szBindIPAddr, int nTcpPort, int nUdpPort, bool bEncrypted)
 Start server on specified IP-address and ports.
 
bool BearWare.TeamTalkSrvBase.StartServerSysID (string szBindIPAddr, int nTcpPort, int nUdpPort, bool bEncrypted, string szSystemID)
 Same as StartServer() but with the option of specifying a system-ID.
 
bool BearWare.TeamTalkSrvBase.StopServer ()
 Stop server and drop all users.
 
static string BearWare.TeamTalkSrvBase.GetVersion ()
 
 BearWare.TeamTalkSrvBase.CallBack.CallBack (Delegate lpCallback)
 
IntPtr BearWare.TeamTalkSrvBase.CallBack.GetFuncPointer ()
 
void BearWare.TeamTalkSrvBase.CallBack.Dispose ()
 
void BearWare.TeamTalkSrvBase.CallBack.Dispose (bool disposing)
 
bool BearWare.TeamTalkSrvBase.CallBack.Compare (Delegate x)
 

Detailed Description

Instantiate and run a TeamTalk server.

The Professional Edition of the TeamTalk SDK includes a class called BearWare.TeamTalk5Srv which exposes the TeamTalk server API.

To create a TeamTalk server instantiate the BearWare.TeamTalk5Srv class. If the server should be encrypted then call TeamTalk5Srv.SetEncryptionContext() prior to the instantiation, since the SSL context must be available before instantiation of the server.

Next configure the server instance by calling TeamTalk5Srv.UpdateServer(). Remember to set all properties of BearWare.ServerProperties. Also create a root channel by calling TeamTalk5Srv.MakeChannel(). If there is no root channel then the server will not start. Finally call TeamTalk5Srv.StartServer() to start the server. Now you must continuesly call TeamTalk5Srv.RunEventLoop() to run the server event loop.

The TeamTalk server API is able to do callbacks when users perform certain events. There are two types of callbacks, one is Server Notification Callbacks and the other is Server Request Callbacks where the server is asking the server application on what to return to the user (a BearWare.ClientErrorMsg is provided by the server API which will be returned to the user).

To see a simple example application of a TeamTalk server check out TeamTalk .NET Server Example (TeamTalkServer.NET).

Function Documentation

◆ TeamTalk5Srv() [1/3]

BearWare.TeamTalk5Srv.TeamTalk5Srv ( )

Instantiate TeamTalk server. Call UpdateServer() and MakeChannel() to setup server properties and root channel.

Users cannot log in unless root channel and BearWare.ServerProperties have been set.

See also
UpdateServer()
MakeChannel()
StartServer()

Definition at line 438 of file TeamTalkSrv.cs.

◆ TeamTalk5Srv() [2/3]

BearWare.TeamTalk5Srv.TeamTalk5Srv ( Channel  lpChannel)

Instantiate TeamTalk server with a root channel.

Users cannot log in unless root channel and BearWare.ServerProperties have been set.

See also
UpdateServer()
MakeChannel()
StartServer()

Definition at line 449 of file TeamTalkSrv.cs.

◆ TeamTalk5Srv() [3/3]

BearWare.TeamTalk5Srv.TeamTalk5Srv ( Channel  lpChannel,
ServerProperties  lpServerProperties 
)

Instantiate TeamTalk server with root channel and server properties.

See also
UpdateServer()
MakeChannel()
StartServer()

Definition at line 460 of file TeamTalkSrv.cs.

◆ SetEncryptionContext() [1/2]

bool BearWare.TeamTalkSrvBase.SetEncryptionContext ( string  szCertificateFile,
string  szPrivateKeyFile 
)

Set certificate and private key for encrypted server.

* NOTE: AT THE MOMENT CALL SetEncryptionContext() BEFORE
* CREATING THE SERVER INSTANCE. IN OTHER WORDS ONLY ONE
* ENCRYPTION CONTEXT IS SUPPORTED AT THE MOMENT.
* 

The encrypted server's certificate and private key must be set prior to starting the server using StartServer().

Look in TeamTalk Server Setup Guide on how to generate the certificate and private key file using OpenSSL.

Parameters
szCertificateFilePath to server's certificate file.
szPrivateKeyFilePath to server's private key file.

Definition at line 78 of file TeamTalkSrvBase.cs.

◆ SetEncryptionContext() [2/2]

bool BearWare.TeamTalkSrvBase.SetEncryptionContext ( EncryptionContext  lpEncryptionContext)

Set up encryption context for encrypted server.

The encryption context for the server must be set prior to starting the server using StartServer().

Minimal requirements for the encryption context is to set certificate and private key.

Look in TeamTalk Server Setup Guide on how to generate the certificate and private key file using OpenSSL.

Parameters
lpEncryptionContextThe encryption context for the server, i.e. server certificate, private key and optionally certificate authority.
See also
SetEncryptionContextEx()

Definition at line 100 of file TeamTalkSrvBase.cs.

◆ TeamTalkSrvBase() [1/3]

BearWare.TeamTalkSrvBase.TeamTalkSrvBase ( )
protected

Create new TeamTalk server instance.

Once server instance is created call UpdateServer() to set the server's properties followed by MakeChannel() to create the root channel.

* NOTE: AT THE MOMENT CALL SetEncryptionContext() BEFORE
* CREATING THE SERVER INSTANCE, TeamTalkSrvBase(). 
* IN OTHER WORDS ONLY ONE ENCRYPTION CONTEXT IS
* SUPPORTED AT THE MOMENT.
* 
See also
StartServer()

Definition at line 120 of file TeamTalkSrvBase.cs.

◆ TeamTalkSrvBase() [2/3]

BearWare.TeamTalkSrvBase.TeamTalkSrvBase ( Channel  lpChannel)
protected

Definition at line 124 of file TeamTalkSrvBase.cs.

◆ TeamTalkSrvBase() [3/3]

BearWare.TeamTalkSrvBase.TeamTalkSrvBase ( Channel  lpChannel,
ServerProperties  lpServerProperties 
)
protected

Definition at line 129 of file TeamTalkSrvBase.cs.

◆ Close()

void BearWare.TeamTalkSrvBase.Close ( )

Close TeamTalk server instance.

Definition at line 138 of file TeamTalkSrvBase.cs.

◆ RunEventLoop()

bool BearWare.TeamTalkSrvBase.RunEventLoop ( int  pnWaitMs)

Run the server's event loop.

Parameters
pnWaitMsThe amount of time to wait for the event. If NULL or -1 the function will block forever or until the next event occurs.
Returns
Returns TRUE if an event has occured otherwise FALSE.

Definition at line 148 of file TeamTalkSrvBase.cs.

◆ SetChannelFilesRoot()

ClientError BearWare.TeamTalkSrvBase.SetChannelFilesRoot ( string  szFilesRoot,
Int64  nMaxDiskUsage,
Int64  nDefaultChannelQuota 
)

The root folder of where users should upload files to.

The root file folder cannot be changed after the server has been started.

Ensure to set BearWare.UserRight.USERRIGHT_UPLOAD_FILES and BearWare.UserRight.USERRIGHT_DOWNLOAD_FILES in user's BearWare.UserAccount.

Parameters
szFilesRootDirectory where to store uploaded files.
nMaxDiskUsageThe maximum number of bytes which can be used for file storage.
nDefaultChannelQuotaThe number of bytes available to temporary channels (not BearWare.ChannelType.CHANNEL_PERMANENT). This will be the value in BearWare.Channel nDiskQuota.
Returns
Error code from BearWare.ClientError.

Definition at line 169 of file TeamTalkSrvBase.cs.

◆ UpdateServer()

ClientError BearWare.TeamTalkSrvBase.UpdateServer ( [In] BearWare::ServerProperties  lpServerProperties)

Set server properties.

Set server's properties, like e.g. maximum number of users, server name, etc.

Server properties must be set prior to starting a server.

Parameters
lpServerPropertiesThe server's properties which will be see by all users who log on to the server.
Returns
Returns a BearWare.ClientError.
See also
StartServer()

Definition at line 186 of file TeamTalkSrvBase.cs.

◆ MakeChannel()

virtual ClientError BearWare.TeamTalkSrvBase.MakeChannel ( BearWare::Channel  lpChannel)
virtual

Make new channel.

Create a new channel on the server. Before starting a server using StartServer() the server MUST have a root channel. I.e. a BearWare.Channel where nParentID is 0.

Parameters
lpChannelThe new channel to create.
Returns
Returns a BearWare.ClientError.
See also
UpdateChannel()
RemoveChannel()

Definition at line 202 of file TeamTalkSrvBase.cs.

◆ UpdateChannel()

ClientError BearWare.TeamTalkSrvBase.UpdateChannel ( Channel  lpChannel)

Update an existing channel.

Parameters
lpChannelThe updated channel properties. nChannelID and nParentID must remain the same.
Returns
Returns a BearWare.ClientError.
See also
MakeChannel()
RemoveChannel()

Definition at line 215 of file TeamTalkSrvBase.cs.

◆ RemoveChannel()

ClientError BearWare.TeamTalkSrvBase.RemoveChannel ( int  nChannelID)

Remove a channel.

Parameters
nChannelIDThe ID of the channel to remove.
Returns
Returns a BearWare.ClientError.
See also
MakeChannel()
UpdateChannel()

Definition at line 227 of file TeamTalkSrvBase.cs.

◆ AddFileToChannel()

ClientError BearWare.TeamTalkSrvBase.AddFileToChannel ( string  szLocalFilePath,
BearWare::RemoteFile  lpRemoteFile 
)

Add a file to an existing channel.

Ensure to have set up file storage first using SetChannelFilesRoot(). Also ensure BearWare.Channel's nDiskQuota is specified.

Parameters
szLocalFilePathPath to file.
lpRemoteFileProperties of file to add.
Returns
Command error code from BearWare.ClientError.
See also
SetChannelFilesRoot().
MakeChannel()

Definition at line 243 of file TeamTalkSrvBase.cs.

◆ RemoveFileFromChannel()

ClientError BearWare.TeamTalkSrvBase.RemoveFileFromChannel ( RemoteFile  lpRemoteFile)

Remove a file from a channel.

Ensure to have set up file storage first using SetChannelFilesRoot(). Also ensure BearWare.Channel's nDiskQuota is specified.

Parameters
lpRemoteFileProperties of file to remove. Channel ID and file name is enough.
Returns
Command error code from BearWare.ClientError.
See also
SetChannelFilesRoot().
MakeChannel()

Definition at line 259 of file TeamTalkSrvBase.cs.

◆ MoveUser()

ClientError BearWare.TeamTalkSrvBase.MoveUser ( int  nUserID,
BearWare::Channel  lpChannel 
)

Move a user from one channel to another.

Parameters
nUserIDThe ID of the user to move.
lpChannelThe channel the user should move to. If the channel already exists then simply set nChannelID. To make a user leave a channel set nChannelID to 0.
Returns
Returns a BearWare.ClientError.

Definition at line 271 of file TeamTalkSrvBase.cs.

◆ SendTextMessage()

ClientError BearWare.TeamTalkSrvBase.SendTextMessage ( BearWare::TextMessage  lpTextMessage)

Send text message from server to clients.

Parameters
lpTextMessageText message to send. The message type determines how the message will be sent.
Returns
Returns a BearWare.ClientError.
See also
TeamTalkBase.DoTextMessage()

Definition at line 283 of file TeamTalkSrvBase.cs.

◆ StartServer()

bool BearWare.TeamTalkSrvBase.StartServer ( string  szBindIPAddr,
int  nTcpPort,
int  nUdpPort,
bool  bEncrypted 
)

Start server on specified IP-address and ports.

Before starting a server the root channel must be created using MakeChannel().

Parameters
szBindIPAddrThe IP-address to bind to.
nTcpPortThe TCP port to bind to.
nUdpPortThe UDP port to bind to.
bEncryptedIf encryption is enabled then encryption context must be set prior to this call using SetEncryptionContext().
See also
SetEncryptionContext()
MakeChannel()

Definition at line 301 of file TeamTalkSrvBase.cs.

◆ StartServerSysID()

bool BearWare.TeamTalkSrvBase.StartServerSysID ( string  szBindIPAddr,
int  nTcpPort,
int  nUdpPort,
bool  bEncrypted,
string  szSystemID 
)

Same as StartServer() but with the option of specifying a system-ID.

Requires TeamTalk version 5.1.3.4506.

Parameters
szBindIPAddrThe IP-address to bind to.
nTcpPortThe TCP port to bind to.
nUdpPortThe UDP port to bind to.
bEncryptedIf encryption is enabled then encryption context must be set prior to this call using SetEncryptionContext().
szSystemIDThe identification of the conferencing system. The default value is "teamtalk". See TeamTalkBase.ConnectSysID().

Definition at line 318 of file TeamTalkSrvBase.cs.

◆ StopServer()

bool BearWare.TeamTalkSrvBase.StopServer ( )

Stop server and drop all users.

See also
StartServer()

Definition at line 327 of file TeamTalkSrvBase.cs.

◆ GetVersion()

static string BearWare.TeamTalkSrvBase.GetVersion ( )
static

Definition at line 332 of file TeamTalkSrvBase.cs.

◆ CallBack()

BearWare.TeamTalkSrvBase.CallBack.CallBack ( Delegate  lpCallback)

Definition at line 338 of file TeamTalkSrvBase.cs.

◆ GetFuncPointer()

IntPtr BearWare.TeamTalkSrvBase.CallBack.GetFuncPointer ( )

Definition at line 351 of file TeamTalkSrvBase.cs.

◆ Dispose() [1/2]

void BearWare.TeamTalkSrvBase.CallBack.Dispose ( )

Definition at line 355 of file TeamTalkSrvBase.cs.

◆ Dispose() [2/2]

void BearWare.TeamTalkSrvBase.CallBack.Dispose ( bool  disposing)
protected

Definition at line 360 of file TeamTalkSrvBase.cs.

◆ Compare()

bool BearWare.TeamTalkSrvBase.CallBack.Compare ( Delegate  x)

Definition at line 372 of file TeamTalkSrvBase.cs.