Skip to content

Commit

Permalink
Automatic merge of X1.3.1-189-gab83b4ca9 and 5 pull requests
Browse files Browse the repository at this point in the history
- Pull request #40 at e81861b: Monogame upgrade
- Pull request #79 at 7d9f14b: Update version calculation for new unstable versions
- Pull request #216 at 927a49c: Upgrade and replace web server with EmbedIO
- Pull request #225 at bb67fb6: Fix advanced adhesion wheelslip upon resuming from save: https://bugs.launchpad.net/or/+bug/1294410
- Pull request #226 at a3a8b86: EmbedIO web server graphical track monitor
  • Loading branch information
openrails-bot committed Jul 6, 2020
7 parents 2143087 + ab83b4c + e81861b + 7d9f14b + 927a49c + bb67fb6 + a3a8b86 commit e6c1017
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ private static Color TrackColor(float speedMpS, float allowedSpeedMpS)
/// </remarks>
private static string FindAuthorityInfo(IEnumerable<Train.TrainObjectItem> objects, string controlText)
{
Train.TrainObjectItem authInfo = objects.SingleOrDefault((info) => info.ItemType == Train.TrainObjectItem.TRAINOBJECTTYPE.AUTHORITY);
Train.TrainObjectItem authInfo = objects.SingleOrDefault((info) => info.ItemType == TRAINOBJECTTYPE.AUTHORITY);
return authInfo == null ? controlText : $"{controlText} : {AuthorityLabels[authInfo.AuthorityType]}";
}

Expand Down
6 changes: 4 additions & 2 deletions Source/RunActivity/Viewer3D/WebServices/WebServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ public static EmbedIO.WebServer CreateWebServer(IEnumerable<string> urls, string
private static async Task SerializationCallback(IHttpContext context, object data)
{
using (var text = context.OpenResponseText(new UTF8Encoding()))
{
await text.WriteAsync(JsonConvert.SerializeObject(data, new JsonSerializerSettings()
{
Formatting = Formatting.Indented,
ContractResolver = new XnaFriendlyResolver()
}));
}
}

/// <summary>
Expand Down Expand Up @@ -198,7 +200,7 @@ private HudApiTable ApiHUD_ProcessTable(int pageNo)
Popups.HUDWindow.TableData hudTable = Viewer.HUDWindow.PrepareTable(pageNo);
int nRows = hudTable.Cells.GetLength(0);
int nCols = hudTable.Cells.GetLength(1);
IEnumerable<string> getValues()
IEnumerable<string> GetValues()
{
foreach (int r in Enumerable.Range(0, nRows))
foreach (int c in Enumerable.Range(0, nCols))
Expand All @@ -208,7 +210,7 @@ IEnumerable<string> getValues()
{
nRows = nRows,
nCols = nCols,
values = getValues().ToArray()
values = GetValues().ToArray()
};
}
#endregion
Expand Down

0 comments on commit e6c1017

Please sign in to comment.