using System.Collections.Generic;

namespace QC.QMSLPhone;

public class F3Message : AsyncMessage
{
	private const int SSMASKOFS = 16;

	private const int NUMARGSOFS = 2;

	private const int ARGSOFS = 20;

	public ushort ssMask;

	public string formatStr;

	public string fileNameStr;

	public List<int> args = new List<int>();

	public F3Message(ushort id, byte[] msg)
		: base(id, msg)
	{
		msgID = id;
		int num = message[2];
		int num2 = 20 + 4 * num;
		ssMask = getWord(16);
		for (int i = 0; i < num; i++)
		{
			int item = (message[20 + i * 4 + 3] << 24) | (message[20 + i * 4 + 2] << 16) | (message[20 + i * 4 + 1] << 8) | message[20 + i * 4];
			args.Add(item);
		}
		int num3 = 0;
		formatStr = "";
		for (int j = num2; j < message.Length; j++)
		{
			if (message[j] == 0)
			{
				num3 = j + 1;
				break;
			}
			formatStr += (char)message[j];
		}
		fileNameStr = "";
		for (int k = num3; k < message.Length && message[k] != 0; k++)
		{
			fileNameStr += (char)message[k];
		}
	}
}
