Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-wise committed Jan 28, 2024
2 parents 3a1d574 + c3b3d4b commit ab7a94d
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backend/MemeBE/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
options.AddPolicy("MyCorsPolicy", builder =>
{
builder.WithOrigins("https://nice-water-0ee9aa403.4.azurestaticapps.net", "http://localhost:63342", "https://memethegathering.wielki.ch") // URL innego serwera
builder.WithOrigins("https://nice-water-0ee9aa403.4.azurestaticapps.net", "http://localhost:63342", "https://memethegathering.wielki.ch", "https://mtg.wielki.ch/") // URL innego serwera
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials(); // Ważne dla SignalR
Expand Down
12 changes: 11 additions & 1 deletion backend/MemeBE/cards.csv
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,14 @@
27;SurprisedPikachu;/static/jpg/SurprisedPikachu.png;MakeLaugh,1;1
28;SurprisedKirk;/static/jpg/SurprisedKirk.png;MakeLaugh,2;0
29;Takemymoney;/static/jpg/Takemymoney.png;MakeLaugh,2;1
30;RollSafeThink;/static/jpg/OhGodNo.png;Shield,1;2
30;RollSafeThink;/static/jpg/OhGodNo.png;Shield,1;2
31;Thatsnoneofmybuisness;/static/jpg/Thatsnoneofmybuisness.png;MakeLaugh,1;1
32;TheWhat;/static/jpg/TheWhat.png;MakeLaugh,2;1
33;Thisisfine;/static/jpg/Thisisfine.png;MakeLaugh,1;1
34;TrollFace;/static/jpg/TrollFace.png;MakeGrumpy,1;0
35;TrueStory;/static/jpg/TrueStory.png;MakeGrumpy,1;0
36;WakingUp;/static/jpg/WakingUp.png;MakeLaugh,3;0
37;Watlady;/static/jpg/Watlady.png;MakeGrumpy,1;1
38;WeedGuy;/static/jpg/WeedGuy.png;MakeLaugh,1;1
39;WillyWonka;/static/jpg/WillyWonka.png;MakeLaugh,1;1
40;Duckface;/static/jpg/Duckface.png;MakeGrumpy,1;1
4 changes: 4 additions & 0 deletions backend/MemeBE/hubs/GameHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,12 @@ await Clients.Group(room.RoomId)

public async Task MakeGrumpy(Room room, int value, string? targetNick = null)
{
Console.WriteLine("MakeGrumpy - invoke");
int grumpyValue = room.ActivePlayer.PrepareGrumpy(value, out List<int?> cardsToDelete);
Console.WriteLine("Grumpy Value: " + grumpyValue);
if (string.IsNullOrEmpty(targetNick)) // all players
{
Console.WriteLine("MakeGrumpy - To All");
foreach (var player in room.Players.Values)
{
player.ReceiveGrumpy(grumpyValue);
Expand All @@ -336,6 +339,7 @@ await Clients.Group(room.RoomId)
}
else // Single player
{
Console.WriteLine("MakeGrumpy - To target");
var targetPlayer = room.GetPlayerByNick(targetNick);
targetPlayer.ReceiveGrumpy(grumpyValue);
// emit
Expand Down
4 changes: 2 additions & 2 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title >Meme: The Gathering</title>
<title>Meme: The Gathering</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/3.1.9/signalr.min.js"></script>
<script src="//code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
crossorigin="anonymous"></script>
Expand All @@ -13,7 +13,7 @@
</head>
<body>
<div id="lobby">
<h1 class="rotating-text">Meme: The Gathering</h1>
<h1 class="rotating-text game-title" >Meme: The Gathering</h1>
<div id="games-list"></div>
<input type="text" id="player-name-input" placeholder="Player Name"/>
<input type="text" id="room-id-input" placeholder="Room ID"/>
Expand Down
14 changes: 12 additions & 2 deletions client/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ body {
background-image: url("../../Background.webp");
background-attachment: fixed;
background-size: cover;
height: 95%;
height: 98%;
}

#lobby {

background: rgba(42,178,217, .6);
position: relative;
width: 100%;
Expand All @@ -28,6 +29,10 @@ body {
flex-direction: column;
}

.game-title {
margin-top: 210px;
}

#lobby button, #lobby input {
width: 100%;
max-width: 300px;
Expand Down Expand Up @@ -110,7 +115,7 @@ body {
flex-direction: row;
}

#playersZones h {
#playersZones h1,h2,h3,h4 {

display:inline;
}
Expand All @@ -130,6 +135,10 @@ body {
background-image: url("../../playericon.png");
}

.otherPlayerName {
font-family: 'Honk', sans-serif;
}

.middle {
flex-grow: 1;
display: flex;
Expand Down Expand Up @@ -191,6 +200,7 @@ body {
display: flex;
height: 150px;
width: 100%;
overflow-x: auto;
}

.card {
Expand Down
Binary file added client/static/jpg/Duckface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/Thatsnoneofmybuisness.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/TheWhat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/Thisisfine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/TrollFace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/TrueStory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/WakingUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/Watlady.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/WeedGuy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/static/jpg/WillyWonka.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions client/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ $(document).ready(function () {

function initServer() {
connection = new signalR.HubConnectionBuilder()
.withUrl("https://memethegatheringapi.azurewebsites.net/GameHub")
// .withUrl("https://578d-87-206-130-93.ngrok-free.app/GameHub")
//.withUrl("https://memethegatheringapi.azurewebsites.net/GameHub")
.withUrl("https://578d-87-206-130-93.ngrok-free.app/GameHub")
.withAutomaticReconnect()
.configureLogging(signalR.LogLevel.Information)
.build();
Expand Down Expand Up @@ -242,6 +242,7 @@ function addPlayerZone(playerName) {
playerDiv.setAttribute('data-player-name', playerName);

const nameElement = document.createElement('h3');
nameElement.className = 'otherPlayerName';
nameElement.textContent = playerName;

const laughElement = document.createElement('h4');
Expand Down

0 comments on commit ab7a94d

Please sign in to comment.