Out with MagicOnion, in with LiteNetLib
Removed MagicOnion Added LiteNetLib Created client and server abstractions Fixed serialization bugs
This commit is contained in:
parent
433a7b4ae4
commit
e96146b7bb
869 changed files with 59401 additions and 16812 deletions
45
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/Poco.cs
Normal file
45
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/Poco.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using Newtonsoft.Json.Linq;
|
||||
using RethinkDb.Driver.Net;
|
||||
using RethinkDb.Driver.Proto;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
internal class Poco : ReqlExpr
|
||||
{
|
||||
private readonly object obj;
|
||||
|
||||
public Poco(object obj) : base(new TermType(), null, null)
|
||||
{
|
||||
this.obj = obj;
|
||||
}
|
||||
|
||||
|
||||
internal class PocoWriter : JTokenWriter
|
||||
{
|
||||
public override void WriteStartArray()
|
||||
{
|
||||
base.WriteStartArray();
|
||||
this.WriteValue(Proto.TermType.MAKE_ARRAY);
|
||||
base.WriteStartArray();
|
||||
}
|
||||
|
||||
public override void WriteEndArray()
|
||||
{
|
||||
base.WriteEndArray();
|
||||
base.WriteEndArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected internal override object Build()
|
||||
{
|
||||
JToken token;
|
||||
using( var writer = new PocoWriter() )
|
||||
{
|
||||
Converter.Serializer.Serialize(writer, this.obj);
|
||||
token = writer.Token;
|
||||
}
|
||||
return token;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue