Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Timmlion/KJ2024 into dev…
Browse files Browse the repository at this point in the history
…elop
  • Loading branch information
amaz-e committed Jan 28, 2024
2 parents 4d0d3ee + c3b3d4b commit bb393aa
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 4 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
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.
4 changes: 2 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

0 comments on commit bb393aa

Please sign in to comment.