- converting NetworkEvent sending time to local time before doing any comparisons

- using mersenne twister for random number generation due to differences in Mono and .NET implementations of the Random library
- password prompt for password-protected private servers
- fixed deconstructor, fabricator and railgun connection panels closing immediately after opening
- fixed editor saving newly created subs to the root folder instead of the Submarines folder
- keeping items in the same inventory slots between clients instead of just syncing which items are in the inventory
- fixed crashing when swapping items between different limbslots
This commit is contained in:
Regalis
2016-03-03 21:11:54 +02:00
parent 35c36d283a
commit 40714c1102
21 changed files with 225 additions and 59 deletions
+9 -1
View File
@@ -289,7 +289,15 @@ namespace Barotrauma.Networking
{
string denyMessage = inc.ReadString();
new GUIMessageBox("Couldn't connect to server", denyMessage);
if (denyMessage == "Password required!" || denyMessage == "Wrong password!")
{
GameMain.ServerListScreen.JoinServer(serverIP, true);
}
else
{
new GUIMessageBox("Couldn't connect to server", denyMessage);
}
connectCanceled = true;
}
+11 -6
View File
@@ -167,7 +167,7 @@ namespace Barotrauma.Networking
{
restClient = new RestClient(NetConfig.MasterServerUrl);
}
var request = new RestRequest("masterserver2.php", Method.GET);
request.AddParameter("action", "addserver");
request.AddParameter("servername", name);
@@ -631,12 +631,17 @@ namespace Barotrauma.Networking
return;
}
#if !DEBUG
if (userPassword != password)
#if DEBUG
if (!string.IsNullOrWhiteSpace(password) && string.IsNullOrWhiteSpace(userPassword))
{
inc.SenderConnection.Deny("Password required!");
DebugConsole.NewMessage(name + " couldn't join the server (no password)", Color.Red);
return;
}
else if (userPassword != password)
{
inc.SenderConnection.Deny("Wrong password!");
DebugConsole.NewMessage(name +" couldn't join the server (wrong password)", Color.Red);
DebugConsole.NewMessage(name + " couldn't join the server (wrong password)", Color.Red);
return;
}
else if (version != GameMain.Version.ToString())
@@ -657,7 +662,7 @@ namespace Barotrauma.Networking
DebugConsole.NewMessage(name + " couldn't join the server (wrong content package hash)", Color.Red);
return;
}
else if (ConnectedClients.Find(c => c.name.ToLower() == name.ToLower() && c.ID!=userID) != null)
else if (ConnectedClients.Find(c => c.name.ToLower() == name.ToLower() && c.ID != userID) != null)
{
inc.SenderConnection.Deny("The name ''" + name + "'' is already in use. Please choose another name.");
DebugConsole.NewMessage(name + " couldn't join the server (name already in use)", Color.Red);
@@ -160,6 +160,8 @@ namespace Barotrauma.Networking
{
float sendingTime = message.ReadFloat();
sendingTime = (float)message.SenderConnection.GetLocalTime(sendingTime);
byte msgCount = message.ReadByte();
long currPos = message.PositionInBytes;