Explorar o código

Merge branch 'master' of narkampen.nordh.xyz:/home/git/Projects/NarKampen

axel-server %!s(int64=5) %!d(string=hai) anos
pai
achega
06ff893ed7

+ 38 - 14
Assets/AnswerLineInfoScript.cs

@@ -22,6 +22,7 @@ public class AnswerLineInfoScript : MonoBehaviour
     private String signedInName;
     private GameManagerScript gameManagerScript;
     
+    private List<AnswerLineQuestionCard> signedInPlayerQuestions = new List<AnswerLineQuestionCard>();
     private void Start() {
         nextPlayerButton.onClick.AddListener(ShowNextPlayerAnswerLine);
         prevPlayerButton.onClick.AddListener(ShowPrevPlayerAnswerLine);
@@ -36,20 +37,28 @@ public class AnswerLineInfoScript : MonoBehaviour
         UpdateUnlockedQuestionsText();
         UpdateButtonsText(); 
         SetQuestionClickable();
+        if (signedInName.Equals(currentPlayerShown, StringComparison.InvariantCultureIgnoreCase) && 
+            signedInPlayerQuestions != answerLine.GetComponentsInChildren<AnswerLineQuestionCard>().ToList()) {
+            signedInPlayerQuestions = answerLine.GetComponentsInChildren<AnswerLineQuestionCard>().ToList();
+        }
     }
 
     private void SetQuestionClickable() {
         List<KeyValuePair<string, int>> players = gameManagerScript.GetPlayers();
-        if (gameManagerScript.GetGameMode().Equals("ONLINE")) {
-            if (players.Count > 1 && currentPlayerShown != null) {
-                if (GameManagerScript.GetCurrentPlayer().Equals(currentPlayerShown, StringComparison.InvariantCultureIgnoreCase)) {
-                    newQuestion.GetComponent<NewQuestionCardController>().BackClickable = true;
-                } else {
-                    newQuestion.GetComponent<NewQuestionCardController>().BackClickable = false;
+        if (gameManagerScript.GameStatus == null || !gameManagerScript.GameStatus.Equals("FINISHED")) {
+            if (gameManagerScript.GetGameMode().Equals("ONLINE")) {
+                if (players.Count > 1 && currentPlayerShown != null) {
+                    if (GameManagerScript.GetCurrentPlayer().Equals(currentPlayerShown, StringComparison.InvariantCultureIgnoreCase)) {
+                        newQuestion.GetComponent<NewQuestionCardController>().BackClickable = true;
+                    } else {
+                        newQuestion.GetComponent<NewQuestionCardController>().BackClickable = false;
+                    }
                 }
+            } else {
+                    newQuestion.GetComponent<NewQuestionCardController>().BackClickable = true;
             }
         } else {
-                newQuestion.GetComponent<NewQuestionCardController>().BackClickable = true;
+                    newQuestion.GetComponent<NewQuestionCardController>().BackClickable = false;
         }
     }
 
@@ -107,7 +116,7 @@ public class AnswerLineInfoScript : MonoBehaviour
                         if (players[i-1].Key.Equals(signedInName, StringComparison.InvariantCultureIgnoreCase)) {
                                 prevPlayerButton.GetComponent<AnswerLineInfoPlayerButton>().PlayerName = LocalizationManager.Instance.GetText("YOUR");
                         } else {
-                            prevPlayerButton.GetComponent<AnswerLineInfoPlayerButton>().PlayerName = players[i-1].Key;
+                            prevPlayerButton.GetComponent<AnswerLineInfoPlayerButton>().PlayerName = players[i-1].Key + "s";
                         }
                         prevPlayerButton.GetComponentInChildren<Text>().text = String.Format(playerBaseText, prevPlayerButton.GetComponent<AnswerLineInfoPlayerButton>().PlayerName);
                         break;
@@ -157,9 +166,17 @@ public class AnswerLineInfoScript : MonoBehaviour
             currentPlayerShown = nextPlayerButton.GetComponent<AnswerLineInfoPlayerButton>().PlayerName;
             currentPlayerShown = currentPlayerShown.Substring(0,currentPlayerShown.Length - 1);
         }
-        List<NewQuestionData> playerQuestions = Database.Instance.GetPlayerQuestions(gameManagerScript.GameId, currentPlayerShown, gameManagerScript.GameMode);
 
-        setQuestionFrosting(playerQuestions);
+        if (currentPlayerShown.Equals(signedInName, StringComparison.InvariantCultureIgnoreCase)) {
+            List<NewQuestionData> questions = new List<NewQuestionData>();
+            foreach (AnswerLineQuestionCard aq in signedInPlayerQuestions) {
+                questions.Add(new NewQuestionData(aq.GetAnswerText(), aq.GetQuestionText(), aq.CategoryText, aq.CategoryId, aq.QuestionId, aq.CategoryColor, aq.QuestionSafe));
+            }
+            setQuestionFrosting(questions);
+        } else {
+            List<NewQuestionData> showPlayerQuestions = Database.Instance.GetPlayerQuestions(gameManagerScript.GameId, currentPlayerShown, gameManagerScript.GameMode);
+            setQuestionFrosting(showPlayerQuestions);
+        }
         UpdateButtonsText();
     }
 
@@ -171,10 +188,17 @@ public class AnswerLineInfoScript : MonoBehaviour
             currentPlayerShown = prevPlayerButton.GetComponent<AnswerLineInfoPlayerButton>().PlayerName;
             currentPlayerShown = currentPlayerShown.Substring(0, currentPlayerShown.Length - 1);
         }
