Wrong password hash size
parent
97f7dcb049
commit
cee5a4cf4f
Binary file not shown.
Binary file not shown.
|
|
@ -380,7 +380,7 @@ namespace Lobbies
|
||||||
private void TcpClient_DataReceived(int dataLength, Memory<byte> data)
|
private void TcpClient_DataReceived(int dataLength, Memory<byte> data)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (dataLength > 0)
|
if (dataLength > 0)
|
||||||
{
|
{
|
||||||
switch (LobbyMessageIdentifier.ReadLobbyMessageIdentifier(data.Span))
|
switch (LobbyMessageIdentifier.ReadLobbyMessageIdentifier(data.Span))
|
||||||
|
|
@ -428,6 +428,7 @@ namespace Lobbies
|
||||||
case LobbyHostInfo.TypeId:
|
case LobbyHostInfo.TypeId:
|
||||||
{
|
{
|
||||||
var lobbyHostInfo = LobbyHostInfo.Deserialize(data.Span);
|
var lobbyHostInfo = LobbyHostInfo.Deserialize(data.Span);
|
||||||
|
|
||||||
if (lobbyHostInfo != null)
|
if (lobbyHostInfo != null)
|
||||||
{
|
{
|
||||||
events.Enqueue(new LobbyClientEvent { EventType = LobbyClientEventTypes.LobbyHostInfo, EventData = lobbyHostInfo });
|
events.Enqueue(new LobbyClientEvent { EventType = LobbyClientEventTypes.LobbyHostInfo, EventData = lobbyHostInfo });
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,26 @@ _ = Task.Run(() =>
|
||||||
{
|
{
|
||||||
switch (lobbyEvent.EventType)
|
switch (lobbyEvent.EventType)
|
||||||
{
|
{
|
||||||
|
case LobbyClientEventTypes.LobbyJoinFailed:
|
||||||
|
{
|
||||||
|
var lobbyJoinFailReason = lobbyEvent.EventData as LobbyJoinFailReason;
|
||||||
|
var p = Console.GetCursorPosition();
|
||||||
|
Console.SetCursorPosition(0, p.Top);
|
||||||
|
switch (lobbyJoinFailReason!.Reason)
|
||||||
|
{
|
||||||
|
case LobbyJoinFailReason.FailReasons.WrongPassword:
|
||||||
|
Console.WriteLine("Lobby password wrong!");
|
||||||
|
break;
|
||||||
|
case LobbyJoinFailReason.FailReasons.LobbyFull:
|
||||||
|
Console.WriteLine("Lobby full!");
|
||||||
|
break;
|
||||||
|
case LobbyJoinFailReason.FailReasons.LobbyNotFound:
|
||||||
|
Console.WriteLine("Lobby not found!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Console.Write(">");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case LobbyClientEventTypes.Connected:
|
case LobbyClientEventTypes.Connected:
|
||||||
{
|
{
|
||||||
connected = true;
|
connected = true;
|
||||||
|
|
@ -210,7 +230,7 @@ while (running)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("Hosting game ...");
|
Console.WriteLine("Hosting game ...");
|
||||||
lobbyClient.HostLobby(GameGuids.NFS, "Hallo, Welt!", 1, 8, null, myPort);
|
lobbyClient.HostLobby(GameGuids.NFS, "Hallo, Welt!", 1, 8, "haher", myPort);
|
||||||
fakeGameHost.isHost = true;
|
fakeGameHost.isHost = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +254,15 @@ while (running)
|
||||||
var firstLobby = openLobbies.FirstOrDefault();
|
var firstLobby = openLobbies.FirstOrDefault();
|
||||||
if (firstLobby != null)
|
if (firstLobby != null)
|
||||||
{
|
{
|
||||||
lobbyClient.RequestLobbyHostInfo(firstLobby.Id, null);
|
if(firstLobby.PasswordProtected)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Please enter password: ");
|
||||||
|
Console.Write(">");
|
||||||
|
var password = Console.ReadLine();
|
||||||
|
lobbyClient.RequestLobbyHostInfo(firstLobby.Id, password);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
lobbyClient.RequestLobbyHostInfo(firstLobby.Id, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace LobbyServerDto
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hash of the password if the lobby requires one
|
/// Hash of the password if the lobby requires one
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength(26)]
|
[MaxLength(64)]
|
||||||
public byte[]? PasswordHash { get; set; }
|
public byte[]? PasswordHash { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -15,7 +15,7 @@ namespace LobbyServerDto
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Password hash if the lobby is password protected
|
/// Password hash if the lobby is password protected
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MaxLength(26)]
|
[MaxLength(64)]
|
||||||
public byte[]? PasswordHash { get; set; }
|
public byte[]? PasswordHash { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Our external ip
|
/// Our external ip
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue