예제 #1
0
 private void deleteMe()
 {
     if (m_ttsInst != IntPtr.Zero)
     {
         TTProDLL.TTS_CloseTeamTalk(m_ttsInst);
         m_ttsInst = IntPtr.Zero;
     }
 }
예제 #2
0
 /**
  * @brief Stop server and drop all users.
  *
  * @see StartServer() */
 public bool StopServer()
 {
     return(TTProDLL.TTS_StopServer(m_ttsInst));
 }
예제 #3
0
 public static string GetVersion()
 {
     return(Marshal.PtrToStringAuto(TTProDLL.TT_GetVersion()));
 }
예제 #4
0
 /**
  * @brief Start server on specified IP-address and ports.
  *
  * Before starting a server the root channel must be created using
  * MakeChannel().
  *
  * @param szBindIPAddr The IP-address to bind to.
  * @param nTcpPort The TCP port to bind to.
  * @param nUdpPort The UDP port to bind to.
  * @param bEncrypted If encryption is enabled then encryption context
  * must be set prior to this call using SetEncryptionContext().
  *
  * @see SetEncryptionContext()
  * @see MakeChannel() */
 public bool StartServer(string szBindIPAddr, int nTcpPort, int nUdpPort, bool bEncrypted)
 {
     return(TTProDLL.TTS_StartServer(m_ttsInst, szBindIPAddr, nTcpPort, nUdpPort, bEncrypted));
 }
예제 #5
0
 /**
  * @brief Same as StartServer() but with the option of
  * specifying a system-ID.
  *
  * Requires TeamTalk version 5.1.3.4506.
  *
  * @param szBindIPAddr The IP-address to bind to.
  * @param nTcpPort The TCP port to bind to.
  * @param nUdpPort The UDP port to bind to.
  * @param bEncrypted If encryption is enabled then encryption context
  * must be set prior to this call using SetEncryptionContext().
  * @param szSystemID The identification of the conferencing system.
  * The default value is "teamtalk". See TeamTalk.ConnectSysID(). */
 public bool StartServerSysID(string szBindIPAddr, int nTcpPort, int nUdpPort, bool bEncrypted,
                              string szSystemID)
 {
     return(TTProDLL.TTS_StartServerSysID(m_ttsInst, szBindIPAddr, nTcpPort, nUdpPort, bEncrypted, szSystemID));
 }
예제 #6
0
 /**
  * @brief Run the server's event loop.
  *
  * @param pnWaitMs The amount of time to wait for the event. If NULL or -1
  * the function will block forever or until the next event occurs.
  * @return Returns TRUE if an event has occured otherwise FALSE. */
 public bool RunEventLoop(int pnWaitMs)
 {
     return(TTProDLL.TTS_RunEventLoop(m_ttsInst, pnWaitMs));
 }
예제 #7
0
 /**
  * @brief Send text message from server to clients.
  *
  *
  * @param lpTextMessage Text message to send. The message type determines
  * how the message will be sent.
  * @return Returns a #ClientError.
  * @see TeamTalk.DoTextMessage() */
 public ClientError SendTextMessage(BearWare.TextMessage lpTextMessage)
 {
     return(TTProDLL.TTS_SendTextMessage(m_ttsInst, ref lpTextMessage));
 }
예제 #8
0
 /**
  * @brief Add a file to an existing channel.
  *
  * Ensure to have set up file storage first using SetChannelFilesRoot().
  * Also ensure #BearWare.Channel's @c nDiskQuota is specified.
  *
  * @param szLocalFilePath Path to file.
  * @param lpRemoteFile Properties of file to add.
  * @return Command error code from #ClientError.
  *
  * @see SetChannelFilesRoot().
  * @see MakeChannel() */
 public ClientError AddFileToChannel(string szLocalFilePath, BearWare.RemoteFile lpRemoteFile)
 {
     return(TTProDLL.TTS_AddFileToChannel(m_ttsInst, ref szLocalFilePath, ref lpRemoteFile));
 }
예제 #9
0
 /**
  * @brief Remove a file from a channel.
  *
  * Ensure to have set up file storage first using SetChannelFilesRoot().
  * Also ensure #BearWare.Channel's @c nDiskQuota is specified.
  *
  * @param lpRemoteFile Properties of file to remove. Channel ID and
  * file name is enough.
  * @return Command error code from #ClientError.
  *
  * @see SetChannelFilesRoot().
  * @see MakeChannel() */
 public ClientError RemoveFileFromChannel(RemoteFile lpRemoteFile)
 {
     return(TTProDLL.TTS_RemoveFileFromChannel(m_ttsInst, ref lpRemoteFile));
 }
예제 #10
0
 /**
  * @brief Update an existing channel.
  *
  * @param lpChannel The updated channel properties. @c nChannelID
  * and @c nParentID must remain the same.
  * @return Returns a #ClientError.
  *
  * @see MakeChannel()
  * @see RemoveChannel() */
 public ClientError UpdateChannel(Channel lpChannel)
 {
     return(TTProDLL.TTS_UpdateChannel(m_ttsInst, ref lpChannel));
 }
