Skip to content

Commit

Permalink
hi
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffo99 committed Dec 10, 2019
1 parent e2f11b2 commit 835d968
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
7 changes: 5 additions & 2 deletions Assets/Scripts/Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class Network : MonoBehaviour
public string url = "https://ryg.steffo.eu/api/kei";
public string kpid;
public string convid;
public string previous = "";

private Sender sender;

Expand All @@ -31,7 +32,7 @@ void Start() {
kpid = System.Guid.NewGuid().ToString();
PlayerPrefs.SetString("kpid", kpid);
}
convid = kpid = System.Guid.NewGuid().ToString();
convid = System.Guid.NewGuid().ToString();
StartCoroutine(PostRequest("", "true"));
}

Expand All @@ -41,6 +42,7 @@ public IEnumerator PostRequest(string message, string first) {
form.AddField("convid", convid);
form.AddField("message", message);
form.AddField("first", first);
form.AddField("previous", previous);

UnityWebRequest request = UnityWebRequest.Post(url, form);
yield return request.SendWebRequest();
Expand All @@ -51,9 +53,10 @@ public IEnumerator PostRequest(string message, string first) {
else {
try {
KeiResponse kr = JsonUtility.FromJson<KeiResponse>(request.downloadHandler.text);
previous = kr.text;
sender.Change(kr.text, kr.emotion);
}
catch (System.ArgumentException e) {
catch (System.ArgumentException) {
Debug.LogError(request.downloadHandler.text);
}
}
Expand Down
1 change: 0 additions & 1 deletion ProjectSettings/GraphicsSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ GraphicsSettings:
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 23.12
bundleVersion: 23.12.2
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down
Binary file modified docs/Build/94e2762c7bb08db76417ef58499f5625.unityweb
Binary file not shown.
9 changes: 7 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | Kei</title>
<style>
body {
background-color: black;
}
</style>
<title>Kei</title>
<script src="Build/9b952195ab79ef94f0feaae8cbb8d8ac.js"></script>
<script>
UnityLoader.instantiate("unityContainer", "Build/09d4f44b8e4f8af02a070032f8a71d94.json");
UnityLoader.instantiate("unityContainer", "Build/8bc04d0c5fddea9b7f70edca255942d1.json");
</script>
</head>
<body>
Expand Down

0 comments on commit 835d968

Please sign in to comment.