private void NimSignalingOnlineNotifyCallback(NIMSignalingNotityInfo notify_info) { string info = ""; switch (notify_info.event_type_) { case NIMSignalingEventType.kNIMSignalingEventTypeClose: case NIMSignalingEventType.kNIMSignalingEventTypeLeave: case NIMSignalingEventType.kNIMSignalingEventTypeCtrl: info = notify_info.ToString(); break; case NIMSignalingEventType.kNIMSignalingEventTypeJoin: NIMSignalingNotityInfoJoin join_info = (NIMSignalingNotityInfoJoin)notify_info; info = join_info.ToString(); break; case NIMSignalingEventType.kNIMSignalingEventTypeInvite: NIMSignalingNotityInfoInvite invite_info = (NIMSignalingNotityInfoInvite)notify_info; info = invite_info.ToString(); break; case NIMSignalingEventType.kNIMSignalingEventTypeCancelInvite: NIMSignalingNotityInfoCancelInvite cancel_invite_info = (NIMSignalingNotityInfoCancelInvite)notify_info; info = cancel_invite_info.ToString(); break; case NIMSignalingEventType.kNIMSignalingEventTypeReject: NIMSignalingNotityInfoReject reject_invite_info = (NIMSignalingNotityInfoReject)notify_info; info = reject_invite_info.ToString(); break; case NIMSignalingEventType.kNIMSignalingEventTypeAccept: NIMSignalingNotityInfoAccept accept_invite_info = (NIMSignalingNotityInfoAccept)notify_info; info = accept_invite_info.ToString(); break; } PrintInfo(info); switch (notify_info.event_type_) { case NIMSignalingEventType.kNIMSignalingEventTypeJoin: LbMembersOpt(true, notify_info.from_account_id_); break; case NIMSignalingEventType.kNIMSignalingEventTypeLeave: LbMembersOpt(false, notify_info.from_account_id_); break; } }
public static NIMSignalingNotityInfoInvite NIMSignalingNotityInfoFromC(NIMSignalingNotityInfoInvite_C info_c) { NIMSignalingNotityInfoInvite info = new NIMSignalingNotityInfoInvite(); info.event_type_ = info_c.event_type_; info.from_account_id_ = Convert.ToString(Utf8StringMarshaler.GetInstance("").MarshalNativeToManaged(info_c.from_account_id_)); info.custom_info_ = Convert.ToString(Utf8StringMarshaler.GetInstance("").MarshalNativeToManaged(info_c.custom_info_)); info.channel_info_ = NIMSignalingChannelInfoFromC(info_c.channel_info_); info.timestamp_ = info_c.timestamp_; info.to_account_id_ = Convert.ToString(Utf8StringMarshaler.GetInstance("").MarshalNativeToManaged(info_c.to_account_id_)); info.request_id_ = Convert.ToString(Utf8StringMarshaler.GetInstance("").MarshalNativeToManaged(info_c.request_id_)); info.push_info_ = NIMSignalingPushInfoFromC(info_c.push_info_); return(info); }
private void NimSignalingNotifyCallback(NIMSignalingNotityInfo notify_info) { switch (notify_info.event_type_) { case NIMSignalingEventType.kNIMSignalingEventTypeClose: case NIMSignalingEventType.kNIMSignalingEventTypeLeave: case NIMSignalingEventType.kNIMSignalingEventTypeCtrl: break; case NIMSignalingEventType.kNIMSignalingEventTypeJoin: NIMSignalingNotityInfoJoin join_info = (NIMSignalingNotityInfoJoin)notify_info; break; case NIMSignalingEventType.kNIMSignalingEventTypeInvite: NIMSignalingNotityInfoInvite invite_info = (NIMSignalingNotityInfoInvite)notify_info; break; case NIMSignalingEventType.kNIMSignalingEventTypeCancelInvite: NIMSignalingNotityInfoCancelInvite cancel_invite_info = (NIMSignalingNotityInfoCancelInvite)notify_info; break; case NIMSignalingEventType.kNIMSignalingEventTypeReject: NIMSignalingNotityInfoReject reject_invite_info = (NIMSignalingNotityInfoReject)notify_info; break; case NIMSignalingEventType.kNIMSignalingEventTypeAccept: NIMSignalingNotityInfoAccept accept_invite_info = (NIMSignalingNotityInfoAccept)notify_info; break; } string info = "NimSignalingNotifyCallback event type:" + notify_info.event_type_ + "createor_id" + notify_info.channel_info_.creator_id_ + "channel_id" + notify_info.channel_info_.channel_id_ + "channel_name" + notify_info.channel_info_.channel_name_ + "from_account_id" + notify_info.from_account_id_; PrintInfo(info); }