student пре 3 недеља
родитељ
комит
6176551cf7

+ 1 - 1
KittyFallWs/KittyFallWs/src/com/vas/webservices/KittyFallWs.java

@@ -2315,7 +2315,7 @@ public class KittyFallWs extends WebserviceAbstract {
                            message = MessageResponse.get(Common.Message.EXCHANGE_SUCCESS_MONTHLY, logger);
                            logger.info("message MONTHLY:"+message);
                         }else{
-                           message = MessageResponse.get(Common.Message.EXCHANGE_SUCCESS, logger);
+//                           message = MessageResponse.get(Common.Message.EXCHANGE_SUCCESS, logger);
                            logger.info("message EXCHANGE_SUCCESS:"+message);
                         }
                         message = message.replaceAll("%money%", money + "");

+ 2 - 0
Kitty_Fall/Kitty_Fall/Common/Http/Apis/Request/UserGameLevelResult.cs

@@ -25,6 +25,8 @@ namespace Common.Http.Apis.Request
         public decimal rewardValue { get; set; }
         public string rewardUnit { get; set; } = "";
         public string reason { get; set; } = "";
+        public decimal totalDataMb { get; set; }
+        public decimal totalLoyalty { get; set; }
     }
 
     public class UserGameLevelResultRes : CommonResponse

+ 4 - 1
Kitty_Fall/Kitty_Fall/Kitty_Fall.Apis/Business/Game/GameBusinessImpl.cs

@@ -766,7 +766,9 @@ namespace Kitty_Fall.Apis.Business.Game
                             point = "0",
                             data = "",
                             score = session.TotalScore.ToString(CultureInfo.InvariantCulture),
-                            transId = request.transId
+                            transId = request.transId,
+                            totalDataMb = session.TotalDataMb,
+                            totalLoyalty = session.TotalLoyalty
                         });
                 }
 
@@ -908,6 +910,7 @@ namespace Kitty_Fall.Apis.Business.Game
                     {
                         // LOYALTY la point cua he thong ngoai game. Chi tao reward log
                         // de worker cong ben ngoai va luu lich su, khong cong vao score/ranking.
+                        session.TotalLoyalty += rewardOption.RewardValue;
                         responsePoint = FormatPrizeValue(rewardOption.RewardValue);
                     }
 

+ 19 - 2
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/Controllers/GameController.cs

@@ -2,6 +2,7 @@ using Common;
 using Common.Extension;
 using Common.Http.Apis.Request;
 using Microsoft.AspNetCore.Mvc;
