Пример #1
0
        /// <summary>
        ///创建一个多人房间(后续需要主动调用加入接口进入房间)
        /// </summary>
        /// <param name="room_name">房间名</param>
        /// <param name="custom_info">自定义的房间信息(加入房间的时候会返回)</param>
        /// <param name="createRoomInfo">json封装类,见NIMCreateRoomJsonEx</param>
        /// <param name="cb">结果回调</param>
        /// <returns>无返回值</returns>
        public static void CreateRoom(string room_name, string custom_info, NIMCreateRoomJsonEx createRoomInfo, NIMVChatOpt2Handler cb)
        {
            string json_extension = null;

            if (createRoomInfo != null)
            {
                json_extension = createRoomInfo.Serialize();
            }
            var ptr = NimUtility.DelegateConverter.ConvertToIntPtr(cb);

            VChatNativeMethods.nim_vchat_create_room(room_name, custom_info, json_extension, VChatOpt2Cb, ptr);
        }
Пример #2
0
        /// <summary>
        ///创建一个多人房间(后续需要主动调用加入接口进入房间)
        /// </summary>
        /// <param name="room_name">房间名</param>
        /// <param name="custom_info">自定义的房间信息(加入房间的时候会返回)</param>
        /// <param name="createRoomInfo">json封装类,见NIMCreateRoomJsonEx</param>
        /// <param name="cb">结果回调</param>
        /// <returns>无返回值</returns>
        public static void CreateRoom(string room_name, string custom_info, NIMCreateRoomJsonEx createRoomInfo, NIMVChatOpt2Handler cb)
        {
#if NIMAPI_UNDER_WIN_DESKTOP_ONLY || UNITY_STANDALONE_WIN
            string json_extension = null;
            if (createRoomInfo != null)
            {
                json_extension = createRoomInfo.Serialize();
            }
            var ptr = NimUtility.DelegateConverter.ConvertToIntPtr(cb);
            VChatNativeMethods.nim_vchat_create_room(room_name, custom_info, json_extension, VChatOpt2Cb, ptr);
#else
#endif
        }