Пример #1
0
        public User(uint UserID, Connection ClientConnection, string Username, uint Rank, bool Banned)
        {
            this.UserID = UserID;
            this.ClientConnection = ClientConnection;
            this.Username = Username;
            this.Rank = Rank;
            this.Banned = Banned;

            this.ClientConnection.ClientUser = this;
        }
Пример #2
0
        public static User GenerateUserFromRow(DataRow Row, Connection ClientConnection)
        {
            try
            {
                uint UserID = Convert.ToUInt32(Row["id"]);
                string Username = Convert.ToString(Row["username"]);
                uint Rank = Convert.ToUInt32(Row["rank"]);
                bool Banned = Convert.ToBoolean(Row["banned"]);

                return new User(UserID, ClientConnection, Username, Rank, Banned);
            }
            catch (Exception Ex)
            {
                Logging.Exception(Ex, "Error whilst generating user from row");
                return null;
            }
        }