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:
@@ -0,0 +1,16 @@
|
||||
using System.IO;
|
||||
|
||||
namespace ET.Server
|
||||
{
|
||||
// 知道对方的Id,使用这个类发actor消息
|
||||
[ChildOf(typeof(ActorLocationSenderOneType))]
|
||||
public class ActorLocationSender: Entity, IAwake, IDestroy
|
||||
{
|
||||
public ActorId ActorId;
|
||||
|
||||
// 最近接收或者发送消息的时间
|
||||
public long LastSendOrRecvTime;
|
||||
|
||||
public int Error;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f63a22fae23df55448bebaaa447e1bad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ET.Server
|
||||
{
|
||||
|
||||
[ChildOf(typeof(ActorLocationSenderComponent))]
|
||||
public class ActorLocationSenderOneType: Entity, IAwake<int>, IDestroy
|
||||
{
|
||||
public const long TIMEOUT_TIME = 60 * 1000;
|
||||
|
||||
public long CheckTimer;
|
||||
|
||||
public int LocationType;
|
||||
}
|
||||
|
||||
|
||||
[ComponentOf(typeof(Scene))]
|
||||
public class ActorLocationSenderComponent: Entity, IAwake
|
||||
{
|
||||
public const long TIMEOUT_TIME = 60 * 1000;
|
||||
|
||||
public long CheckTimer;
|
||||
|
||||
public ActorLocationSenderOneType[] ActorLocationSenderComponents = new ActorLocationSenderOneType[LocationType.Max];
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe4c532cd914d4ad498b494298be81b6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ET.Server
|
||||
{
|
||||
[UniqueId(0, 100)]
|
||||
public static class LocationType
|
||||
{
|
||||
public const int Unit = 0;
|
||||
public const int Player = 1;
|
||||
public const int Friend = 2;
|
||||
public const int Chat = 3;
|
||||
public const int GateSession = 4;
|
||||
public const int Max = 100;
|
||||
}
|
||||
|
||||
[ChildOf(typeof(LocationOneType))]
|
||||
public class LockInfo: Entity, IAwake<ActorId, CoroutineLock>, IDestroy
|
||||
{
|
||||
public ActorId LockActorId;
|
||||
|
||||
public CoroutineLock CoroutineLock
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
[ChildOf(typeof(LocationManagerComoponent))]
|
||||
public class LocationOneType: Entity, IAwake<int>
|
||||
{
|
||||
public int LocationType;
|
||||
|
||||
public readonly Dictionary<long, ActorId> locations = new();
|
||||
|
||||
public readonly Dictionary<long, LockInfo> lockInfos = new();
|
||||
}
|
||||
|
||||
[ComponentOf(typeof(Scene))]
|
||||
public class LocationManagerComoponent: Entity, IAwake
|
||||
{
|
||||
public LocationOneType[] LocationOneTypes = new LocationOneType[LocationType.Max];
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15d2e4888958d964399187bc1a29f0ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace ET.Server
|
||||
{
|
||||
[ComponentOf(typeof(Scene))]
|
||||
public class LocationProxyComponent: Entity, IAwake
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33a386a4a4fc3a1428c59a2e07be246c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user