This commit is contained in:
Regalis
2015-11-22 00:40:37 +02:00
parent 91fa25ecd2
commit 1eaf22d3d0
14 changed files with 100 additions and 22 deletions
+17 -3
View File
@@ -248,10 +248,17 @@ namespace Barotrauma
spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), new Color(0.75f, 0.8f, 0.9f, 1.0f));
spriteBatch.End();
#if LINUX
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend,
null, DepthStencilState.Default, null, null,
BlendState.NonPremultiplied,
null, DepthStencilState.DepthRead, null, null,
cam.Transform);
#else
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend,
null, DepthStencilState.DepthRead, null, null,
cam.Transform);
#endif
GameMain.ParticleManager.Draw(spriteBatch, true, Particles.ParticleBlendState.AlphaBlend);
spriteBatch.End();
@@ -270,11 +277,18 @@ namespace Barotrauma
BlendState.Opaque);
spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
spriteBatch.End();
#if LINUX
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.NonPremultiplied,
null, DepthStencilState.DepthRead, null, null,
cam.Transform);
#else
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend,
null, DepthStencilState.DepthRead, null, null,
cam.Transform);
#endif
GameMain.ParticleManager.Draw(spriteBatch, false, Particles.ParticleBlendState.AlphaBlend);
spriteBatch.End();
+10 -2
View File
@@ -297,8 +297,16 @@ namespace Barotrauma
GameMain.NetLobbyScreen = new NetLobbyScreen();
GameMain.NetworkMember = new GameServer(name, port, isPublicBox.Selected, passwordBox.Text, useUpnpBox.Selected, int.Parse(maxPlayersBox.Text));
try
{
GameMain.NetworkMember = new GameServer(name, port, isPublicBox.Selected, passwordBox.Text, useUpnpBox.Selected, int.Parse(maxPlayersBox.Text));
}
catch (Exception e)
{
DebugConsole.ThrowError("Failed to start server", e);
}
GameMain.NetLobbyScreen.IsServer = true;
//Game1.NetLobbyScreen.Select();
return true;
+26 -3
View File
@@ -254,7 +254,21 @@ namespace Barotrauma
if (response.StatusCode!= System.Net.HttpStatusCode.OK)
{
serverList.ClearChildren();
DebugConsole.ThrowError("Error while connecting to master server (" +response.StatusCode+": "+response.StatusDescription+")");
switch (response.StatusCode)
{
case System.Net.HttpStatusCode.NotFound:
DebugConsole.ThrowError("Error while connecting to master server (404 - ''" + NetConfig.MasterServerUrl + "'' not found)");
break;
case System.Net.HttpStatusCode.ServiceUnavailable:
DebugConsole.ThrowError("Error while connecting to master server (505 - Service Unavailable)");
DebugConsole.ThrowError("The master server may be down for maintenance or temporarily overloaded. Please try again after in a few moments.");
break;
default:
DebugConsole.ThrowError("Error while connecting to master server (" +response.StatusCode+": "+response.StatusDescription+")");
break;
}
return;
}
@@ -304,8 +318,17 @@ namespace Barotrauma
selectedPassword = passwordBox.Text;
}
GameMain.NetworkMember = new GameClient(clientNameBox.Text);
GameMain.Client.ConnectToServer(ip, selectedPassword);
try
{
GameMain.NetworkMember = new GameClient(clientNameBox.Text);
GameMain.Client.ConnectToServer(ip, selectedPassword);
}
catch (Exception e)
{
DebugConsole.ThrowError("Failed to start the client", e);
}
yield return CoroutineStatus.Success;
}