using System;using System.Text;using System.Runtime.InteropServic es;namespace ANYCHATAPI
{
/******************************************************************************
*****
* **AnyChat Platform Server SDK
*
*******************************************************************************
**/public class AnyChatServerSDK
{public const string AnyChatServerSDKDll="AnyChatServerSDK.dll";
//#define BRAS_SERVERAPPMSG_CONNECTED 1 ///< 连 接AnyCh at服务器成功public const int BRAS_SERVERAPPMSG_CONNECTED=1;
//#define BRAS_SERVERAPPMSG_DISCONNECT 2 ///< 与 AnyChat服务器断开连接public const int BRAS_SERVERAPPMSG_DISCONNECT=2;
/**
* 回调函数定义
*/
//服务器应用程序消息回调函数定义
//typedef void (CALLBACK* BRAS_OnServerAppMessage_CallBack)(DWORDdwMsg,LPVOID lpUserValue);public delegate void OnServerAppMessageCallBack(int msg, int userValue);
// SDK定时器回调函数定义上层应用可以在该回调中处理定时任务而不需要额外开启线程或是定时器
//typedef void (CALLBACK* BRAS_OnTimerEvent_CallBack)(LPVOIDlp Us erValue);public delegate void OnTimerEventCallBack(int userValue);
//用户身份验证回调函数定义
// typedef DWORD (CALLBACK* BRAS_VerifyUser_CallBack)(IN LPCTSTRlpUserName,IN LPCTSTR lpPassword, OUT LPDWORD lpUserID, OUT LPDWORDlpUserLevel,OUT LPTSTR lpNickName,IN DWORD dwNCLen,LPVOID lpUserValue);public delegate int VerifyUserCallBack(string userName, string password, ref int userID,
ref int userLevel, IntPtr nickName, int len,int userValue);
//用户申请进入房间回调函数定义
//typedef DWORD (CALLBACK* BRAS_PrepareEnterRoom_CallBack)(DWORDdwUserId, DWORD dwRoomId, LPCTSTR lpRoomName,LPCTSTR lpPassword, LPVOIDlp Us erValue);public delegate int PrepareEnterRoomCallBack(int userId, int roomId, string roomName,string pas sword, int userValue);
//用户登录成功回调函数定义
//typedef void (CALLBACK* BRAS_OnUserLoginAction_CallBack)(DWORDdwUserId, LPCTSTR szUserName, DWORD dwLevel, LPCTSTR szIpAddr, LPVOIDlp Us erValue);public delegate void OnUserLoginActionCallBack(int userId, string userName, int level,string addr, int us erValue);
//用户注销回调函数定义
//typedef void (CALLBACK* BRAS_OnUserLogoutAction_CallBack)(DWORDdwUserId,LPVOID lpUserValue);public delegate void OnUserLogoutActionCallBack(int userId, int userValue);
//用户进入房间回调函数定义
//typedef void (CALLBACK* BRAS_OnUserEnterRoomAction_CallBack)(DWORDdwUserId,DWORD dwRoomId,LPVOID lpUserValue);public delegate void OnUserEnterRoomActionCallBack(int userId, int roomId, intuserValue);
//用户离开房间回调函数定义
//typedef void (CALLBACK* BRAS_OnUserLeaveRoomAction_CallBack)(DWORDdwUserId,DWORD dwRoomId,LPVOID lpUserValue);public delegate void OnUserLeaveRoomActionCallBack(int userId, int roomId, intuserValue);
//上层业务自定义数据回调函数定义
//typedef void (CALLBACK* BRAS_OnRecvUserFilterData_CallBack)(DWORDdwUserId,LPCTSTR lpBuf,DWORD dwLen,LPVOID lpUserValue);public delegate void OnRecvUserFilterDataCallBack(int userId, IntPtr buf, int len, intuserValue);
//收到用户文字聊天通信数据回调函数定义
//typedef void (CALLBACK* BRAS_OnRecvUserTextMsg_CallBack)(DWORDdwRoomId, DWORD dwSrcUserId, DWORD dwTarUserId, BOOL bSecret, LPCTSTRlpTextMessage,DWORD dwLen,LPVOID lpUserValue);public delegate void OnRecvUserTextMsgCallBack(int roomId, int srcUserId, int
tarUserId,bool bSecret, string textMes sage, int len, int userValue);
//透明通道数据回调函数定义
//typedef void(CALLBACK*BRAS_OnTransBuffer_CallBack)(DWORD dwUserId,LPBYTE lpBuf,DWORD dwLen,LPVOID lpUserValue);public delegate void OnTransBufferCallBack(int dwUserId, IntPtr lpBuf, int dwLen, intlp Us erValue);
//透明通道数据扩展回调函数定义
//typedef void (CALLBACK * BRAS_OnTransBufferEx_CallBack)(DWORDdwUserId,LPBYTE lpBuf,DWORD dwLen,DWORD wParam,DWORD lParam,DWORDdwTaskId,LPVOID lpUserValue);public delegate void OnTransBufferExCallBack(int dwUserId, IntPtr lpBuf, int dwLen,int wParam, int lParam, int dwTaskId, int lpUserValue);
//文件传输回调函数定义
//typedef void (CALLBACK* BRAS_OnTransFile_CallBack)(DWORD dwUserId,LPCTSTR lpFileName,LPCTSTR lpTempF ilePath,DWORD dwFileLength,DWORD wParam,DWORD lParam,DWORD dwTaskId,LPVOID lpUserValue);public delegate void OnTransFileCallBack(int dwUserId, string lpFileName, stringlpTempFilePath, int dwFile Length, int wParam, int lParam, int dwTaskId, int lpUs er Value);
/**
* API方法定义
*/
//设置服务器应用程序消息回调函数
//BRAS_API DWORD
BRAS_SetOnServerAppMessageCallBack(BRAS_OnServerAppMessage_CallBack lpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erver S D KD ll, EntryP oint ="BRAS_SetOnServerAppMes sageCallBack",CallingConv ention=CallingConvention.Cdec l)]public static extern intBRAS_SetOnServerAppMessageCallBack(OnServerAppMessageCallBack function, intuserValue);
//设置SDK定时器回调函数dwElapse定时器间隔单位ms
// BRAS_API DWORD BRAS_SetTimerEventCallBack(DWORD dwElapse,BRAS_OnTimerEvent_CallBack lpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erverSD KD ll, EntryPo int = "BRAS_S etTimer EventCallBac k",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_SetTimerEventCallBack(int elapse,OnTimerEventCallBack function, int userValue);
//设置用户身份验证回调函数
//BRAS_API DWORD BRAS_SetVerifyUserCallBack(BRAS_VerifyUser_CallBacklpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erverSD KD ll, EntryPoint = "BRAS_S etVer ifyUs erCallBac k",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_SetVerifyUserCallBack(VerifyUserCallBack function, intuserValue);
//设置用户申请进入房间回调函数
// BRAS_API DWORD
BRAS_SetPrepareEnterRoomCallBack(BRAS_PrepareEnterRoom_CallBack lpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erverSD KD ll, EntryPoint ="BRAS_SetPrepareEnterRoomCallBack",CallingConvention=CallingConvention.Cdec l)]public static extern intBRAS_SetPrepareEnterRoomCallBack(PrepareEnterRoomCallBack function, int us erValue);
//设置用户登录成功回调函数
//BRAS_API DWORD
BRAS_SetOnUserLoginActionCallBack(BRAS_OnUserLoginAction_CallBack lpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erver S D KD ll, EntryP oint ="BRAS_SetOnUserLog inActionCallBack",Calling Convention=CallingConv ention.Cdecl)]public static extern intBRAS_SetOnUserLoginActionCallBack(OnUserLoginActionCallBack function, int userValue);
//设置用户注销回调函数
//BRAS_API DWORD
BRAS_SetOnUserLogoutActionCallBack(BRAS_OnUserLogoutAction_CallBack lpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erver S D KD ll, EntryP oint ="BRAS_SetOnUserLogoutActionCallBack",Calling Convention=CallingConv ention.Cdec l)]public static extern intBRAS_SetOnUs erLogoutActionCallBack(OnUs erLogoutActionCallBack function, int us erValue);
//设置用户进入房间回调函数
//BRAS_API DWORD
BRAS_SetOnUserEnterRoomActionCallBack(BRAS_OnUserEnterRoomAction_CallBacklpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erver S D KD ll, EntryP oint ="BRAS_SetOnUserEnterRoomAction CallBack",CallingConvention=CallingConv ention.Cdec l)]public static extern intBRAS_SetOnUserEnterRoomActionCallBack(OnUserEnterRoomActionCallBack function, int
userValue);
//设置用户离开房间回调函数
//BRAS_API DWORD
BRAS_SetOnUserLeaveRoomActionCallBack(BRAS_OnUserLeaveRoomAction_CallBacklpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erver S D KD ll, EntryP oint ="BRAS_SetOnUserLeaveRoomActionCallBack", Calling Convention =Calling Convention.Cdec l)]public static extern intBRAS_SetOnUserLeaveRoomActionCallBack(OnUserLeaveRoomActionCallBack function, intuserValue);
//设置用户上层业务自定义数据回调函数
// BRAS_API DWORD
BRAS_SetOnRecvUserFilterDataCallBack(BRAS_OnRecvUserFilterData_CallBack lpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erver S D KD ll, EntryP oint ="BRAS_SetOnRecvUs erFilterDataCallBack",Calling Convention=CallingConv ention.Cdec l)]public static extern intBRAS_SetOnRecvUserFilterDataCallBack(OnRecvUserFilterDataCallBack function, intuserValue);
//设置用户文字聊天通信数据回调函数
//BRAS_API DWORD
BRAS_SetOnRecvUserTextMsgCallBack(BRAS_OnRecvUserTextMsg_CallBack lpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erver S D KD ll, EntryP oint ="BRAS_SetOnRecvUs erTextMsgCallBack",Calling Convention=CallingConvention.Cdec l)]public static extern intBRAS_S etOnRecvUs erTextMs gCallBack(OnRecvUs erTextMs gCallBack function, int us erValue);
//设置透明通道数据回调函数
//BRAS_API DWORD
BRAS_SetOnTransBufferCallBack(BRAS_OnTransBuffer_CallBack lpFunction, LPVOIDlp Us er Value=NULL);
[DllImport(AnyChatS erverSD KD ll,EntryPoint="BRAS_S etOnTransBufferCallBac k",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_SetOnTransBufferCallBack(OnTransBufferCallBackfunc tion, int lpUs er Value);
//设置透明通道数据扩展回调函数
//BRAS_API DWORD
BRAS_SetOnTransBufferExCallBack(BRAS_OnTransBufferEx_CallBack lpFunction, LPVOIDlp Us er Value=NULL);
[DllImport(AnyChatS erver S D KD ll, EntryP oint ="BRAS_SetOnTransBufferExCallBack",CallingConvention=Calling Convention.Cdec l)]public static extern intBRAS_SetOnTransBufferExCallBack(OnTransBufferExCallBack function, int lpUserValue);
//设置文件传输回调函数
//BRAS_API DWORD BRAS_SetOnTransFileCallBack(BRAS_OnTransFile_CallBacklpFunction,LPVOID lpUserValue=NULL);
[DllImport(AnyChatS erverSD KD ll, EntryPoint = "BRAS_S etOnTransFileCallBac k",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_SetOnTransFileCallBack(OnTransFileCallBack function,int lpUserValue);
//获取SDK版本信息
//BRAS_API DWORD BRAS_GetSDKVersion(DWORD& dwMainVer, DWORD&dw SubVer,TCHAR* lp CompileTime,DWORD dwBufLen);
[DllImport(AnyChatS erverSD KD ll, EntryPo int = "BRAS_GetSD KVers ion",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_GetSDKVersion(ref int dwMainVer, ref int dwSubVer,StringBuilder lp Comp ileTime, int bufLen);
//初始化SDK
//BRAS_API DWORD BRAS_InitSDK(DWORD dwReserved);
[DllImport(AnyChatS erverSD KD ll,EntryPoint="BRAS_In itSDK",CallingConvent ion=CallingConvention.Cdec l)]public static extern int BRAS_InitSDK(int reserved);
//释放资源
//BRAS_API DWORD BRAS_Release(void);
[DllImport(AnyChatS erverSD KD ll,EntryPoint="BRAS_Re leas e",CallingConvention=CallingConvention.Cdec l)]public static extern int BRAS_Release();
//向指定用户发送数据
//BRAS_API DWORD BRAS_SendBufToUser(DWORD dwUserId,LPCTSTR lpBuf,DWORD dwLen);
[DllImport(AnyChatS erverSD KD ll, EntryPoint = "BRAS_S endBufToUs er",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_SendBufToUser(int userId,byte[]buf, int len);
//向指定房间的所有用户发送数据
//BRAS_API DWORD BRAS_SendBufToRoom(DWORD dwRoomId, LPCTSTRlp Buf,DWORD dwLen);
[DllImport(AnyChatS erverSD KD ll, EntryPoint = "BRAS_S endBufToRoom",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_SendBufToRoom(int dwRoomId, byte[] lpBuf, intdw Len);
// 向指定用户发送透明通道数据
//BRAS_API DWORD BRAS_TransBuffer(DWORD dwUserId, LPBYTE lpBuf,DWORD dwLen);
[DllImport(AnyChatS erverSD KD ll, EntryPoint = "BRAS_TransBuffer",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_TransBuffer(int dwUserId,byte[] lpBuf, int dwLen);
// 向指定用户发送扩展缓冲区数据
//BRAS_API DWORD BRAS_TransBufferEx(DWORD dwUserId, LPBYTE lpBuf,DWORD dwLen, DWORD wParam, DWORD lParam, DWORD dwFlags, DWORD&dw Tas kI d);
[DllImport(AnyChatS erverSD KD ll, EntryPoint = "BRAS_TransBufferEx",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_TransBufferEx(int dwUserId,byte[] lpBuf, int dwLen, intwParam, int lParam, int dwFlags,ref int dwTaskId);
// 向指定用户发送文件
//BRAS_API DWORD BRAS_TransFile(DWORD dwUserId, LPCTSTRlpLocalPathName, DWORD wParam, DWORD lParam, DWORD dwFlags, DWORD&dw Tas kI d);
[DllImport(AnyChatS erverSD KD ll, EntryPoint = "BRAS_Trans File",Calling Convention=CallingConvention.Cdec l)]public static extern int BRAS_TransFile(int dwUserId, string lpLocalPathName, intwParam, int lParam, int dwFlags,ref int dwTaskId);
}
}
SDK包android http://pan.baidu.c om/share/link?share id=441352&uk=2720497303w indow s:http://pan.baidu.c om/share/link?shareid=441348&uk=2720497303
Linux http://p an.b a idu.c om/s hare/link?s har eid=441349&uk=2720497303
I O S http://pan.baidu.c om/s hare/link?s hareid=441350&uk=2720497303
全新PHP短网址系统URL缩短器平台,它使您可以轻松地缩短链接,根据受众群体的位置或平台来定位受众,并为缩短的链接提供分析见解。系统使用了Laravel框架编写,前后台双语言使用,可以设置多域名,还可以开设套餐等诸多功能,值得使用。链接: https://pan.baidu.com/s/1ti6XqJ22tp1ULTJw7kYHog?pwd=sarg 提取码: sarg文件解压密码 www.wn7...
totyun,新公司,主要运作香港vps、日本vps业务,接入cn2网络,不限制流量!VPS基于KVM虚拟,采用系统盘和数据盘分离,从4G内存开始支持Windows系统...大家注意下,网络分“Premium China”、“Global”,由于站长尚未测试,所以也还不清楚情况,有喜欢吃螃蟹的尝试过不妨告诉下站长。官方网站:https://totyun.com一次性5折优惠码:X4QTYVNB3P...
蓝速数据金秋上云季2G58/年怎么样?蓝速数据物理机拼团0元购劲爆?蓝速数据服务器秒杀爆产品好不好?蓝速数据是广州五联科技信息有限公司旗下品牌云计算平台、采用国内首选Zkeys公有云建设多种开通方式、具有IDC、ISP从业资格证IDC运营商新老用户值得信赖的商家。我司主要从事内地的枣庄、宿迁、深圳、绍兴、成都(市、县)。待开放地区:北京、广州、十堰、西安、镇江(市、县)。等地区数据中心业务,均KV...