- Added a `toString()`
This commit is contained in:
Tristan B. Velloza Kildaire 2023-11-26 13:56:51 +02:00
parent 6841da02ea
commit 2b95cc3410
1 changed files with 16 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import renaissance.connection.connection : Connection;
import renaissance.server.users : User;
import core.sync.mutex : Mutex;
import renaissance.logging;
import std.conv : to;
// TODO: One of these should be opened as soon as auth is
// ... done and stored in server so as to be able to map to it
@ -87,6 +87,21 @@ public struct Session
return this.links.dup;
}
public string toString()
{
// Lock the session
this.lock.lock();
// On exit
scope(exit)
{
// Unlock the session
this.lock.unlock();
}
return "Session [user: "~to!(string)(this.user)~", links: "~to!(string)(this.links.length)~"]";
}
}
public class SessionManager