private void AutoInvitePartyMembers() { String s = Globals.gamedata.botoptions.SendPartyNames; String[] PartyNames = s.Split(',', ';'); String PN = ""; int found; try { Globals.PartyLock.EnterReadLock(); if ((Globals.gamedata.PartyCount < 7) && (Globals.gamedata.PartyLeader == Globals.gamedata.my_char.ID || Globals.gamedata.PartyCount <= 0)) { //cycle through all given text for (int i = 0; i < PartyNames.Length; i++) { PN = PartyNames[i]; found = 0; //loop through each member foreach (PartyMember pl in Globals.gamedata.PartyMembers.Values) { //Globals.l2net_home.Add_Text("pl.name: " + pl.Name + " PN: " + PN); if (String.Equals(pl.Name, PN, StringComparison.OrdinalIgnoreCase)) { found = 1; } } //if member is not in our party, invite him. if (found == 0 && PN != "" && PN != null) { //Globals.l2net_home.Add_Text("Inviting " + PN + " to party."); ServerPackets.Command_Invite(PN); Thread.Sleep(11500); //10000 = timeout for invite } } breaktotop = true; } } catch { Globals.l2net_home.Add_Error("crash: Invite to party, check your settings."); } finally { Globals.PartyLock.ExitReadLock(); } }
private void button_party_invite_Click(object sender, EventArgs e) { ServerPackets.Command_Invite(Util.GetCharName(Globals.gamedata.my_char.TargetID)); }