瀏覽代碼

Removing player attributes which aren't used, but still need to be read due to GHI https://github.com/o3de/o3de/issues/16468

Signed-off-by: AMZN-Gene <[email protected]>
AMZN-Gene 2 年之前
父節點
當前提交
eb9091549b
共有 1 個文件被更改,包括 4 次插入27 次删除
  1. 4 27
      MPSGameLift/Code/Source/MatchmakingSystemComponent.cpp

+ 4 - 27
MPSGameLift/Code/Source/MatchmakingSystemComponent.cpp

@@ -25,40 +25,18 @@ namespace MPSGameLift
 {
 {
     namespace ServiceAPI
     namespace ServiceAPI
     {
     {
-        struct PlayerSkill
-        {
-            //! Storage for a matchmaking player's skill level as defined by MultiplayerSample's matchmaking ruleset.
-            //! Capturing values returned by GameLift's MatchmakingTicket::Players::PlayerAttributes::skill response
-            //! https://docs.aws.amazon.com/gamelift/latest/apireference/API_Player.html
-            bool OnJsonKey(const char* key, AWSCore::JsonReader& reader)
-            {
-                // Player skill is a number
-                // FlexMatch uses "N" (number) for interpreting how rules are logically compared
-                if (strcmp(key, "N") == 0)
-                {
-                    return reader.Accept(skill);
-                }
-                return reader.Ignore();
-            }
-
-            int skill;
-        };
-
         //! A collection of key:value pairs containing player information for use in matchmaking
         //! A collection of key:value pairs containing player information for use in matchmaking
         //! Capturing values returned by GameLift's MatchmakingTicket::Players::PlayerAttributes response
         //! Capturing values returned by GameLift's MatchmakingTicket::Players::PlayerAttributes response
+        //! The MultiplayerSample game doesn't match make based on any player attributes, 
+        //!    but the FlexMatch JSON response returns a "PlayerAttributes" table so this is here to avoid asserting.
+        //!    See https://github.com/o3de/o3de/issues/16468
         //! https://docs.aws.amazon.com/gamelift/latest/apireference/API_Player.html
         //! https://docs.aws.amazon.com/gamelift/latest/apireference/API_Player.html
         struct PlayerAttributes
         struct PlayerAttributes
         {
         {
-            bool OnJsonKey(const char* key, AWSCore::JsonReader& reader)
+            bool OnJsonKey([[maybe_unused]]const char* key, AWSCore::JsonReader& reader)
             {
             {
-                if (strcmp(key, "skill") == 0)
-                {
-                    return reader.Accept(skill);
-                }
                 return reader.Ignore();
                 return reader.Ignore();
             }
             }
-
-            PlayerSkill skill;
         };
         };
 
 
         //! Struct for storing a player's regional latency map
         //! Struct for storing a player's regional latency map
@@ -160,7 +138,6 @@ namespace MPSGameLift
             AZStd::vector<Player> players;
             AZStd::vector<Player> players;
             GameSessionConnectionInfo gameSessionConnectionInfo;
             GameSessionConnectionInfo gameSessionConnectionInfo;
             AZStd::string status;
             AZStd::string status;
-
         };
         };
 
 
         // Service RequestJobs
         // Service RequestJobs