-        
-        List<NewQuestionData> playerQuestions = Database.Instance.GetPlayerQuestions(gameManagerScript.GameId, currentPlayerShown, gameManagerScript.GameMode);
-        
-        setQuestionFrosting(playerQuestions);
+
+        if (currentPlayerShown.Equals(signedInName, StringComparison.InvariantCultureIgnoreCase)) {
+            List<NewQuestionData> questions = new List<NewQuestionData>();
+            foreach (AnswerLineQuestionCard aq in signedInPlayerQuestions) {
+                questions.Add(new NewQuestionData(aq.GetAnswerText(), aq.GetQuestionText(), aq.CategoryText, aq.CategoryId, aq.QuestionId, aq.CategoryColor, aq.QuestionSafe));
+            }
+            setQuestionFrosting(questions);
+        } else {
+            List<NewQuestionData> showPlayerQuestions = Database.Instance.GetPlayerQuestions(gameManagerScript.GameId, currentPlayerShown, gameManagerScript.GameMode);
+            setQuestionFrosting(showPlayerQuestions);
+        }
         UpdateButtonsText();
     }
 

+ 2 - 31
Assets/Data/google-services.json

@@ -15,39 +15,10 @@
       },
       "oauth_client": [
         {
-          "client_id": "108102546370-2bu9lhiunhhi5v6up5dcuntnucoo5dcf.apps.googleusercontent.com",
-          "client_type": 3
-        }
-      ],
-      "api_key": [
-        {
-          "current_key": "AIzaSyCBQiFiFWvzWMFrTBWtHVagJ5xk-T_ytGw"
-        }
-      ],
-      "services": {
-        "appinvite_service": {
-          "other_platform_oauth_client": [
-            {
-              "client_id": "108102546370-crv9k8j6892fmbchirjuqcoiia1191fm.apps.googleusercontent.com",
-              "client_type": 3
-            }
-          ]
-        }
-      }
-    },
-    {
-      "client_info": {
-        "mobilesdk_app_id": "1:108102546370:android:c379d06ef36a3e568b9c5b",
-        "android_client_info": {
-          "package_name": "se.nordh.xyz.narKampen"
-        }
-      },
-      "oauth_client": [
-        {
-          "client_id": "108102546370-04af3qem370e3hdp25hg070juo232d15.apps.googleusercontent.com",
+          "client_id": "108102546370-b48v2cbdfoh2rjm0nquqrsjolckqats6.apps.googleusercontent.com",
           "client_type": 1,
           "android_info": {
-            "package_name": "se.nordh.xyz.narKampen",
+            "package_name": "se.axelnordh.narkampen",
             "certificate_hash": "21e89b1f32a959ce39269c69ff4346779afca0da"
           }
         },

+ 1 - 0
Assets/NewDropZoneScript.cs

@@ -41,6 +41,7 @@ public class NewDropZoneScript : MonoBehaviour, IDropHandler, IPointerEnterHandl
                 questionData.Question,
                 draggedQuestion.GetComponent<NewQuestionDragController>().AnswerText.text);
 
+            confirmDialog.SetTitle(LocalizationManager.Instance.GetText("ARE_YOU_SURE_TITLE"));
             confirmDialog.SetMessage(message);
             confirmDialog.SetOnAccept(LocalizationManager.Instance.GetText("YES"), () => { 
                 YesFunction(); 

+ 10 - 0
Assets/Scenes/narKampen.unity

@@ -5775,6 +5775,11 @@ PrefabInstance:
       propertyPath: m_AnchoredPosition.y
       value: 0
       objectReference: {fileID: 0}
+    - target: {fileID: 7679625126193545669, guid: 3394fe203de584e40a860468e3563888,
+        type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 50
+      objectReference: {fileID: 0}
     - target: {fileID: 7679625126198992958, guid: 3394fe203de584e40a860468e3563888,
         type: 3}
       propertyPath: m_AnchorMin.y
@@ -5795,6 +5800,11 @@ PrefabInstance:
       propertyPath: m_AnchoredPosition.y
       value: 0
       objectReference: {fileID: 0}
+    - target: {fileID: 7679625126198992958, guid: 3394fe203de584e40a860468e3563888,
+        type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 50
+      objectReference: {fileID: 0}
     - target: {fileID: 7679625126394289811, guid: 3394fe203de584e40a860468e3563888,
         type: 3}
       propertyPath: m_SizeDelta.y

+ 3 - 2
Assets/Scripts/Database/Database.cs

@@ -714,7 +714,7 @@ public class Database : MonoBehaviour {
             cmd.Dispose();
             conn.Close();
         }
-        NewQuestionData q = new NewQuestionData(answerString, questionString, categoryName, categoryId, id, questionCategoryColor);
+        NewQuestionData q = new NewQuestionData(answerString, questionString, categoryName, categoryId, id, questionCategoryColor, false);
 
         return q;
     }
@@ -769,7 +769,8 @@ public class Database : MonoBehaviour {
                     reader.GetString(6),
                     reader.GetInt32(5),
                     reader.GetInt32(0), 
-                    questionCategoryColor);
+                    questionCategoryColor,
+                    true);
 
 
                 questions.Add(questionData);

+ 40 - 7
Assets/Scripts/Database/OnlineDatabase.cs

@@ -302,14 +302,15 @@ public class OnlineDatabase : MonoBehaviour {
         List<OnlineGameScript> games = new List<OnlineGameScript>();
         int gameId = -1;
 
-    OnlineGame prevGame = null;
+        OnlineGame prevGame = null;
+        KeyValuePair<int, string> signedInUser = Database.Instance.GetSignedInUser();
         foreach (OnlineGame game in og.onlineGamesList) {
             Int32.TryParse(game.id, out int currentGameId);
             if (gameId != currentGameId) { // Spel ej i listan
                 if (ogs != null) { // lägg till spel i listan, inte första gången
                     SetGlobalGameInfo(userName, ogs, gameId, prevGame);
-                    if (game.currentPlayer.Equals(Database.Instance.GetSignedInUser().Value, StringComparison.InvariantCultureIgnoreCase)) {
-                        ogs.SetGameStatus("YOUR_TURN");
+                    if (ogs.GameStatus == null) {
+                        ogs.SetGameStatus(game.status);
                     }
                     games.Add(ogs);
                 }
@@ -329,16 +330,49 @@ public class OnlineDatabase : MonoBehaviour {
                     ogs.CurrentPlayer = game.username;
                 }
             }
+            SetGameStatus(ogs, signedInUser, game);
             prevGame = game;
         }
+
+        SetGameStatus(ogs, signedInUser, og.onlineGamesList[og.onlineGamesList.Count - 1]);
         SetGlobalGameInfo(userName, ogs, gameId, og.onlineGamesList[og.onlineGamesList.Count - 1]);
+        if (ogs.GameStatus == null) {
+            ogs.SetGameStatus(og.onlineGamesList[og.onlineGamesList.Count - 1].status);
+        }
         games.Add(ogs);
         
         return games;
     }
 
+    private void SetGameStatus(OnlineGameScript ogs, KeyValuePair<int, string> signedInUser, OnlineGame game) {
+        if (game.currentPlayer.Equals(signedInUser.Key.ToString())) {
+            if (game.status.Equals("ACTIVE")) {
+                ogs.SetGameStatus("YOUR_TURN");
+            } else if (game.status.Equals("PENDING")) {
+                if (game.userId.Equals(signedInUser.Key.ToString()) && game.playerStatus.Equals("WAITING")) {
+                    ogs.SetGameStatus("INVITED");
+                } else {
+                    ogs.SetGameStatus("PENDING");
+                }
+            }
+        } else {
+            if (game.status.Equals("ACTIVE")) {
+                if (game.currentPlayer.Equals(game.userId)) {
+                    ogs.CurrentPlayer = game.username;
+                }
+                ogs.SetGameStatus("OTHERS_TURN");
+            } else if (game.status.Equals("PENDING")) {
+                if (game.userId.Equals(signedInUser.Key.ToString()) && game.playerStatus.Equals("WAITING")) {
+                    ogs.SetGameStatus("INVITED");
+                }  else {
+                    ogs.SetGameStatus("PENDING");
+                }
+                
+            }
+        }
+    }
+
     private void SetGlobalGameInfo(string userName, OnlineGameScript ogs, int gameId, OnlineGame game) {
-        ogs.SetGameStatus(game.status);
         ogs.SetId(game.id);
         ogs.SetWinNumber(game.winNumber);
         ogs.SetAnswerTimer(game.answerTimer);
@@ -538,12 +572,11 @@ public class OnlineDatabase : MonoBehaviour {
         Question q = GetQuestionData(gameId, userId);
 
         Color32 categoryColor = new Color32((byte)q.r, (byte)q.g, (byte)q.b, (byte)q.a);
-        //            Color32 questionCategoryColor = new Color32((byte)q.r, (byte)q.g, (byte)q.b, (byte)q.a);
 
         Int32.TryParse(q.category, out int categoryId);
         Int32.TryParse(q.id, out int questionId);
 
-        NewQuestionData questionData = new NewQuestionData(q.answer, q.question, q.categoryName, categoryId, questionId, categoryColor);
+        NewQuestionData questionData = new NewQuestionData(q.answer, q.question, q.categoryName, categoryId, questionId, categoryColor, false);
 
         return questionData;
     }
@@ -585,7 +618,7 @@ public class OnlineDatabase : MonoBehaviour {
             Int32.TryParse(q.category, out int categoryId);
             Int32.TryParse(q.id, out int questionId);
 
-            NewQuestionData questionData = new NewQuestionData(q.answer, q.question, q.categoryName, categoryId, questionId, categoryColor);
+            NewQuestionData questionData = new NewQuestionData(q.answer, q.question, q.categoryName, categoryId, questionId, categoryColor, true);
 
             questions.Add(questionData);
         }

+ 5 - 1
Assets/Scripts/GameManagerScript.cs

@@ -12,6 +12,8 @@ public class GameManagerScript : MonoBehaviour {
 
     private int neededForWin;
 
+    private String gameStatus;
+
     public Database db;
     public OnlineDatabase odb;
     StatsScript statsScript;
@@ -27,6 +29,7 @@ public class GameManagerScript : MonoBehaviour {
 
     public int QuestionTimer { get => questionTimer; set => questionTimer = value; }
     public int NeededForWin { get => neededForWin; set => neededForWin = value; }
+    public string GameStatus { get => gameStatus; set => gameStatus = value; }
 
     static string currentPlayer;
 
@@ -142,9 +145,10 @@ public class GameManagerScript : MonoBehaviour {
                 Database.Instance.GetQuestionsLost(GameId, currentPlayer, GameMode), 
                 Database.Instance.GetRoundValue(GameId, GameMode)));
             dialog.SetOnAccept(LocalizationManager.Instance.GetText("OK"), () => {
+                GameStatus = "FINISHED";
                 Database.Instance.SetGameFinished(GameId, GameMode);
                 scrollViewScript.SetAllQuestionsLocked(true);
-                GameObject.Find("NewQuestion").GetComponent<NewQuestionCardController>().BackClickable = false;
+                
                 if (GameMode.Equals("Online")) {
                     OnlineDatabase.Instance.SendGameOverMessage(GameId, players, currentPlayer, Database.Instance.GetRoundValue(GameId, GameMode));
                 }

+ 5 - 2
Assets/Scripts/MainGame/NewQuestionData.cs

@@ -1,7 +1,7 @@
 using System.Collections;
 using UnityEngine;
 
-public class NewQuestionData  {
+public class NewQuestionData {
 
     public string Answer { get; set; }
     public string Question { get; set; }
@@ -10,12 +10,15 @@ public class NewQuestionData  {
     public int Id { get; set; }
     public Color32 CategoryColor { get; set; }
 
-    public NewQuestionData(string answer, string question, string categoryName, int categoryId, int id, Color categoryColor) {
+    public bool QuestionSafe {get; set;}
+
+    public NewQuestionData(string answer, string question, string categoryName, int categoryId, int id, Color categoryColor, bool questionSafe) {
         Answer = answer;
         Question = question;
         CategoryName = categoryName;
         CategoryId = categoryId;
         Id = id;
         CategoryColor = categoryColor;
+        QuestionSafe = questionSafe;
     }
 }

+ 1 - 1
Assets/Scripts/MainGame/NewQuestionsPanel.cs

@@ -69,7 +69,7 @@ public class NewQuestionsPanel : MonoBehaviour
             AnswerLineQuestionCard[] answerLineQuestions = QuestionAnswerLine.GetComponentsInChildren<AnswerLineQuestionCard>();
             List<int> answerIds = new List<int>();
             foreach (var aq in answerLineQuestions) {
-                answerIds.Add(aq.GetId());
+                answerIds.Add(aq.QuestionId);
             }
 
             KeyValuePair<int, String> user = Database.Instance.GetSignedInUser();

+ 31 - 23
Assets/Scripts/MainGame/QuestionCard.cs

@@ -12,10 +12,12 @@ public class QuestionCard : MonoBehaviour {
 
     public GameObject questionTextPanel;
 
-    public string questionString = "";
-    public string answerString = "";
-    public string idString = "";
-    public string categoryString = "";
+    private Color categoryColor;
+
+    private int categoryId;
+    private int questionId;
+    private bool questionSafe;
+    private String categoryText;
 
     public Color32 unsafeColor;
     public Color32 safeColor;
@@ -25,21 +27,35 @@ public class QuestionCard : MonoBehaviour {
     [SerializeField] GameObject frontCategoryPanel;
     [SerializeField] Text frontCategoryText;
 
+    public Color CategoryColor { get => categoryColor; set => categoryColor = value; }
+    public int CategoryId { get => categoryId; set => categoryId = value; }
+    public int QuestionId { get => questionId; set => questionId = value; }
+    public bool QuestionSafe { get => questionSafe; set => questionSafe = value; }
+    public string CategoryText { get => categoryText; set => categoryText = value; }
+
+
+    public void SetQuestionSafe(bool safe) {
+        if (safe) {
+            SetQuestionSafe();
+        } else {
+            SetQuestionUnSafe();
+        }
+    }
     public void SetQuestionSafe() {
         this.GetComponent<Image>().color = safeColor;
+        QuestionSafe = true;
     }
 
     internal void SetQuestionUnSafe() {
         this.GetComponent<Image>().color = unsafeColor;
+        QuestionSafe = false;
     }
     public bool IsQuestionSafe() {
-        if (this.GetComponent<Image>().color == safeColor) {
-            return true;
-        }
-        return false;
+        return QuestionSafe;
     }
 
     public void SetQuestionCategoryColor(Color32 questionCategoryColor) {
+        CategoryColor = questionCategoryColor;
         if (backCategoryText != null) {
             backCategoryText.transform.parent.GetComponent<Image>().color = questionCategoryColor;
             frontCategoryPanel.GetComponent<Image>().color = questionCategoryColor;
@@ -61,26 +77,16 @@ public class QuestionCard : MonoBehaviour {
         this.answerText.text = text;
     }
 
-    public Text GetQuestionText() {
-        return this.questionText;
-    }
-
-    public Text GetAnswerText() {
-        return this.answerText;
+    public String GetQuestionText() {
+        return this.questionText.text;
     }
 
-    public int GetCategoryId() {
-        Int32.TryParse(categoryString, out int result);
-        return result;
-    }
-
-    internal int GetId() {
-        Int32.TryParse(idString, out int result);
-        return result;
+    public String GetAnswerText() {
+        return this.answerText.text;
     }
 
     public void SetId(int value) {
-        idString = value.ToString();
+        questionId = value;
     }
 
     public void SetBackCategoryText(string value) {
@@ -90,6 +96,7 @@ public class QuestionCard : MonoBehaviour {
         }
         backCategoryText.text = value;
         frontCategoryText.text = value;
+        CategoryText = value;
     }
 
     public string GetBackCategoryText() {
@@ -106,4 +113,5 @@ public class QuestionCard : MonoBehaviour {
             frosting.alpha = 0f;
         }
     }
+
 }

+ 4 - 5
Assets/Scripts/MainGame/ScrollViewScript.cs

@@ -99,12 +99,11 @@ public class ScrollViewScript : MonoBehaviour {
             answerLineQuestionCard.SetAnswerText(q.Answer);
             answerLineQuestionCard.SetQuestionText(q.Question);
             answerLineQuestionCard.SetId(q.Id);
-            answerLineQuestionCard.SetQuestionSafe();
+            answerLineQuestionCard.SetQuestionSafe(q.QuestionSafe);
             answerLineQuestionCard.SetBackCategoryText(q.CategoryName);
-            answerLineQuestionCard.SetQuestionCategoryColor(q.CategoryColor); // TODO kommer bara 255,255,255,255 till SetQuestionCategoryColor
+            answerLineQuestionCard.SetQuestionCategoryColor(q.CategoryColor);
 
             if (gameMode.Equals("Online")) {
-                //if (signedInUser.Value.Equals(GameManagerScript.GetCurrentPlayer(), StringComparison.InvariantCultureIgnoreCase)) {
                 if (signedInUser.Value.Equals(Database.Instance.GetSignedInUser().Value, StringComparison.InvariantCultureIgnoreCase)) {
                     answerLineQuestionCard.SetFrostingActive(false);
                 } else {
@@ -166,7 +165,7 @@ public class ScrollViewScript : MonoBehaviour {
         foreach (var questionCard in answerLineQuestionCards)
         {
             if (needsSave && !questionCard.IsQuestionSafe()) {
-                saveQuestions.Add(questionCard.GetId());
+                saveQuestions.Add(questionCard.QuestionId);
                 questionCard.SetQuestionSafe();
             }
         }
@@ -180,7 +179,7 @@ public class ScrollViewScript : MonoBehaviour {
         List<int> questionIds = new List<int>();
 
         foreach (AnswerLineQuestionCard q in contentPanel.GetComponentsInChildren<AnswerLineQuestionCard>()) {
-            questionIds.Add(q.GetId());
+            questionIds.Add(q.QuestionId);
         }
 
         return questionIds;

+ 1 - 1
Assets/Scripts/NewGameScene/GameInfoScript.cs

@@ -63,7 +63,7 @@ public class GameInfoScript : MonoBehaviour {
         acceptButton.enabled = false;
         acceptButton.interactable = false;
 
-        if (onlineGameScript.GameStatus.Equals("ACTIVE")) {
+        if (onlineGameScript.GameStatus.Equals("ACTIVE") || onlineGameScript.GameStatus.Equals("YOUR_TURN") || onlineGameScript.GameStatus.Equals("OTHERS_TURN")) {
             acceptButton.enabled = true;
             acceptButton.interactable = true;
         }

+ 7 - 4
Assets/Scripts/NewGameScene/OnlineGameScript.cs

@@ -111,9 +111,9 @@ public class OnlineGameScript : MonoBehaviour {
         if ("PENDING".Equals(status)) {
             image.color = statusColors[0];
         } else if ("YOUR_TURN".Equals(status)) {
-            image.color = statusColors[1];
-        } else if ("OTHERS_TURN".Equals(status)) {
             image.color = statusColors[2];
+        } else if ("OTHERS_TURN".Equals(status)) {
+            image.color = statusColors[1];
         } else if ("DECLINED".Equals(status)) {
             image.color = statusColors[3];
         } else if ("INVITED".Equals(status)) {
@@ -145,9 +145,12 @@ public class OnlineGameScript : MonoBehaviour {
             gameTitleText.gameObject.GetComponent<TextLocalization>().key = "FCM_NEXT_PLAYER_TITLE";
             SetTitleText(LocalizationManager.Instance.GetText("FCM_NEXT_PLAYER_TITLE"));
         } else if ("OTHERS_TURN".Equals(GameStatus)) {
-            gameStatusText.gameObject.GetComponent<TextLocalization>().key = OTHERS_TURN;
+            TextLocalization textLocalization = gameStatusText.gameObject.GetComponent<TextLocalization>();
+            textLocalization.key = OTHERS_TURN;
+            textLocalization.SetReplaceText(CurrentPlayer);
             string message = LocalizationManager.Instance.GetText(OTHERS_TURN);
-            gameStatusText.text = String.Format(message, CurrentPlayer);
+        //    message = String.Format(message, CurrentPlayer);
+            gameStatusText.text = message;
             gameTitleText.gameObject.GetComponent<TextLocalization>().key = "NOT_YOUR_TURN";
             SetTitleText(LocalizationManager.Instance.GetText("NOT_YOUR_TURN"));
         } else if ("DECLINED".Equals(GameStatus)) {

+ 2 - 31
Assets/StreamingAssets/google-services-desktop.json

@@ -15,39 +15,10 @@
       },
       "oauth_client": [
         {
-          "client_id": "108102546370-2bu9lhiunhhi5v6up5dcuntnucoo5dcf.apps.googleusercontent.com",
-          "client_type": 3
-        }
-      ],
-      "api_key": [
-        {
-          "current_key": "AIzaSyCBQiFiFWvzWMFrTBWtHVagJ5xk-T_ytGw"
-        }
-      ],
-      "services": {
-        "appinvite_service": {
-          "other_platform_oauth_client": [
-            {
-              "client_id": "108102546370-crv9k8j6892fmbchirjuqcoiia1191fm.apps.googleusercontent.com",
-              "client_type": 3
-            }
-          ]
-        }
-      }
-    },
-    {
-      "client_info": {
-        "mobilesdk_app_id": "1:108102546370:android:c379d06ef36a3e568b9c5b",
-        "android_client_info": {
-          "package_name": "se.nordh.xyz.narKampen"
-        }
-      },
-      "oauth_client": [
-        {
-          "client_id": "108102546370-04af3qem370e3hdp25hg070juo232d15.apps.googleusercontent.com",
+          "client_id": "108102546370-b48v2cbdfoh2rjm0nquqrsjolckqats6.apps.googleusercontent.com",
           "client_type": 1,
           "android_info": {
-            "package_name": "se.nordh.xyz.narKampen",
+            "package_name": "se.axelnordh.narkampen",
             "certificate_hash": "21e89b1f32a959ce39269c69ff4346779afca0da"
           }
         },

+ 1 - 1
Assets/StreamingAssets/google-services-desktop.json.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 356e6efe83a950047917694d34bc86e3
+guid: e989830c178aa4045ac1d33847f0e63f
 TextScriptImporter:
   externalObjects: {}
   userData: 

+ 1 - 1
Assets/Translations/ENGLISH.xml

@@ -86,7 +86,7 @@
   <text key="ONLINE_GAME_STATUS_TITLE_INVITED">Invited to play</text>
   <text key="ONLINE_GAME_STATUS_PENDING">Waiting for other player</text>
   <text key="ONLINE_GAME_STATUS_YOUR_TURN">Your turn</text>
-  <text key="ONLINE_GAME_STATUS_ANOTHER_PLAYER">{0}s turn</text>
+  <text key="ONLINE_GAME_STATUS_OTHERS_TURN">{0}s turn</text>
   <text key="ONLINE_GAME_STATUS_DECLINED">Game invite declined</text>
   <text key="ONLINE_GAME_STATUS_INVITED">You are invited</text>
   <text key="ONLINE_GAME_STATUS_ACTIVE">{0}s turn</text>

+ 1 - 1
Assets/Translations/SWEDISH.xml

@@ -87,7 +87,7 @@
   <text key="ONLINE_GAME_STATUS_TITLE_INVITED">Inbjuden till spel</text>
   <text key="ONLINE_GAME_STATUS_PENDING">Väntar på andra spelare</text>
   <text key="ONLINE_GAME_STATUS_YOUR_TURN">Din tur</text>
-  <text key="ONLINE_GAME_STATUS_ANOTHER_PLAYER">{0}s tur</text>
+  <text key="ONLINE_GAME_STATUS_OTHERS_TURN">{0}s tur</text>
   <text key="ONLINE_GAME_STATUS_DECLINED">Spelet nekat</text>
   <text key="ONLINE_GAME_STATUS_INVITED">Du är inbjuden</text>
   <text key="ONLINE_GAME_STATUS_ACTIVE">{0}s tur</text>

BIN=BIN
Assets/narKampenLocal.db


+ 2 - 0
dbFiles/Question.php

@@ -35,6 +35,8 @@
 		}
 		$jsonString = json_encode($json);
 		echo $jsonString;
+	} else {
+		echo "ERROR, no question found";
 	}
 
 ?>