BF2Statistics.Database.GamespyDatabase.SetPlayerId C# (CSharp) Method

SetPlayerId() public method

Sets the Account (Player) Id for an account by Name
public SetPlayerId ( string Nick, int Pid ) : int
Nick string The account Nick we are setting the new Pid for
Pid int The new Pid
return int
        public int SetPlayerId(string Nick, int Pid)
        {
            // If no user exists, return code -1
            if (!UserExists(Nick))
                return -1;

            // If the Pid already exists, return -2
            if (UserExists(Pid))
                return -2;

            // If PID is false, the PID is not taken
            int Success = base.Execute("UPDATE accounts SET id=@P0 WHERE name=@P1", Pid, Nick);
            return (Success > 0) ? 1 : 0;
        }