diff --git a/RWM-P2-TEAM-C/Assets/Scenes/Game.unity b/RWM-P2-TEAM-C/Assets/Scenes/Game.unity index f053d2c..2635db6 100644 --- a/RWM-P2-TEAM-C/Assets/Scenes/Game.unity +++ b/RWM-P2-TEAM-C/Assets/Scenes/Game.unity @@ -1169,7 +1169,6 @@ MonoBehaviour: _invincibleTimer: 2 _damagedFlashRate: 0.25 megaManHealthText: {fileID: 1277291920} - ending: {fileID: 1427678666} --- !u!50 &706003890 Rigidbody2D: serializedVersion: 4 @@ -1526,7 +1525,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 6.5, y: -0.69999695} + m_AnchoredPosition: {x: 6.5, y: -0.7000122} m_SizeDelta: {x: 49.4386, y: 23.909576} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1001556107 @@ -2180,7 +2179,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1427678666} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 98.13, y: -0.4, z: -14.377633} + m_LocalPosition: {x: 99, y: -0.4, z: -14.377633} m_LocalScale: {x: 160.25209, y: 104.93665, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -2260,6 +2259,7 @@ MonoBehaviour: deathCount: 0 defeatedEnemies: 0 level: 0 + version: week_1 --- !u!4 &1482684144 Transform: m_ObjectHideFlags: 0 diff --git a/RWM-P2-TEAM-C/Assets/Scripts/Server/AnalyticsManager.cs b/RWM-P2-TEAM-C/Assets/Scripts/Server/AnalyticsManager.cs index dd6b435..2e1ccb8 100644 --- a/RWM-P2-TEAM-C/Assets/Scripts/Server/AnalyticsManager.cs +++ b/RWM-P2-TEAM-C/Assets/Scripts/Server/AnalyticsManager.cs @@ -8,10 +8,11 @@ [System.Serializable] public class GameState { - public int bulletsFired; - public int deathCount; - public int defeatedEnemies; - public int level; + public int bulletsFired = 0; + public int deathCount = 0; + public int defeatedEnemies = 0; + public int level = 0; + public string version = "week_1"; } public class AnalyticsManager : MonoBehaviour @@ -42,6 +43,7 @@ void resetdata() public IEnumerator PostMethod() { + Debug.Log("Posting data..."); string jsonData = JsonUtility.ToJson(data); // uses pre-made data object string url = "http://34.242.150.74/upload_data"; diff --git a/RWM-P2-TEAM-C/Assets/Scripts/levelover.cs b/RWM-P2-TEAM-C/Assets/Scripts/levelover.cs index d0a2a4f..5de072e 100644 --- a/RWM-P2-TEAM-C/Assets/Scripts/levelover.cs +++ b/RWM-P2-TEAM-C/Assets/Scripts/levelover.cs @@ -27,6 +27,8 @@ void Update() timer += Time.deltaTime; displayText(); } + + //if(Input.GetMouseButtonDown(0)) } void displayText() @@ -39,7 +41,10 @@ private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.name == "Player") { + Debug.Log("player detected ending"); ended = true; + Debug.Log(AnalyticsManager.instance); + StartCoroutine(AnalyticsManager.instance.PostMethod()); over.SetActive(true); } } diff --git a/server/__pycache__/game_analytics.cpython-39.pyc b/server/__pycache__/game_analytics.cpython-39.pyc index 30d1e11..1f005a3 100644 Binary files a/server/__pycache__/game_analytics.cpython-39.pyc and b/server/__pycache__/game_analytics.cpython-39.pyc differ diff --git a/server/game_analytics.py b/server/game_analytics.py index d90fdf0..534725f 100644 --- a/server/game_analytics.py +++ b/server/game_analytics.py @@ -17,7 +17,7 @@ def connect_to_database(): return db def connect_to_database_outside_docker(): - client = MongoClient('34.242.150.74', 80, username="test", password="test") + client = MongoClient('localhost', 27017, username="test", password="test") global db db = client.test_database diff --git a/server/test.py b/server/test.py index de95429..b551d56 100644 --- a/server/test.py +++ b/server/test.py @@ -12,7 +12,7 @@ def test_post_data(): def test_get_data(): #game_analytics.connect_to_database_outside_docker() print("Connecting to database in test_get_data") - game_analytics.connect_to_database() + game_analytics.connect_to_database_outside_docker() df = game_analytics.get_dataframe() print(df)