+using System.Text.Json;
 
 namespace Kitty_Fall.Website.Controllers
 {
@@ -96,8 +97,24 @@ namespace Kitty_Fall.Website.Controllers
             {
                 log.Info($"ExitGame msisdn={request.msisdn}, transId={request.transId}, level={request.level}, score={request.score}, gameType={request.gameType}, gameOver={request.gameOver}");
                 request.gameOver = request.gameOver == 0 ? 1 : request.gameOver;
-                await SendGameApiAsync(request, UrlConstant.GameSaveLevelResultUrl);
-                return RedirectToAction("Index", "Home");
+                var apiResult = await SendGameApiAsync(request, UrlConstant.GameSaveLevelResultUrl);
+                var payload = JsonSerializer.Serialize(new
+                {
+                    type = "EXIT_GAME_RESULT",
+                    success = apiResult.errorCode == "0",
+                    score = apiResult.data?.score ?? request.score.ToString(),
+                    data = apiResult.data?.totalDataMb ?? 0,
+                    loyalty = apiResult.data?.totalLoyalty ?? 0,
+                    level = request.level,
+                    message = apiResult.message ?? ""
+                });
+                var callbackHtml = $"""
+                    <!doctype html>
+                    <html><head><meta charset="utf-8"></head><body>
+                    <script>window.parent.postMessage({payload}, "*");</script>
+                    </body></html>
+                    """;
+                return Content(callbackHtml, "text/html; charset=utf-8");
             }
             catch (Exception ex)
             {

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/data.json


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/images/block1a-sheet0.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/images/block1a-sheet1.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/images/cats-sheet0.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/images/sprite3-sheet0.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/images/sprite3-sheet1.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/images/sprite3-sheet2.webp


+ 1 - 1
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/offline.json

@@ -1 +1 @@
-{"version":1784085155772,"fileList":["scripts/main.js","scripts/c3runtime.js","scripts/objRefTable.js","scripts/project/main.js","scripts/c3main.js","scripts/dispatchworker.js","scripts/jobworker.js","data.json","scripts/modernjscheck.js","scripts/supportcheck.js","scripts/offlineclient.js","icons/loading-logo.png","icons/icon-16.png","icons/icon-32.png","icons/icon-64.png","icons/icon-128.png","icons/icon-256.png","icons/icon-512.png","media/congratulations.webm","media/click.webm","media/Button03.webm","media/cute-cat-352656.webm","media/win2.webm","media/timeup_.webm","media/click_sound.webm","media/playground.webm","box2d.wasm.js","box2d.wasm","style.css","images/shared-0-sheet0.webp","images/shared-0-sheet1.webp","images/shared-0-sheet2.webp","images/shared-0-sheet3.webp","images/shared-0-sheet4.webp","images/shared-0-sheet5.webp","images/block1a-sheet0.webp","images/block1a-sheet1.webp","images/cats-sheet0.webp","images/cats-sheet1.webp","images/cats-sheet2.webp","images/cats-sheet3.webp","images/cats-sheet4.webp","images/confettix-sheet0.webp","images/confettix-sheet1.webp","images/sprite3-sheet0.webp","images/sprite3-sheet1.webp","images/sprite3-sheet2.webp","images/scroll-sheet0.webp","images/btn_lvl-sheet0.webp","images/btn_lvl-sheet1.webp","scripts/register-sw.js"]}
+{"version":1784103219556,"fileList":["scripts/main.js","scripts/c3runtime.js","scripts/objRefTable.js","scripts/project/main.js","scripts/c3main.js","scripts/dispatchworker.js","scripts/jobworker.js","data.json","scripts/modernjscheck.js","scripts/supportcheck.js","scripts/offlineclient.js","icons/loading-logo.png","icons/icon-16.png","icons/icon-32.png","icons/icon-64.png","icons/icon-128.png","icons/icon-256.png","icons/icon-512.png","media/congratulations.webm","media/click.webm","media/Button03.webm","media/cute-cat-352656.webm","media/win2.webm","media/timeup_.webm","media/click_sound.webm","media/playground.webm","box2d.wasm","box2d.wasm.js","style.css","images/shared-0-sheet0.webp","images/shared-0-sheet1.webp","images/shared-0-sheet2.webp","images/shared-0-sheet3.webp","images/shared-0-sheet4.webp","images/shared-0-sheet5.webp","images/block1a-sheet0.webp","images/block1a-sheet1.webp","images/cats-sheet0.webp","images/cats-sheet1.webp","images/cats-sheet2.webp","images/cats-sheet3.webp","images/cats-sheet4.webp","images/confettix-sheet0.webp","images/confettix-sheet1.webp","images/sprite3-sheet0.webp","images/sprite3-sheet1.webp","images/sprite3-sheet2.webp","images/scroll-sheet0.webp","images/btn_lvl-sheet0.webp","images/btn_lvl-sheet1.webp","scripts/register-sw.js"]}

+ 11 - 0
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/kitty/js/all.min.js

@@ -320,6 +320,12 @@ const initKittyFall = () => {
             if (rewardType === "LOYALTY") runRewards.loyalty += rewardValue;
         };
 
+        const setRunSummary = (data) => {
+            runRewards.score = toNumber(data?.score);
+            runRewards.data = toNumber(data?.data);
+            runRewards.loyalty = toNumber(data?.loyalty);
+        };
+
         const closeEmbeddedGame = () => {
             gameStarted = false;
             playGameRoot.classList.remove("is-game-running");
@@ -399,6 +405,11 @@ const initKittyFall = () => {
             if (event.data?.type === "GAME_OVER") {
                 saveGameOver(event.data);
             }
+            if (event.data?.type === "EXIT_GAME_RESULT") {
+                setRunSummary(event.data);
+                closeEmbeddedGame();
+                showGameOverSummary();
+            }
         });
 
         const startSession = async () => {

+ 11 - 0
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/kitty/js/input.js

@@ -320,6 +320,12 @@ const initKittyFall = () => {
             if (rewardType === "LOYALTY") runRewards.loyalty += rewardValue;
         };
 
+        const setRunSummary = (data) => {
+            runRewards.score = toNumber(data?.score);
+            runRewards.data = toNumber(data?.data);
+            runRewards.loyalty = toNumber(data?.loyalty);
+        };
+
         const closeEmbeddedGame = () => {
             gameStarted = false;
             playGameRoot.classList.remove("is-game-running");
@@ -399,6 +405,11 @@ const initKittyFall = () => {
             if (event.data?.type === "GAME_OVER") {
                 saveGameOver(event.data);
             }
+            if (event.data?.type === "EXIT_GAME_RESULT") {
+                setRunSummary(event.data);
+                closeEmbeddedGame();
+                showGameOverSummary();
+            }
         });
 
         const startSession = async () => {

BIN
Kitty_Fall/catpuzzle_mytel.zip


Неке датотеке нису приказане због велике количине промена