This commit is contained in:
Mahmoud-Emad
2025-09-15 15:49:23 +03:00
parent 6d67dbe2d7
commit 23f7e05931
5 changed files with 138 additions and 129 deletions

View File

@@ -2,6 +2,7 @@ module db
import freeflowuniverse.herolib.data.ourtime
import freeflowuniverse.herolib.data.encoder
import time
pub fn (mut self DB) set[T](mut obj T) ! {
// Get the next ID
@@ -28,7 +29,15 @@ pub fn (mut self DB) set[T](mut obj T) ! {
for comment in obj.comments {
e.add_u32(comment)
}
obj.dump(mut e)!
// $for method in T.methods {
// $if method.name == 'dump' {
// println(method)
// method.name(mut e)!
// }
// }
self.redis.hset(self.db_name[T](), obj.id.str(), e.data.bytestr())!
}