-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update unitypackages at samples/Unity
- Loading branch information
Showing
47 changed files
with
212 additions
and
164 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
samples/Unity/Program.Client/Assets/Scripts/Unity.Domain.ProtobufSerializer.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
samples/Unity/Program.Client/Assets/Scripts/Unity.Domain.Unity3D.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
samples/Unity/Program.Client/Assets/UnityPackages/AkkaInterfaced.unitypackage.json
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"Id": "AkkaInterfaced", | ||
"Version": "0.2.1", | ||
"Version": "0.3.1", | ||
"Authors": [ | ||
"Esun Kim" | ||
], | ||
|
Binary file modified
BIN
+3 KB
(160%)
samples/Unity/Program.Client/Assets/UnityPackages/AkkaInterfaced/Akka.Interfaced-Base.dll
Binary file not shown.
Binary file modified
BIN
+1.14 KB
(310%)
...les/Unity/Program.Client/Assets/UnityPackages/AkkaInterfaced/Akka.Interfaced-Base.dll.mdb
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...s/Unity/Program.Client/Assets/UnityPackages/AkkaInterfaced/Akka.Interfaced-SlimClient.dll
Binary file not shown.
Binary file modified
BIN
+380 Bytes
(160%)
...ity/Program.Client/Assets/UnityPackages/AkkaInterfaced/Akka.Interfaced-SlimClient.dll.mdb
Binary file not shown.
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
Binary file modified
BIN
+2.5 KB
(120%)
....Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/Akka.Interfaced.SlimSocket.Base.dll
Binary file not shown.
Binary file modified
BIN
+621 Bytes
(120%)
...ent/Assets/UnityPackages/AkkaInterfacedSlimSocket/Akka.Interfaced.SlimSocket.Base.dll.mdb
Binary file not shown.
Binary file modified
BIN
+1.5 KB
(110%)
...lient/Assets/UnityPackages/AkkaInterfacedSlimSocket/Akka.Interfaced.SlimSocket.Client.dll
Binary file not shown.
Binary file modified
BIN
+165 Bytes
(100%)
...t/Assets/UnityPackages/AkkaInterfacedSlimSocket/Akka.Interfaced.SlimSocket.Client.dll.mdb
Binary file not shown.
39 changes: 39 additions & 0 deletions
39
.../Unity/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/CommunicatorHelper.cs
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,39 @@ | ||
using System; | ||
using System.Net; | ||
using Akka.Interfaced.SlimSocket.Base; | ||
using Common.Logging; | ||
using ProtoBuf.Meta; | ||
using TypeAlias; | ||
|
||
namespace Akka.Interfaced.SlimSocket.Client | ||
{ | ||
public static class CommunicatorHelper | ||
{ | ||
public static PacketSerializer CreatePacketSerializer<TTypeModel>() | ||
where TTypeModel : TypeModel, new() | ||
{ | ||
return new PacketSerializer( | ||
new PacketSerializerBase.Data( | ||
new ProtoBufMessageSerializer(new TTypeModel()), | ||
new TypeAliasTable())); | ||
} | ||
|
||
public static Communicator CreateCommunicator<TTypeModel>(ILog logger, IPEndPoint remoteEndPoint) | ||
where TTypeModel : TypeModel, new() | ||
{ | ||
var serializer = CreatePacketSerializer<TTypeModel>(); | ||
return CreateCommunicator(logger, remoteEndPoint, _ => new TcpConnection(serializer, logger)); | ||
} | ||
|
||
public static Communicator CreateCommunicator( | ||
ILog logger, IPEndPoint remoteEndPoint, Func<Communicator, TcpConnection> connectionFactory) | ||
{ | ||
CommunicatorWorker.TryInit(); | ||
|
||
var comm = new Communicator(logger, remoteEndPoint, connectionFactory); | ||
comm.TaskFactory = new SlimTaskFactory { Owner = CommunicatorWorker.Instance }; | ||
comm.ObserverEventPoster = c => CommunicatorWorker.Post(c, null); | ||
return comm; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...y/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/CommunicatorHelper.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
76 changes: 76 additions & 0 deletions
76
.../Unity/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/CommunicatorWorker.cs
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,76 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using UnityEngine; | ||
|
||
namespace Akka.Interfaced.SlimSocket.Client | ||
{ | ||
public class CommunicatorWorker : MonoBehaviour | ||
{ | ||
private static CommunicatorWorker s_instance; | ||
private static bool s_instanceExists; | ||
|
||
private static readonly List<Tuple<SendOrPostCallback, object>> s_posts = | ||
new List<Tuple<SendOrPostCallback, object>>(); | ||
|
||
public static CommunicatorWorker Instance | ||
{ | ||
get { return s_instance; } | ||
} | ||
|
||
public static bool TryInit() | ||
{ | ||
if (s_instanceExists) | ||
return false; | ||
|
||
s_instanceExists = true; | ||
|
||
var go = new GameObject("_CommunicatorWorker"); | ||
s_instance = go.AddComponent<CommunicatorWorker>(); | ||
DontDestroyOnLoad(go); | ||
return true; | ||
} | ||
|
||
public static void Post(SendOrPostCallback callback, object state) | ||
{ | ||
lock (s_posts) | ||
{ | ||
s_posts.Add(Tuple.Create(callback, state)); | ||
} | ||
} | ||
|
||
private void Awake() | ||
{ | ||
if (s_instance) | ||
{ | ||
DestroyImmediate(this); | ||
} | ||
else | ||
{ | ||
s_instance = this; | ||
s_instanceExists = true; | ||
} | ||
} | ||
|
||
private void OnDestroy() | ||
{ | ||
if (s_instance == this) | ||
{ | ||
s_instance = null; | ||
s_instanceExists = false; | ||
} | ||
} | ||
|
||
private void Update() | ||
{ | ||
lock (s_posts) | ||
{ | ||
foreach (var post in s_posts) | ||
{ | ||
post.Item1(post.Item2); | ||
} | ||
s_posts.Clear(); | ||
} | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...y/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/CommunicatorWorker.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
...s/Unity/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/SlimRequestWaiter.cs
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
...ty/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/SlimRequestWaiter.cs.meta
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
samples/Unity/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/SlimTask.cs.meta
This file was deleted.
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
4 changes: 4 additions & 0 deletions
4
...ram.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/SlimTaskCompletionSource.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
...les/Unity/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/SlimTaskFactory.cs
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,14 @@ | ||
using UnityEngine; | ||
|
||
namespace Akka.Interfaced.SlimSocket.Client | ||
{ | ||
public class SlimTaskFactory : ISlimTaskFactory | ||
{ | ||
internal MonoBehaviour Owner { get; set; } | ||
|
||
public ISlimTaskCompletionSource<TResult> Create<TResult>() | ||
{ | ||
return new SlimTaskCompletionSource<TResult> { Owner = Owner }; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...nity/Program.Client/Assets/UnityPackages/AkkaInterfacedSlimSocket/SlimTaskFactory.cs.meta
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
Binary file modified
BIN
+0 Bytes
(100%)
samples/Unity/Program.Client/Assets/UnityPackages/EntityNetwork/EntityNetwork.Unity3D.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...les/Unity/Program.Client/Assets/UnityPackages/EntityNetwork/EntityNetwork.Unity3D.dll.mdb
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
samples/Unity/Program.Client/Assets/UnityPackages/EntityNetwork/EntityNetwork.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
samples/Unity/Program.Client/Assets/UnityPackages/EntityNetwork/EntityNetwork.dll.mdb
Binary file not shown.
Oops, something went wrong.