stetson / Capture-The-Flag

Proof of concept for real-time applications on Node.js
Other
4 stars 0 forks source link

Flag Captured Not Resetting #103

Closed ghost closed 13 years ago

ghost commented 13 years ago

For example, a blue player takes the red flag and starts walking towards their side of the game; then they disconnect from the game. They are put into observer mode and their has_flag boolean is set to false, but the red_flag_captured boolean is NOT reset to false.

Here is a snapshot of the json when this happened:

{
   "Derp":{
      "origin":{
         "latitude":"37.422005",
         "longitude":"-81.08409499999999"
      },
      "red_flag":{
         "latitude":37.42526146051984,
         "longitude":-81.08409499999995,
         "angular_distance":0.00005683595803087168,
         "bearing":0,
         "offset":0.36210240013830575
      },
      "blue_flag":{
         "latitude":37.418748539480156,
         "longitude":-81.08409499999964,
         "angular_distance":0.00005683595803087168,
         "bearing":3.1415926535,
         "offset":0.36210240013830575
      },
      "red_flag_captured":true,
      "blue_flag_captured":false,
      "red_bounds":{
         "top_left":{
            "latitude":"37.425623",
            "longitude":"-81.088651",
            "angular_distance":0.00008930909186414084,
            "bearing":5.497787143625,
            "offset":0.5689890280482681
         },
         "bottom_right":{
            "latitude":"37.422005",
            "longitude":"-81.079539",
            "angular_distance":0.00006315106447874631,
            "bearing":1.57079632675,
            "offset":0.40233600015367305
         }
      },
      "blue_bounds":{
         "top_left":{
            "latitude":"37.422005",
            "longitude":"-81.088651",
            "angular_distance":0.00006315106447874631,
            "bearing":4.71238898025,
            "offset":0.40233600015367305
         },
         "bottom_right":{
            "latitude":"37.418387",
            "longitude":"-81.079539",
            "angular_distance":0.00008930909186414084,
            "bearing":2.356194490125,
            "offset":0.5689890280482681
         }
      },
      "last_update":"2011-04-18T19:19:01.630Z",
      "players":{
         "5A72DD62-055C-4260-YE04-E594378F6C91":{
            "latitude":"37.421998333333335",
            "longitude":"-81.08409499999999",
            "accuracy":"0.0",
            "user_id":"5A72DD62-055C-4260-YE04-E594378F6C91",
            "name":"Guesttttt",
            "team":"red",
            "has_flag":false,
            "captures":0,
            "tags":0,
            "observer_mode":true,
            "messages":[

            ],
            "game_id":"Derp",
            "last_update":"2011-04-18T19:19:01.630Z"
         }
      },
      "red":2,
      "blue":1,
      "red_score":0,
      "blue_score":0,
      "creator":"8BCC330D-B1FF-4AB3-Y2E7-C64F1F4337104"
   }
}