public static void GroupInviteCommand(Player player, Player invited) { player.SendPacket("0|ps|inv|new|" + player.Id + "|" + Out.Base64(player.Name) + "|" + player.Ship.Id + "|" + invited.Id + "|" + Out.Base64(invited.Name) + "|" + invited.Ship.Id); invited.SendPacket("0|ps|inv|new|" + player.Id + "|" + Out.Base64(player.Name) + "|" + player.Ship.Id + "|" + invited.Id + "|" + Out.Base64(invited.Name) + "|" + invited.Ship.Id); }
public static void GroupInitializationCommand(Player player) { StringBuilder builder = new StringBuilder( $"0|ps|init|grp|{player.Group.Id}|{player.Group.Members.Count + 1}|{Group.DEFAULT_MAX_GROUP_SIZE}|{Convert.ToInt32(player.Group.LeaderInvitesOnly)}|{player.Group.LootMode}"); var groupLeader = player.Group.Leader; builder.Append( $"|{Out.Base64(groupLeader.Name)}|{groupLeader.Id}|{groupLeader.CurrentHitPoints}|{groupLeader.MaxHitPoints}|{groupLeader.CurrentNanoHull}|{groupLeader.MaxNanoHull}|{groupLeader.CurrentShieldPoints}|{groupLeader.MaxShieldPoints}|{groupLeader.Spacemap.Id}|{groupLeader.Position.X}|{groupLeader.Position.Y}|{groupLeader.Level}|0|{Convert.ToInt32(groupLeader.Invisible)}|{Convert.ToInt32(groupLeader.AttackManager.Attacking)}|{Convert.ToInt32(groupLeader.FactionId)}|{Convert.ToInt32(groupLeader.SelectedCharacter?.Ship.Id)}|{groupLeader.GetClanTag()}|{groupLeader.Ship.Id}|{Convert.ToInt32(GameManager.GetGameSession(groupLeader.Id) == null)}|"); foreach (var grpMember in player.Group.Members) { var groupMember = grpMember.Value; if (groupMember.Id == player.Group.Leader.Id) { continue; } builder.Append( $"|{Out.Base64(groupMember.Name)}|{groupMember.Id}|{groupMember.CurrentHitPoints}|{groupMember.MaxHitPoints}|{groupMember.CurrentNanoHull}|{groupMember.MaxNanoHull}|{groupMember.CurrentShieldPoints}|{groupMember.MaxShieldPoints}|{groupMember.Spacemap.Id}|{groupMember.Position.X}|{groupMember.Position.Y}|{groupMember.Level}|0|{Convert.ToInt32(groupMember.Invisible)}|{Convert.ToInt32(groupMember.AttackManager.Attacking)}|{Convert.ToInt32(groupMember.FactionId)}|{Convert.ToInt32(groupLeader.SelectedCharacter?.Ship.Id)}|{groupMember.GetClanTag()}|{groupMember.Ship.Id}|{Convert.ToInt32(GameManager.GetGameSession(groupMember.Id) == null)}|"); } player.SendPacket(builder.ToString()); }