-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
439 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/*.jslib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
using System.Text; | ||
using System.Net; | ||
using System.Net.Sockets; | ||
using System.Threading; | ||
|
||
using AssemblyCSharp; | ||
|
||
namespace AssemblyCSharp | ||
{ | ||
[Serializable] | ||
public abstract class Message | ||
{ | ||
public string type; | ||
|
||
public Message() { | ||
type = this.GetType().Name; | ||
} | ||
|
||
public string Serialize() { | ||
return JsonUtility.ToJson (this); | ||
} | ||
|
||
public override string ToString() { | ||
return Serialize (); | ||
} | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
using System.Text; | ||
using System.Net; | ||
using System.Net.Sockets; | ||
using System.Threading; | ||
|
||
using AssemblyCSharp; | ||
|
||
namespace AssemblyCSharp | ||
{ | ||
public class MessageParser | ||
{ | ||
private class TypeMessage : Message { | ||
|
||
} | ||
|
||
public Message Parse(string str) { | ||
var typeMessage = JsonUtility.FromJson<TypeMessage> (str); | ||
switch (typeMessage.type) { | ||
case "ClientGameStateMessage": | ||
return JsonUtility.FromJson<ClientGameStateMessage> (str); | ||
case "ClientHelloMessage": | ||
return JsonUtility.FromJson<ClientHelloMessage> (str); | ||
case "ServerGameStateMessage": | ||
return JsonUtility.FromJson<ServerGameStateMessage> (str); | ||
case "ServerToClientHelloMessage": | ||
return JsonUtility.FromJson<ServerToClientHelloMessage> (str); | ||
case "ServerToClientStartMessage": | ||
return JsonUtility.FromJson<ServerToClientStartMessage> (str); | ||
default: | ||
Debug.LogError ("Unknown message type!"); | ||
return null; | ||
} | ||
} | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.