예제 #11
0
 /**
  * @brief Remove a channel.
  *
  * @param nChannelID The ID of the channel to remove.
  * @return Returns a #ClientError.
  *
  * @see MakeChannel()
  * @see UpdateChannel() */
 public ClientError RemoveChannel(int nChannelID)
 {
     return(TTProDLL.TTS_RemoveChannel(m_ttsInst, nChannelID));
 }
예제 #12
0
 /**
  * @brief 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 @c nParentID is 0.
  *
  * @param lpChannel The new channel to create.
  * @return Returns a #ClientError.
  *
  * @see UpdateChannel()
  * @see RemoveChannel() */
 public virtual ClientError MakeChannel(BearWare.Channel lpChannel)
 {
     return(TTProDLL.TTS_MakeChannel(m_ttsInst, ref lpChannel));
 }
예제 #13
0
 /**
  * @brief 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.
  *
  * @param lpServerProperties The server's properties which will be
  * see by all users who log on to the server.
  * @return Returns a #ClientError.
  *
  * @see StartServer() */
 public ClientError UpdateServer([In] BearWare.ServerProperties lpServerProperties)
 {
     return(TTProDLL.TTS_UpdateServer(m_ttsInst, ref lpServerProperties));
 }
예제 #14
0
 /**
  * @brief 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 #USERRIGHT_UPLOAD_FILES and #USERRIGHT_DOWNLOAD_FILES
  * in user's #BearWare.UserAccount.
  *
  * @param szFilesRoot Directory where to store uploaded files.
  * @param nMaxDiskUsage The maximum number of bytes which can be used for
  * file storage.
  * @param nDefaultChannelQuota The number of bytes available to temporary
  * channels (not #CHANNEL_PERMANENT). This will be the value in #BearWare.Channel
  * @c nDiskQuota.
  *
  * @return Error code from #ClientError. */
 public ClientError SetChannelFilesRoot(string szFilesRoot, Int64 nMaxDiskUsage, Int64 nDefaultChannelQuota)
 {
     return(TTProDLL.TTS_SetChannelFilesRoot(m_ttsInst, szFilesRoot, nMaxDiskUsage, nDefaultChannelQuota));
 }
예제 #15
0
        /** @addtogroup serverapi
         * @{ */

        /**
         * @brief Set certificate and private key for encrypted server.
         *
         * @verbatim
         * NOTE: AT THE MOMENT CALL SetEncryptionContext() BEFORE
         * CREATING THE SERVER INSTANCE. IN OTHER WORDS ONLY ONE
         * ENCRYPTION CONTEXT IS SUPPORTED AT THE MOMENT.
         * @endverbatim
         *
         * The encrypted server's certificate and private key must be set
         * prior to starting the server using StartServer().
         *
         * Look in @ref serversetup on how to generate the certificate and
         * private key file using OpenSSL.
         *
         * @param szCertificateFile Path to server's certificate file.
         * @param szPrivateKeyFile Path to server's private key file. */
        public static bool SetEncryptionContext(string szCertificateFile, string szPrivateKeyFile)
        {
            return(TTProDLL.TTS_SetEncryptionContext(m_ttsInst, ref szCertificateFile, ref szPrivateKeyFile));
        }
예제 #16
0
 /**
  * @brief Move a user from one channel to another.
  *
  * @param nUserID The ID of the user to move.
  * @param lpChannel The channel the user should move to. If the
  * channel already exists then simply set @c nChannelID. To make
  * a user leave a channel set @c nChannelID to 0.
  * @return Returns a #ClientError. */
 public ClientError MoveUser(int nUserID, BearWare.Channel lpChannel)
 {
     return(TTProDLL.TTS_MoveUser(m_ttsInst, nUserID, ref lpChannel));
 }
예제 #17
0
 /**
  * @brief 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.
  *
  * @verbatim
  * NOTE: AT THE MOMENT CALL SetEncryptionContext() BEFORE
  * CREATING THE SERVER INSTANCE, TeamTalkSrvBase().
  * IN OTHER WORDS ONLY ONE ENCRYPTION CONTEXT IS
  * SUPPORTED AT THE MOMENT.
  * @endverbatim
  *
  * @see StartServer() */
 protected TeamTalkSrvBase()
 {
     m_ttsInst = TTProDLL.TTS_InitTeamTalk();
 }
예제 #18
0
 /**
  * @brief 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 @ref serversetup on how to generate the certificate and
  * private key file using OpenSSL.
  *
  * @param lpEncryptionContext The encryption context for the server,
  * i.e. server certificate, private key and optionally certificate
  * authority.
  *
  * @see SetEncryptionContextEx() */
 public bool SetEncryptionContext(EncryptionContext lpEncryptionContext)
 {
     return(TTProDLL.TTS_SetEncryptionContextEx(m_ttsInst, ref lpEncryptionContext));
 }