Implemented basic Pong lobby system
This commit is contained in:
@ -6,4 +6,5 @@
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<a asp-area="" asp-page="/Pong">Pong</a>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@ public class IndexModel : PageModel {
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void OnGet() {
|
||||
|
||||
public IActionResult OnGet() {
|
||||
return RedirectToPage("Pong");
|
||||
}
|
||||
}
|
||||
|
27
PongGame/Pages/Pong.cshtml
Normal file
27
PongGame/Pages/Pong.cshtml
Normal file
@ -0,0 +1,27 @@
|
||||
@page
|
||||
@model PongModel
|
||||
@{
|
||||
ViewData["Title"] = "Pong";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Pong</h1>
|
||||
<h3 id="connection">Connection Status</h3>
|
||||
|
||||
<button id="createlobby" class="btn btn-primary mb-3">Create</button>
|
||||
<button id="leavelobby" class="btn btn-primary mb-3">Leave</button>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input id="roomid" type="text" class="form-control" placeholder="Room ID" aria-label="Room ID" aria-describedby="joinroom">
|
||||
<button id="joinroom" class="btn btn-outline-secondary" type="button">Button</button>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<input id="username" type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="setusername">
|
||||
<button id="setusername" class="btn btn-outline-secondary" type="button">Set Username</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="~/js/signalr/signalr.min.js"></script>
|
||||
<script src="~/js/signalr/signalr-protocol-msgpack.min.js"></script>
|
||||
<script src="~/js/pong.js"></script>
|
15
PongGame/Pages/Pong.cshtml.cs
Normal file
15
PongGame/Pages/Pong.cshtml.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace PongGame.Pages;
|
||||
public class PongModel : PageModel {
|
||||
private readonly ILogger<PongModel> _logger;
|
||||
|
||||
public PongModel(ILogger<PongModel> logger) {
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void OnGet() {
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user