mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-05-20 03:58:20 +02:00
Don't use the changed signal to get a User to save itself.
This commit is contained in:
parent
b770c07a32
commit
272aeb775d
@ -251,9 +251,6 @@ Ref<User> UserManagerDB::_create_user(Ref<User> p_user) {
|
|||||||
p_user.instance();
|
p_user.instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
//save_user(u);
|
|
||||||
p_user->connect("changed", this, "_save_user", varray(p_user));
|
|
||||||
|
|
||||||
return p_user;
|
return p_user;
|
||||||
}
|
}
|
||||||
bool UserManagerDB::_is_username_taken(const String &user_name) {
|
bool UserManagerDB::_is_username_taken(const String &user_name) {
|
||||||
|
@ -165,8 +165,6 @@ Ref<User> UserManagerFile::_create_user(Ref<User> p_user) {
|
|||||||
p_user->set_user_id(-1);
|
p_user->set_user_id(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
p_user->connect("changed", this, "_save_user", varray(p_user));
|
|
||||||
|
|
||||||
return p_user;
|
return p_user;
|
||||||
}
|
}
|
||||||
bool UserManagerFile::_is_username_taken(const String &user_name) {
|
bool UserManagerFile::_is_username_taken(const String &user_name) {
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "user.h"
|
#include "user.h"
|
||||||
#include "core/io/json.h"
|
#include "core/io/json.h"
|
||||||
#include "core/object/class_db.h"
|
#include "core/object/class_db.h"
|
||||||
|
#include "../singleton/user_db.h"
|
||||||
|
|
||||||
#include "user_module.h"
|
#include "user_module.h"
|
||||||
|
|
||||||
@ -301,7 +302,7 @@ void User::from_json(const String &data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void User::save() {
|
void User::save() {
|
||||||
emit_changed();
|
UserDB::get_singleton()->save_user(Ref<User>(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
void User::read_lock() {
|
void User::read_lock() {
|
||||||
|
Loading…
Reference in New Issue
Block a user