mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
30
Assets/GameScripts/DotNet/Core/Object/DisposeObject.cs
Normal file
30
Assets/GameScripts/DotNet/Core/Object/DisposeObject.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public abstract class DisposeObject: Object, IDisposable, ISupportInitialize
|
||||
{
|
||||
public virtual void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void BeginInit()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void EndInit()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public interface IPool
|
||||
{
|
||||
bool IsFromPool
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/GameScripts/DotNet/Core/Object/DisposeObject.cs.meta
Normal file
11
Assets/GameScripts/DotNet/Core/Object/DisposeObject.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca28b9e6da52d7a4488b584e6ce3c685
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
16
Assets/GameScripts/DotNet/Core/Object/MessageObject.cs
Normal file
16
Assets/GameScripts/DotNet/Core/Object/MessageObject.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public abstract class MessageObject: ProtoObject, IMessage, IDisposable
|
||||
{
|
||||
public virtual void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
[BsonIgnore]
|
||||
public bool IsFromPool { get; set; }
|
||||
}
|
||||
}
|
11
Assets/GameScripts/DotNet/Core/Object/MessageObject.cs.meta
Normal file
11
Assets/GameScripts/DotNet/Core/Object/MessageObject.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a2882ec78c6c471e8e74005e51f985f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
20
Assets/GameScripts/DotNet/Core/Object/Object.cs
Normal file
20
Assets/GameScripts/DotNet/Core/Object/Object.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace ET
|
||||
{
|
||||
public abstract class Object
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return MongoHelper.ToJson(this);
|
||||
}
|
||||
|
||||
public string ToJson()
|
||||
{
|
||||
return MongoHelper.ToJson(this);
|
||||
}
|
||||
|
||||
public byte[] ToBson()
|
||||
{
|
||||
return MongoHelper.Serialize(this);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/GameScripts/DotNet/Core/Object/Object.cs.meta
Normal file
11
Assets/GameScripts/DotNet/Core/Object/Object.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e034b37d85153fb438be07631a8b9816
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
23
Assets/GameScripts/DotNet/Core/Object/ProtoObject.cs
Normal file
23
Assets/GameScripts/DotNet/Core/Object/ProtoObject.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public abstract class ProtoObject: Object, ISupportInitialize
|
||||
{
|
||||
public object Clone()
|
||||
{
|
||||
byte[] bytes = MongoHelper.Serialize(this);
|
||||
return MongoHelper.Deserialize(this.GetType(), bytes, 0, bytes.Length);
|
||||
}
|
||||
|
||||
public virtual void BeginInit()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public virtual void EndInit()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/GameScripts/DotNet/Core/Object/ProtoObject.cs.meta
Normal file
11
Assets/GameScripts/DotNet/Core/Object/ProtoObject.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90d2aa9a80bc74140bc36eef78a1a34e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user