private static string ConstructPostData(string email, string password, SupportedGame game)
{
// TODO: Combine params maybe?!
string postData = null;
Dictionary<string, string> postParams;
if (game == SupportedGame.Battlefield3)
{
postParams = new Dictionary<string, string>
{
{"redirect", "|bf3|"},
{"email", email},
{"password", password},
{"remember", "0"},
{"submit", "Sign in"}
};
}
else
{
postParams = new Dictionary<string, string>
{
{"redirect", "|bf4|"},
{"email", email},
{"password", password},
{"remember", "0"},
{"submit", "Log in"}
};
}
foreach (var param in postParams)
{
if (postData != null)
postData += "&";
postData += HttpUtility.UrlEncode(param.Key) + "=" + HttpUtility.UrlEncode(param.Value);
}
return postData;
}