small fixes
This commit is contained in:
parent
32bc8274a2
commit
2a796509c8
7 changed files with 60 additions and 36 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,9 +1,11 @@
|
|||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Polly;
|
||||
using Refit;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
@ -23,26 +25,27 @@ namespace Sledgemapper
|
|||
|
||||
public CommunicationManager(Session sessionData)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
var baseAddress = "http://localhost:5000";
|
||||
#else
|
||||
var baseAddress = "http://hub.michelescandura.com:5000";
|
||||
#endif
|
||||
|
||||
SessionData = sessionData;
|
||||
Connection = new HubConnectionBuilder()
|
||||
.WithAutomaticReconnect()
|
||||
//.WithUrl("http://hub.michelescandura.com:5001/SledgemapperHub")
|
||||
|
||||
//.WithUrl("http://localhost:5001/SledgemapperHub", options =>
|
||||
.WithUrl("http://hub.michelescandura.com:5000/SledgemapperHub", options =>
|
||||
.WithUrl($"{baseAddress}/SledgemapperHub", options =>
|
||||
{
|
||||
options.AccessTokenProvider = () => Task.FromResult(_authenticateResponse.Token);
|
||||
})
|
||||
|
||||
.Build();
|
||||
|
||||
|
||||
|
||||
Api = RestService.For<IMapApi>(
|
||||
new HttpClient(new AuthenticatedHttpClientHandler(GetToken))
|
||||
{
|
||||
BaseAddress = new Uri("http://hub.michelescandura.com:5000")
|
||||
// BaseAddress = new Uri("http://localhost:5001")
|
||||
BaseAddress = new Uri(baseAddress)
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -658,6 +658,8 @@ namespace Sledgemapper
|
|||
}
|
||||
|
||||
private void DrawPlayers()
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var player in _sessionData.Players.Copy())
|
||||
{
|
||||
|
@ -665,6 +667,11 @@ namespace Sledgemapper
|
|||
var color = player.Color.ToColor();
|
||||
_spriteBatch.DrawRectangle(new Rectangle(player.Position.X * _state.TileSize - 4, player.Position.Y * _state.TileSize - 4, _state.TileSize + 7, _state.TileSize + 7), color, 2);
|
||||
|
||||
foreach (var font in _fonts.Keys)
|
||||
{
|
||||
System.Console.WriteLine(font);
|
||||
}
|
||||
|
||||
var ffont = _fonts.FirstOrDefault(m => int.Parse(m.Key.Replace("font", "")) > _state.TileSize).Value ?? _fonts.Last().Value;
|
||||
|
||||
var fscale = _state.TileSize / ((float)ffont.LineSpacing * 2);
|
||||
|
@ -689,6 +696,11 @@ namespace Sledgemapper
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawPlayerPointer(Player player)
|
||||
{
|
||||
|
|
|
@ -20,6 +20,12 @@
|
|||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<ApplicationIcon>Icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Icon.ico" />
|
||||
<None Remove="Icon.bmp" />
|
||||
|
@ -36,6 +42,7 @@
|
|||
</ItemGroup> -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AsyncAwaitBestPractices" Version="5.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
|
||||
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.0.1641" />
|
||||
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.0.1641" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client">
|
||||
|
|
|
@ -18,10 +18,12 @@ namespace Sledgemapper
|
|||
|
||||
public static Color ToColor(this string s)
|
||||
{
|
||||
System.Console.WriteLine(s);
|
||||
var hexs = s.TrimStart('#').Split(2).ToArray();
|
||||
var color = new Color(int.Parse(hexs[0], System.Globalization.NumberStyles.HexNumber),
|
||||
int.Parse(hexs[1], System.Globalization.NumberStyles.HexNumber),
|
||||
int.Parse(hexs[2], System.Globalization.NumberStyles.HexNumber));
|
||||
System.Console.WriteLine(color);
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue