/// <summary> /// 插件的按键回调函数 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void item_runhandle(object sender, PluginRunEvent.PluginRunEventArgs args) { var p = args.plugin; var list = new List <Friend>(); var f_list = new SortedSet <int>(); foreach (var item in FriendList.Values) { if (item.isSelected) { list.Add(item); f_list.Add(item.user_id); } } try { p.user_list = list; p.isServer = true; p.ip = Me.ip; p.Me = Me; p.RunPlugin(); }catch (Exception e) { MessageBox.Show(e.ToString()); } new Thread(() => { if (f_list.Count != 0) { ServerAPI.InviteFriends(p.ID, Me.user_id, f_list); } }).Start(); // MessageBox.Show("Hello"); }
public void InviteFriendsTest() { int plugin_id = 1; SortedSet <int> id_list = new SortedSet <int>(); id_list.Add(44); var v = ServerAPI.InviteFriends(plugin_id, id, id_list); Assert.AreEqual(true, v); }