Skip to content

Commit

Permalink
Fixed server-side SignalR BatChest
Browse files Browse the repository at this point in the history
  • Loading branch information
vizorian committed Sep 26, 2021
1 parent eae0af5 commit c09a2ee
Show file tree
Hide file tree
Showing 97 changed files with 74,343 additions and 689 deletions.
Binary file not shown.
Binary file modified .vs/SignalR-GameServer/v16/.suo
Binary file not shown.
11 changes: 11 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"ExpandedNodes": [
"",
"\\SignalR-GameServer-v1",
"\\SignalR-GameServer-v1\\Hubs",
"\\SignalR-GameServer-v1\\Pages",
"\\SignalR-GameServer-v1\\wwwroot"
],
"SelectedNode": "\\SignalR-GameServer.sln",
"PreviewInSolutionExplorer": false
}
1,025 changes: 1,025 additions & 0 deletions .vs/hoboking/config/applicationhost.config

Large diffs are not rendered by default.

Binary file modified .vs/hoboking/v16/.suo
Binary file not shown.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
21 changes: 0 additions & 21 deletions SignalR-GameServer-v1/Hubs/Chat.cs

This file was deleted.

12 changes: 10 additions & 2 deletions SignalR-GameServer-v1/Hubs/GameHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ namespace SignalR_GameServer.Hubs
{
public class GameHub : Hub
{
public async Task MovePlayer(string x, string y)
public async Task SendMessage(string user, string message)
{
await Clients.Others.SendAsync("playerMoved", x, y);
await Clients.All.SendAsync("ReceiveMessage", user, message);
}

public async Task SendCoordinates(string user, string x, string y)
{
await Clients.All.SendAsync("ReceiveCoordinates", user, x, y);
}

// client sided?
// junk junk KreipinysIServer.SendAsync("SendCoordinates", user, x, y)???
}
}
25 changes: 2 additions & 23 deletions SignalR-GameServer-v1/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,11 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - SignalR_GameServer_v1</title>
<title>@ViewData["Title"] - SignalR_GameServer</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-page="/Index">SignalR_GameServer_v1</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
Expand All @@ -37,7 +16,7 @@

<footer class="border-top footer text-muted">
<div class="container">
&copy; 2020 - SignalR_GameServer_v1 - <a asp-area="" asp-page="/Privacy">Privacy</a>
&copy; 2021 - SignalR_GameServer - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAzIMo/hRpl0q/1WX6RuG3qQAAAAACAAAAAAAQZgAAAAEAACAAAABNvY1/S0LDliBqgBKMD7p521VMsKl5G9dTIqQkJRrQOAAAAAAOgAAAAAIAACAAAAAdTOHz0CwxlRpKLrnsQQYjSXSiCGXAtCrWWokTJJGuhYAAAABOXesXam/zKVqBpEVWTkSrMDcJ94up/bUUiGBdD9ar3EXiQ23xqB7OKmQRUBNOgixYXM1eKaJOwg0fxBAPAbyEohnNwTwIdVrCm1wWkfL6ZAcU7wh0dYMxsM4bsosqJv5W7ChRzwzp7TRhAvQoG7iMXXFZWnN3TMWgmU+v+RVhnUAAAADCIvqSsJOqDKjELISZxhzrzOHqM7jKJl7KdWPJwElxVHLmXvxnDWjH+u44encJ1val9X/2mNTsx1kypV59iggi</EncryptedPassword>
<History>True|2021-09-21T09:39:24.6637129Z;True|2021-09-21T12:22:08.6114806+03:00;True|2021-09-21T12:11:18.4486942+03:00;True|2021-09-21T11:53:04.2400193+03:00;False|2021-09-21T11:49:32.7351092+03:00;</History>
<History>True|2021-09-26T15:27:58.1081910Z;True|2021-09-26T18:22:53.2200248+03:00;True|2021-09-26T18:17:50.2437901+03:00;True|2021-09-26T17:41:12.3482787+03:00;True|2021-09-21T13:31:31.5791157+03:00;True|2021-09-21T12:39:24.6637129+03:00;True|2021-09-21T12:22:08.6114806+03:00;True|2021-09-21T12:11:18.4486942+03:00;True|2021-09-21T11:53:04.2400193+03:00;False|2021-09-21T11:49:32.7351092+03:00;</History>
</PropertyGroup>
</Project>
10 changes: 3 additions & 7 deletions SignalR-GameServer-v1/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// services.AddRazorPages();

services.AddRazorPages();
services.AddSignalR().AddAzureSignalR();
}

Expand All @@ -48,8 +47,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

app.UseHttpsRedirection();

// Main part
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseRouting();

Expand All @@ -58,9 +55,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

app.UseEndpoints(endpoints =>
{
// endpoints.MapRazorPages();
// endpoints.MapHub<GameHub>("/gamehub");
endpoints.MapHub<Chat>("/chat");
endpoints.MapRazorPages();
endpoints.MapHub<GameHub>("/gameHub");
});
}
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit c09a2ee

Please sign in to comment.