mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] TEngineServer
[+] TEngineServer
This commit is contained in:
1435
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/CompilerContext.cs
vendored
Normal file
1435
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/CompilerContext.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
11
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/CompilerContext.cs.meta
vendored
Normal file
11
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/CompilerContext.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a58d20a1d8c7730499ef29a11532d07e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
7
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/CompilerDelegates.cs
vendored
Normal file
7
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/CompilerDelegates.cs
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#if FEAT_COMPILER
|
||||
namespace ProtoBuf.Compiler
|
||||
{
|
||||
internal delegate void ProtoSerializer(object value, ProtoWriter dest);
|
||||
internal delegate object ProtoDeserializer(object value, ProtoReader source);
|
||||
}
|
||||
#endif
|
11
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/CompilerDelegates.cs.meta
vendored
Normal file
11
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/CompilerDelegates.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b923d7ab8e95f740b059ca797596261
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
58
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/Local.cs
vendored
Normal file
58
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/Local.cs
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
#if FEAT_COMPILER
|
||||
using System;
|
||||
using System.Reflection.Emit;
|
||||
|
||||
namespace ProtoBuf.Compiler
|
||||
{
|
||||
internal sealed class Local : IDisposable
|
||||
{
|
||||
// public static readonly Local InputValue = new Local(null, null);
|
||||
private LocalBuilder value;
|
||||
private readonly Type type;
|
||||
private CompilerContext ctx;
|
||||
|
||||
private Local(LocalBuilder value, Type type)
|
||||
{
|
||||
this.value = value;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
internal Local(CompilerContext ctx, Type type)
|
||||
{
|
||||
this.ctx = ctx;
|
||||
if (ctx != null) { value = ctx.GetFromPool(type); }
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
internal LocalBuilder Value => value ?? throw new ObjectDisposedException(GetType().Name);
|
||||
|
||||
public Type Type => type;
|
||||
|
||||
public Local AsCopy()
|
||||
{
|
||||
if (ctx == null) return this; // can re-use if context-free
|
||||
return new Local(value, this.type);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (ctx != null)
|
||||
{
|
||||
// only *actually* dispose if this is context-bound; note that non-bound
|
||||
// objects are cheekily re-used, and *must* be left intact agter a "using" etc
|
||||
ctx.ReleaseToPool(value);
|
||||
value = null;
|
||||
ctx = null;
|
||||
}
|
||||
}
|
||||
|
||||
internal bool IsSame(Local other)
|
||||
{
|
||||
if((object)this == (object)other) return true;
|
||||
|
||||
object ourVal = value; // use prop to ensure obj-disposed etc
|
||||
return other != null && ourVal == (object)(other.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
11
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/Local.cs.meta
vendored
Normal file
11
Assets/GameScripts/ThirdParty/Protobuf-net/Compiler/Local.cs.meta
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07d12d9a9b7d45b498e28b7c39bdca01
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user