Skip to content

Commit

Permalink
v0.4.1.3:
Browse files Browse the repository at this point in the history
- fixed debug message height not being set correctly
- fixed submarine list not being updated if host has enabled "play yourself"
- fixed "queue empty" error when attempting to download a sub from the server
- maximum number of iterations when carving a path for a cave
  • Loading branch information
Regalis committed May 27, 2016
1 parent 68870b6 commit c71a935
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Subsurface/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.4.1.0")]
[assembly: AssemblyFileVersion("0.4.1.0")]
[assembly: AssemblyVersion("0.4.1.3")]
[assembly: AssemblyFileVersion("0.4.1.3")]
2 changes: 1 addition & 1 deletion Subsurface/Source/DebugConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ public static void NewMessage(string msg, Color color)

try
{
var textBlock = new GUITextBlock(new Rectangle(0, 0, 0, 0), msg, GUI.Style, Alignment.TopLeft, Alignment.Left, null, true, GUI.SmallFont);
var textBlock = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width, 0), msg, GUI.Style, Alignment.TopLeft, Alignment.Left, null, true, GUI.SmallFont);
textBlock.CanBeFocused = false;
textBlock.TextColor = color;

Expand Down
6 changes: 5 additions & 1 deletion Subsurface/Source/Map/Levels/CaveGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ private static Vector2 GetEdgeNormal(GraphEdge edge, VoronoiCell cell = null)

int currentTargetIndex = 1;

int iterationsLeft = cells.Count;

do
{
int edgeIndex = 0;
Expand Down Expand Up @@ -325,13 +327,15 @@ private static Vector2 GetEdgeNormal(GraphEdge edge, VoronoiCell cell = null)
currentCell.CellType = CellType.Path;
pathCells.Add(currentCell);

iterationsLeft--;

if (currentCell == targetCells[currentTargetIndex])
{
currentTargetIndex += 1;
if (currentTargetIndex >= targetCells.Count) break;
}

} while (currentCell != targetCells[targetCells.Count - 1]);
} while (currentCell != targetCells[targetCells.Count - 1] && iterationsLeft > 0);


Debug.WriteLine("gettooclose: " + sw2.ElapsedMilliseconds + " ms");
Expand Down
6 changes: 3 additions & 3 deletions Subsurface/Source/Map/Map/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ public Mission Mission
{
if (mission !=null && mission.Completed) missionsCompleted++;

int seed = (int)locations[0].MapPosition.X + (int)locations[0].MapPosition.Y * 100;
seed += (int)locations[1].MapPosition.X*10000 + (int)locations[1].MapPosition.Y * 1000000;
long seed = (long)locations[0].MapPosition.X + (long)locations[0].MapPosition.Y * 100;
seed += (long)locations[1].MapPosition.X*10000 + (long)locations[1].MapPosition.Y * 1000000;

MTRandom rand = new MTRandom(seed + missionsCompleted);
MTRandom rand = new MTRandom((int)((seed + missionsCompleted) % int.MaxValue));

if (rand.NextDouble() < 0.3f) return null;

Expand Down
7 changes: 3 additions & 4 deletions Subsurface/Source/Networking/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ private void ReadMessage(NetIncomingMessage inc)
if (characterInfo != null)
{
outmsg.Write(characterInfo.Name);
outmsg.Write(-1);
outmsg.Write((byte)0);
}

var subs = GameMain.NetLobbyScreen.GetSubList();
Expand All @@ -474,8 +474,6 @@ private void ReadMessage(NetIncomingMessage inc)
//send the message to everyone except the client who just logged in
SendMessage(outmsg, NetDeliveryMethod.ReliableUnordered, inc.SenderConnection);

UpdateVoteStatus();

AddChatMessage(sender.name + " has joined the server", ChatMessageType.Server);
}
}
Expand Down Expand Up @@ -590,6 +588,7 @@ private void ReadMessage(NetIncomingMessage inc)
break;
case (byte)PacketTypes.RequestNetLobbyUpdate:
UpdateNetLobby(null, null);
UpdateVoteStatus();
break;
case (byte)PacketTypes.SpectateRequest:
if (gameStarted && allowSpectating)
Expand Down Expand Up @@ -1712,7 +1711,7 @@ private Client FindClientWithJobPreference(List<Client> clients, JobPrefab job,
foreach (Client c in clients)
{
int index = c.jobPreferences.FindIndex(jp => jp == job);
if (index == -1) index = 1000;
if (index == 0) index = 1000;
if (preferredClient == null || index < bestPreference)
{
bestPreference = index;
Expand Down
9 changes: 9 additions & 0 deletions Subsurface/Source/Screens/NetLobbyScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,15 @@ public bool TrySelectSub(string subName, string md5Hash)
"Do you want to download the file from the server host?" :
"Do you want to download the file and cancel downloading ''" + GameMain.Client.ActiveFileTransferName + "''?";

if (GUIMessageBox.MessageBoxes.Count>0)
{
var currentMessageBox = GUIMessageBox.MessageBoxes.Peek();
if (currentMessageBox != null && currentMessageBox.UserData as string == subName)
{
return false;
}
}

var requestFileBox = new GUIMessageBox("Submarine not found!", errorMsg+downloadMsg, new string[] { "Yes", "No" }, 400, 300);
requestFileBox.Buttons[0].UserData = subName;
requestFileBox.Buttons[0].OnClicked += requestFileBox.Close;
Expand Down
2 changes: 1 addition & 1 deletion Subsurface/Source/Sounds/OggStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ void EnsureBuffersFilled()
}
catch
{
continue;
finished = true;
}

if (finished)
Expand Down
40 changes: 40 additions & 0 deletions Subsurface/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
---------------------------------------------------------------------------------------------------------
v0.4.1.3
---------------------------------------------------------------------------------------------------------

- fixed errors when updating the submarine list if the host is has selected the "play yourself" option

---------------------------------------------------------------------------------------------------------
v0.4.1.2
---------------------------------------------------------------------------------------------------------

- fixed the ''queue empty'' error messages when attempting to download a sub from the server

---------------------------------------------------------------------------------------------------------
v0.4.1.1
---------------------------------------------------------------------------------------------------------

- changes to connection panel layout: less wire overlap, making it easier to select individual wires

- fixed missions not appearing in single player

- clients see the submarines the host has instead of their own subs in the server lobby
- clients can vote for subs they don't have
- servers check whether all the clients have the selected submarine file before starting a round, and if not,
give them some time to start downloading it

- item sprites are visible in fabricator menus
- some new wall sprites
- fixed small walls being impossible to fix after they've broken
- ruin walls look slightly different from normal walls on sonar
- cargo is placed at the cargo spawnpoint instead of a random position within the hull it's inside
- fixed light emitted by flares not disappearing after the flare burns out
- flares won't stop burning if picked up and placed in the inventory
- minor changes to the lighting - small lights aren't ''skewed''
- fixed the ''CastShadows'' parameter of light components not being saved
- fixed fires using up all the sound channels and preventing other sounds from playing

- fixed the ''blood overlay'' still being visible when starting a new round or switching characters
- fixed fractal guardians occasionally killing themselves by slamming against the walls
- enemies use pathfinding inside the submarine

---------------------------------------------------------------------------------------------------------
v0.4.1.0
---------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit c71a935

Please sign in to comment.