BF2Statistics.Gamespy.GpspClient.SendNicks C# (CSharp) Method

SendNicks() private method

This method is requested by the client when logging in to fetch all the account names that have the specified email address and password combination
private SendNicks ( string>.Dictionary recvData ) : void
recvData string>.Dictionary
return void
        private void SendNicks(Dictionary<string, string> recvData)
        {
            // Make sure we have the needed data
            if (!recvData.ContainsKey("email") || (!recvData.ContainsKey("pass") && !recvData.ContainsKey("passenc")))
            {
                Stream.SendAsync(@"\error\\err\0\fatal\\errmsg\Invalid Query!\id\1\final\");
                return;
            }

            // Try to get user data from database
            try
            {
                // Get our password from the provided query
                string password = (recvData.ContainsKey("pass"))
                    ? recvData["pass"]
                    : GamespyUtils.DecodePassword(recvData["passenc"]);

                // Fetch accounts
                using (GamespyDatabase Db = new GamespyDatabase())
                {
                    var Clients = Db.GetUsersByEmailPass(recvData["email"], password.GetMD5Hash(false));
                    StringBuilder Response = new StringBuilder(@"\nr\" + Clients.Count);
                    for (int i = 0; i < Clients.Count; i++)
                        Response.AppendFormat(@"\nick\{0}\uniquenick\{0}", Clients[i]["name"]);

                    Response.Append(@"\ndone\\final\");
                    Stream.SendAsync(Response.ToString());
                }
            }
            catch
            {
                Stream.SendAsync(@"\error\\err\551\fatal\\errmsg\Unable to get any associated profiles.\id\1\final\");
            }
        }