-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathTeamTalkSrvInterop.cs
133 lines (129 loc) · 11.8 KB
/
TeamTalkSrvInterop.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
* Copyright (c) 2005-2018, BearWare.dk
*
* Contact Information:
*
* Bjoern D. Rasmussen
* Kirketoften 5
* DK-8260 Viby J
* Denmark
* Email: contact@bearware.dk
* Phone: +45 20 20 54 59
* Web: http://www.bearware.dk
*
* This source code is part of the TeamTalk SDK owned by
* BearWare.dk. Use of this file, or its compiled unit, requires a
* TeamTalk SDK License Key issued by BearWare.dk.
*
* The TeamTalk SDK License Agreement along with its Terms and
* Conditions are outlined in the file License.txt included with the
* TeamTalk SDK distribution.
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using BearWare;
namespace c_tt
{
class TTProDLL : c_tt.TTDLL
{
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_StartServer(IntPtr lpTTSInstance, [MarshalAs(UnmanagedType.LPWStr)] string szBindIPAddr,
[In] int nTcpPort, [In] int nUdpPort, bool bEncrypted);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_StartServerSysID(IntPtr lpTTSInstance, [MarshalAs(UnmanagedType.LPWStr)] string szBindIPAddr,
[In] int nTcpPort, [In] int nUdpPort, bool bEncrypted,
[MarshalAs(UnmanagedType.LPWStr)] string szSystemID);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern IntPtr TTS_InitTeamTalk();
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_UpdateServer(IntPtr lpTTSInstance, [In] ref BearWare.ServerProperties lpServerInfo);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_MakeChannel(IntPtr lpTTSInstance, [In, Out] ref BearWare.Channel lpChannel);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RunEventLoop(IntPtr lpTTSInstance, int pnWaitMs);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserLoginCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_CloseTeamTalk(IntPtr lpTTSInstance);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_MoveUser(IntPtr lpTTSInstance, int nUserID, [In] ref BearWare.Channel lpChannel);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_SendTextMessage(IntPtr lpTTSInstance, [In] ref BearWare.TextMessage lpTextMessage);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_RemoveChannel(IntPtr lpTTSInstance, [In] int nChannelID);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_RemoveFileFromChannel(IntPtr lpTTSInstance, [In] ref BearWare.RemoteFile lpRemoteFile);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_SetEncryptionContext(IntPtr lpTTSInstance, [In] ref string szCertificateFile, [In] ref string szPrivateKeyFile);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_SetEncryptionContextEx(IntPtr lpTTInstance, ref BearWare.EncryptionContext lpEncryptionContext);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_StopServer(IntPtr lpTTSInstance);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_AddFileToChannel(IntPtr lpTTSInstance, [In] ref string szLocalFilePath, [In] ref BearWare.RemoteFile lpRemoteFile);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_SetChannelFilesRoot(IntPtr lpTTSInstance, [In, Out] string szFilesRoot, [In] Int64 nMaxDiskUsage, [In] Int64 nDefaultChannelQuota);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern BearWare.ClientError TTS_UpdateChannel(IntPtr lpTTSInstance, [In] ref BearWare.Channel lpChannel);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserLoggedInCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserLoggedOutCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserDisconnectedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserTimedoutCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserKickedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserBannedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserUnbannedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserUpdatedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserJoinedChannelCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserLeftChannelCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserMovedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserTextMessageCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterChannelCreatedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterChannelUpdatedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterChannelRemovedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterFileUploadedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterFileDownloadedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterFileDeletedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterServerUpdatedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterSaveServerConfigCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserCreateUserAccountCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserDeleteUserAccountCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserAddServerBanCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserAddServerBanIPAddressCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserDeleteServerBanCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserConnectedCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserChangeNicknameCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
[DllImport(dllname, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
public static extern bool TTS_RegisterUserChangeStatusCallback(IntPtr lpTTSInstance, IntPtr lpCallback, int lpUserData, bool bEnable);
}
}