public static Packet MakeExtAddPlayerName(short nameId, string playerName, string listName, string groupName,
byte groupRank, bool useFallbacks, bool hasCP437)
{
if (playerName == null)
{
throw new ArgumentNullException("playerName");
}
if (listName == null)
{
throw new ArgumentNullException("listName");
}
if (groupName == null)
{
throw new ArgumentNullException("groupName");
}
Packet packet = new Packet(OpCode.ExtAddPlayerName);
//Logger.Log(LogType.Debug, "Send: MakeExtAddPlayerName({0}, {1}, {2}, {3}, {4})", nameId, playerName, listName, groupName, groupRank);
WriteI16(nameId, packet.Bytes, 1);
PacketWriter.WriteString(Color.SubstituteSpecialColors(playerName, useFallbacks), packet.Bytes, 3, hasCP437);
PacketWriter.WriteString(Color.SubstituteSpecialColors(listName, useFallbacks), packet.Bytes, 67, hasCP437);
PacketWriter.WriteString(Color.SubstituteSpecialColors(groupName, useFallbacks), packet.Bytes, 131, hasCP437);
packet.Bytes[195] = groupRank;
return(packet);
}