Skip to content

Commit 492d323

Browse files
committed
refactor user controller
1 parent 12a610e commit 492d323

File tree

3 files changed

+219
-522
lines changed

3 files changed

+219
-522
lines changed

Intersect.Server.Core/Database/PlayerData/User.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,21 @@ public static Tuple<Client, User> Fetch(string userName)
543543
return new Tuple<Client, User>(client, client?.User ?? Find(userName));
544544
}
545545

546+
public static Tuple<Client, User> Fetch(LookupKey lookupKey)
547+
{
548+
if (lookupKey.HasId)
549+
{
550+
return Fetch(lookupKey.Id);
551+
}
552+
553+
if (lookupKey.HasName)
554+
{
555+
return Fetch(lookupKey.Name);
556+
}
557+
558+
return new Tuple<Client, User>(default, default);
559+
}
560+
546561
public static bool TryLogin(
547562
string username,
548563
string ptPassword,

0 commit comments

Comments
 (0)