/// <summary> /// Player is null in case that the login failed /// </summary> /// <param name="player"></param> public Message_ServerResponse_Login(DBProfile_Login player) { loginSucceded = player != null; if (loginSucceded) { this.profile = player; } }
/// <summary> /// Search for a player /// Returns null if no player is found /// </summary> /// <param name="username">Username of the player</param> /// <param name="hashedPassword">Hashed password of the player </param> /// <returns>The player profile, null if none were found</returns> public static DBProfile_Login GetPlayer(string username, string hashedPassword) { string sql = String.Format("SELECT * FROM [dbo].[{0}] WHERE Username = '******' and Password = '******'" , tableName , username , hashedPassword); Dictionary <string, object> results = new Dictionary <string, object>(); if (DBEndPoint.GetSingleRowSqlSearch(sql, results)) { DBProfile_Login profile; profile = new DBProfile_Login((int)results["Id"], (string)results["Username"]); return(profile); } return(null); }
public void SetProfile(Message_ServerResponse_Register objData) { profile = objData.profile; }
public void SetProfile(Message_ServerResponse_Login objData) { profile = objData.profile; }
public Message_ServerResponse_Register(KeyValuePair <DBProfile_Login, string> result) { succeded = result.Key != null; profile = result.Key; message = result.Value; }