Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
JWT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kis_intern1
JWT
Commits
64836641
Commit
64836641
authored
Aug 10, 2023
by
nk161690
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docker
parent
5fce792b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
31 deletions
+43
-31
UnityProject/Assets/GoogleLogin.cs
UnityProject/Assets/GoogleLogin.cs
+6
-25
UnityProject/Assets/Log.cs
UnityProject/Assets/Log.cs
+2
-3
UnityProject/Assets/Scenes/SampleScene.unity
UnityProject/Assets/Scenes/SampleScene.unity
+4
-3
elasticsearch/docker-compose.yml
elasticsearch/docker-compose.yml
+31
-0
No files found.
UnityProject/Assets/GoogleLogin.cs
View file @
64836641
using
GooglePlayGames
;
using
GooglePlayGames.BasicApi
;
using
Photon.Pun
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
GoogleLogin
:
MonoBehaviour
{
private
Log
.
LoginSession
session
=
new
Log
.
LoginSession
();
private
bool
isQuitting
=
false
;
public
void
OnGoogleLoginButtonClicked
()
{
...
...
@@ -25,11 +21,13 @@ public class GoogleLogin : MonoBehaviour
{
Debug
.
Log
(
"Signed in with Google Play successfully."
);
UserSessionManager
.
LogIn
(
Social
.
localUser
.
userName
);
string
googlePlayGamesID
=
Social
.
localUser
.
id
;
PhotonNetwork
.
NickName
=
googlePlayGamesID
;
UserSessionManager
.
LogIn
(
Social
.
localUser
.
id
);
//AuthenticationValues authValues = new AuthenticationValues();
//authValues.AuthType = CustomAuthenticationType.Custom;
//authValues.AddAuthParameter("user", Social.localUser.userName);
//authValues.UserId = Social.localUser.id;
//PhotonNetwork.AuthValues = authValues;
PhotonNetwork
.
ConnectUsingSettings
();
}
else
if
(
success
==
SignInStatus
.
InternalError
)
...
...
@@ -41,21 +39,4 @@ public class GoogleLogin : MonoBehaviour
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
);
}
}
}
}
}
UnityProject/Assets/Log.cs
View file @
64836641
...
...
@@ -21,13 +21,12 @@ public static class Log
string
jsonData
=
JsonConvert
.
SerializeObject
(
session
);
// Send the data to Elasticsearch using HTTP POST request
string
elasticUrl
=
"https://893485fbcebc4a4d9102091b2bad74a4.us-central1.gcp.cloud.es.io:443/login_sessions/_doc"
+
"?pipeline=ent-search-generic-ingestion"
;
string
elasticUrl
=
"https://893485fbcebc4a4d9102091b2bad74a4.us-central1.gcp.cloud.es.io:443/login_sessions/_doc?pipeline=ent-search-generic-ingestion"
;
using
(
HttpClient
client
=
new
HttpClient
())
{
var
contentType
=
new
MediaTypeWithQualityHeaderValue
(
"application/json"
);
client
.
DefaultRequestHeaders
.
Accept
.
Add
(
contentType
);
client
.
DefaultRequestHeaders
.
Authorization
=
new
AuthenticationHeaderValue
(
"ApiKey"
,
"
MUdvM3NJa0I3bFF0X01wcFZWY2s6MzU4WllreVJRSldfZEhWSTVPbHZ1U
Q=="
);
client
.
DefaultRequestHeaders
.
Authorization
=
new
AuthenticationHeaderValue
(
"ApiKey"
,
"
b1VSTjNva0J1TEFPdkJiaTJPQ186aklvdHd0c1hUT1dkbkFBTEU4M1NtQ
Q=="
);
HttpContent
content
=
new
StringContent
(
jsonData
,
Encoding
.
UTF8
,
"application/json"
);
HttpResponseMessage
response
=
await
client
.
PostAsync
(
elasticUrl
,
content
);
...
...
UnityProject/Assets/Scenes/SampleScene.unity
View file @
64836641
...
...
@@ -159,7 +159,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
0
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
35
0
}
m_AnchoredPosition
:
{
x
:
0
,
y
:
40
0
}
m_SizeDelta
:
{
x
:
300
,
y
:
100
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&155577949
...
...
@@ -402,6 +402,7 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
968b2832dfc4bd546b9aee0fed2fd7da
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
message
:
{
fileID
:
549949877
}
---
!u!1
&519420028
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -677,7 +678,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
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
:
15
0
}
m_SizeDelta
:
{
x
:
150
,
y
:
150
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&1080356727
...
...
@@ -1011,7 +1012,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
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
:
15
0
}
m_SizeDelta
:
{
x
:
150
,
y
:
150
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!114
&1858032155
...
...
elasticsearch/docker-compose.yml
0 → 100644
View file @
64836641
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment