feat: added docker stuff, started working on login system
This commit is contained in:
parent
c2d40c172a
commit
7c0cef6f65
15 changed files with 216 additions and 143 deletions
|
@ -87,13 +87,15 @@
|
|||
{
|
||||
var userToCreate = new UserData
|
||||
{
|
||||
Ipv4Address = "192.168.178.101",
|
||||
Banned = false,
|
||||
Email = "dev@limited-dev.de",
|
||||
Password = "$2a$10$C/ZPY5aVGkImLGyIP0SySuQaEYIwnY0J99i/m6tqqf6tMkax89Eku",
|
||||
PermissionInteger = 100,
|
||||
TimeBanned = -1,
|
||||
lastActionTimeStamp = DateTime.Now.Millisecond
|
||||
};
|
||||
|
||||
int userID;
|
||||
UserData foundusr = await UsersRepository.getUserByIPAsync(userToCreate.Ipv4Address);
|
||||
UserData foundusr = await UsersRepository.getUserByEmailAsync(userToCreate.Email);
|
||||
if (foundusr == null)
|
||||
{
|
||||
userID = await UsersRepository.createUserAsync(userToCreate);
|
||||
|
@ -101,9 +103,9 @@
|
|||
else
|
||||
{
|
||||
userID = foundusr.UserID;
|
||||
if(foundusr.Banned)
|
||||
if(foundusr.TimeBanned != -1)
|
||||
return;
|
||||
foundusr.lastActionTimeStamp = DateTime.Now.Millisecond;
|
||||
foundusr.lastActionTimeStamp = DateTimeOffset.UnixEpoch.ToUnixTimeMilliseconds();
|
||||
await UsersRepository.updateUserAsync(foundusr);
|
||||
}
|
||||
|
||||
|
|
|
@ -100,13 +100,15 @@
|
|||
{
|
||||
var userToCreate = new UserData
|
||||
{
|
||||
Ipv4Address = "192.168.178.101",
|
||||
Banned = false,
|
||||
Email = "test@mail.org",
|
||||
Password = "$2a$10$C/ZPY5aVGkImLGyIP0SySuQaEYIwnY0J99i/m6tqqf6tMkax89Eku",
|
||||
PermissionInteger = 100,
|
||||
TimeBanned = -1,
|
||||
lastActionTimeStamp = DateTime.Now.Millisecond
|
||||
};
|
||||
|
||||
|
||||
int userID;
|
||||
UserData foundusr = await UsersRepository.getUserByIPAsync(userToCreate.Ipv4Address);
|
||||
UserData foundusr = await UsersRepository.getUserByEmailAsync(userToCreate.Email);
|
||||
if (foundusr == null)
|
||||
{
|
||||
userID = await UsersRepository.createUserAsync(userToCreate);
|
||||
|
@ -114,9 +116,9 @@
|
|||
else
|
||||
{
|
||||
userID = foundusr.UserID;
|
||||
if(foundusr.Banned)
|
||||
if(foundusr.TimeBanned != -1)
|
||||
return;
|
||||
foundusr.lastActionTimeStamp = DateTime.Now.Millisecond;
|
||||
foundusr.lastActionTimeStamp = DateTimeOffset.UnixEpoch.ToUnixTimeMilliseconds();
|
||||
await UsersRepository.updateUserAsync(foundusr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue