mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-04-10 05:42:37 +02:00
Added a null check to HTTPSessionManagerDB, and small cleanups.
This commit is contained in:
parent
b8b51e7525
commit
47ac5e2668
@ -125,11 +125,9 @@ void HTTPSessionManagerDB::save_session(Ref<HTTPSession> session) {
|
|||||||
while ((k = m->next(k))) {
|
while ((k = m->next(k))) {
|
||||||
const Variant &val = m->get(*k);
|
const Variant &val = m->get(*k);
|
||||||
|
|
||||||
Variant::Type t = val.get_type();
|
|
||||||
|
|
||||||
// Maybe it should be allowed?
|
// Maybe it should be allowed?
|
||||||
// Or maybe when adding stuff to the sessions the method should have a store = true bool, if false skip saving
|
// Or maybe when adding stuff to the sessions the method should have a store = true bool, if false skip saving
|
||||||
if (t == Variant::OBJECT) {
|
if (val.get_type() == Variant::OBJECT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,6 +144,8 @@ void HTTPSessionManagerDB::load_sessions() {
|
|||||||
|
|
||||||
Ref<QueryBuilder> b = get_query_builder();
|
Ref<QueryBuilder> b = get_query_builder();
|
||||||
|
|
||||||
|
ERR_FAIL_COND(!b.is_valid());
|
||||||
|
|
||||||
b->select("id, session_id");
|
b->select("id, session_id");
|
||||||
b->from(_database_table_name);
|
b->from(_database_table_name);
|
||||||
// b->print();
|
// b->print();
|
||||||
|
@ -98,7 +98,6 @@ Ref<HTTPSession> HTTPSessionManager::create_session() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HTTPSessionManager::load_sessions() {
|
void HTTPSessionManager::load_sessions() {
|
||||||
clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTTPSessionManager::clear() {
|
void HTTPSessionManager::clear() {
|
||||||
|
@ -137,7 +137,6 @@ void register_web_types() {
|
|||||||
|
|
||||||
#ifdef MODULE_DATABASE_ENABLED
|
#ifdef MODULE_DATABASE_ENABLED
|
||||||
ClassDB::register_class<HTTPSessionManagerDB>();
|
ClassDB::register_class<HTTPSessionManagerDB>();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TOOLS_ENABLED
|
#if TOOLS_ENABLED
|
||||||
|
Loading…
Reference in New Issue
Block a user