Update Structures
@@ -98,5 +98,33 @@ struct -user
|
|||||||
init -string &username
|
init -string &username
|
||||||
init -string &password
|
init -string &password
|
||||||
init -bool &isBanned
|
init -bool &isBanned
|
||||||
|
|
||||||
|
fun -bool !init -string &usr -string &pass
|
||||||
|
set &username $usr
|
||||||
|
set &password $pass
|
||||||
|
set &isBanned false
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
fun -bool !banUser
|
||||||
|
set &isBanned true
|
||||||
|
return true
|
||||||
|
endfun
|
||||||
|
|
||||||
|
fun -bool !newName -string &user
|
||||||
|
set &username $user
|
||||||
|
return true
|
||||||
|
endfun
|
||||||
|
endstruct
|
||||||
|
|
||||||
|
# Create a user
|
||||||
|
init &newUser -user
|
||||||
|
pusharg "Max" "Dingus"
|
||||||
|
!newUser.init &store
|
||||||
|
|
||||||
|
# Change a username
|
||||||
|
pusharg "Maxwell"
|
||||||
|
!newUser.newName &store
|
||||||
|
|
||||||
|
# Ban a user
|
||||||
|
!newUser.banUser &store
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user