Commit 64836641 authored by nk161690's avatar nk161690

Add docker

parent 5fce792b
using GooglePlayGames; using GooglePlayGames;
using GooglePlayGames.BasicApi; using GooglePlayGames.BasicApi;
using Photon.Pun; using Photon.Pun;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class GoogleLogin : MonoBehaviour public class GoogleLogin : MonoBehaviour
{ {
private Log.LoginSession session = new Log.LoginSession(); private Log.LoginSession session = new Log.LoginSession();
private bool isQuitting = false;
public void OnGoogleLoginButtonClicked() public void OnGoogleLoginButtonClicked()
{ {
...@@ -25,11 +21,13 @@ public class GoogleLogin : MonoBehaviour ...@@ -25,11 +21,13 @@ public class GoogleLogin : MonoBehaviour
{ {
Debug.Log("Signed in with Google Play successfully."); Debug.Log("Signed in with Google Play successfully.");
UserSessionManager.LogIn(Social.localUser.userName); UserSessionManager.LogIn(Social.localUser.id);
string googlePlayGamesID = Social.localUser.id;
PhotonNetwork.NickName = googlePlayGamesID;
//AuthenticationValues authValues = new AuthenticationValues();
//authValues.AuthType = CustomAuthenticationType.Custom;
//authValues.AddAuthParameter("user", Social.localUser.userName);
//authValues.UserId = Social.localUser.id;
//PhotonNetwork.AuthValues = authValues;
PhotonNetwork.ConnectUsingSettings(); PhotonNetwork.ConnectUsingSettings();
} }
else if (success == SignInStatus.InternalError) else if (success == SignInStatus.InternalError)
...@@ -41,21 +39,4 @@ public class GoogleLogin : MonoBehaviour ...@@ -41,21 +39,4 @@ public class GoogleLogin : MonoBehaviour
Debug.Log("Failed to sign in with Google Play"); Debug.Log("Failed to sign in with Google Play");
} }
} }
void Update()
{
// Handle quitting on Android devices
if (Application.platform == RuntimePlatform.Android)
{
if (Input.GetKeyDown(KeyCode.Escape))
{
if (!isQuitting)
{
isQuitting = true;
session.LogoutTime = System.DateTime.Now.ToString("dd/MM/yyyy HH:mm");
Log.LogLoginSession(session);
}
}
}
}
} }
...@@ -21,13 +21,12 @@ public static class Log ...@@ -21,13 +21,12 @@ public static class Log
string jsonData = JsonConvert.SerializeObject(session); string jsonData = JsonConvert.SerializeObject(session);
// Send the data to Elasticsearch using HTTP POST request // Send the data to Elasticsearch using HTTP POST request
string elasticUrl = "https://893485fbcebc4a4d9102091b2bad74a4.us-central1.gcp.cloud.es.io:443/login_sessions/_doc" + string elasticUrl = "https://893485fbcebc4a4d9102091b2bad74a4.us-central1.gcp.cloud.es.io:443/login_sessions/_doc?pipeline=ent-search-generic-ingestion";
"?pipeline=ent-search-generic-ingestion";
using (HttpClient client = new HttpClient()) using (HttpClient client = new HttpClient())
{ {
var contentType = new MediaTypeWithQualityHeaderValue("application/json"); var contentType = new MediaTypeWithQualityHeaderValue("application/json");
client.DefaultRequestHeaders.Accept.Add(contentType); client.DefaultRequestHeaders.Accept.Add(contentType);
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("ApiKey", "MUdvM3NJa0I3bFF0X01wcFZWY2s6MzU4WllreVJRSldfZEhWSTVPbHZ1UQ=="); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("ApiKey", "b1VSTjNva0J1TEFPdkJiaTJPQ186aklvdHd0c1hUT1dkbkFBTEU4M1NtQQ==");
HttpContent content = new StringContent(jsonData, Encoding.UTF8, "application/json"); HttpContent content = new StringContent(jsonData, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync(elasticUrl, content); HttpResponseMessage response = await client.PostAsync(elasticUrl, content);
......
...@@ -159,7 +159,7 @@ RectTransform: ...@@ -159,7 +159,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0} m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 350} m_AnchoredPosition: {x: 0, y: 400}
m_SizeDelta: {x: 300, y: 100} m_SizeDelta: {x: 300, y: 100}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &155577949 --- !u!114 &155577949
...@@ -402,6 +402,7 @@ MonoBehaviour: ...@@ -402,6 +402,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 968b2832dfc4bd546b9aee0fed2fd7da, type: 3} m_Script: {fileID: 11500000, guid: 968b2832dfc4bd546b9aee0fed2fd7da, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
message: {fileID: 549949877}
--- !u!1 &519420028 --- !u!1 &519420028
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -677,7 +678,7 @@ RectTransform: ...@@ -677,7 +678,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 150}
m_SizeDelta: {x: 150, y: 150} m_SizeDelta: {x: 150, y: 150}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1080356727 --- !u!114 &1080356727
...@@ -1011,7 +1012,7 @@ RectTransform: ...@@ -1011,7 +1012,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 300, y: 0} m_AnchoredPosition: {x: 300, y: 150}
m_SizeDelta: {x: 150, y: 150} m_SizeDelta: {x: 150, y: 150}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1858032155 --- !u!114 &1858032155
......
version: '3.3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.9.0
container_name: elasticsearch
restart: always
environment:
- xpack.security.enabled=false
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
cap_add:
- IPC_LOCK
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
ports:
- 9200:9200
kibana:
container_name: kibana
image: docker.elastic.co/kibana/kibana:8.9.0
restart: always
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200 # address of elasticsearch docker container which kibana will connect
ports:
- 5601:5601
depends_on:
- elasticsearch # kibana will start when elasticsearch has started
volumes:
elasticsearch-data:
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment