[+] 接入ET8服务端

[+] 接入ET8服务端
This commit is contained in:
ALEXTANG
2023-07-13 12:23:48 +08:00
parent e0be062006
commit 336d4b2eb9
1316 changed files with 130657 additions and 626 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 027f4382299e1a7499130098fd865aa1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace ET
{
[Config]
public partial class AIConfigCategory : ConfigSingleton<AIConfigCategory>, IMerge
{
[BsonElement]
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
private Dictionary<int, AIConfig> dict = new Dictionary<int, AIConfig>();
public void Merge(object o)
{
AIConfigCategory s = o as AIConfigCategory;
foreach (var kv in s.dict)
{
this.dict.Add(kv.Key, kv.Value);
}
}
public AIConfig Get(int id)
{
this.dict.TryGetValue(id, out AIConfig item);
if (item == null)
{
throw new Exception($"配置找不到,配置表名: {nameof (AIConfig)}配置id: {id}");
}
return item;
}
public bool Contain(int id)
{
return this.dict.ContainsKey(id);
}
public Dictionary<int, AIConfig> GetAll()
{
return this.dict;
}
public AIConfig GetOne()
{
if (this.dict == null || this.dict.Count <= 0)
{
return null;
}
return this.dict.Values.GetEnumerator().Current;
}
}
public partial class AIConfig: ProtoObject, IConfig
{
/// <summary>Id</summary>
public int Id { get; set; }
/// <summary>所属ai</summary>
public int AIConfigId { get; set; }
/// <summary>此ai中的顺序</summary>
public int Order { get; set; }
/// <summary>节点名字</summary>
public string Name { get; set; }
/// <summary>节点参数</summary>
public int[] NodeParams { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d630eb5b27169034c960192b72954e6b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace ET
{
[Config]
public partial class StartMachineConfigCategory : ConfigSingleton<StartMachineConfigCategory>, IMerge
{
[BsonElement]
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
private Dictionary<int, StartMachineConfig> dict = new Dictionary<int, StartMachineConfig>();
public void Merge(object o)
{
StartMachineConfigCategory s = o as StartMachineConfigCategory;
foreach (var kv in s.dict)
{
this.dict.Add(kv.Key, kv.Value);
}
}
public StartMachineConfig Get(int id)
{
this.dict.TryGetValue(id, out StartMachineConfig item);
if (item == null)
{
throw new Exception($"配置找不到,配置表名: {nameof (StartMachineConfig)}配置id: {id}");
}
return item;
}
public bool Contain(int id)
{
return this.dict.ContainsKey(id);
}
public Dictionary<int, StartMachineConfig> GetAll()
{
return this.dict;
}
public StartMachineConfig GetOne()
{
if (this.dict == null || this.dict.Count <= 0)
{
return null;
}
return this.dict.Values.GetEnumerator().Current;
}
}
public partial class StartMachineConfig: ProtoObject, IConfig
{
/// <summary>Id</summary>
public int Id { get; set; }
/// <summary>内网地址</summary>
public string InnerIP { get; set; }
/// <summary>外网地址</summary>
public string OuterIP { get; set; }
/// <summary>守护进程端口</summary>
public string WatcherPort { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 494fbdb8b84798344b40e09cf5e85ba6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace ET
{
[Config]
public partial class StartProcessConfigCategory : ConfigSingleton<StartProcessConfigCategory>, IMerge
{
[BsonElement]
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
private Dictionary<int, StartProcessConfig> dict = new Dictionary<int, StartProcessConfig>();
public void Merge(object o)
{
StartProcessConfigCategory s = o as StartProcessConfigCategory;
foreach (var kv in s.dict)
{
this.dict.Add(kv.Key, kv.Value);
}
}
public StartProcessConfig Get(int id)
{
this.dict.TryGetValue(id, out StartProcessConfig item);
if (item == null)
{
throw new Exception($"配置找不到,配置表名: {nameof (StartProcessConfig)}配置id: {id}");
}
return item;
}
public bool Contain(int id)
{
return this.dict.ContainsKey(id);
}
public Dictionary<int, StartProcessConfig> GetAll()
{
return this.dict;
}
public StartProcessConfig GetOne()
{
if (this.dict == null || this.dict.Count <= 0)
{
return null;
}
return this.dict.Values.GetEnumerator().Current;
}
}
public partial class StartProcessConfig: ProtoObject, IConfig
{
/// <summary>Id</summary>
public int Id { get; set; }
/// <summary>所属机器</summary>
public int MachineId { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 85b6d198d898a3e4cac5731a559ccdab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace ET
{
[Config]
public partial class StartSceneConfigCategory : ConfigSingleton<StartSceneConfigCategory>, IMerge
{
[BsonElement]
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
private Dictionary<int, StartSceneConfig> dict = new Dictionary<int, StartSceneConfig>();
public void Merge(object o)
{
StartSceneConfigCategory s = o as StartSceneConfigCategory;
foreach (var kv in s.dict)
{
this.dict.Add(kv.Key, kv.Value);
}
}
public StartSceneConfig Get(int id)
{
this.dict.TryGetValue(id, out StartSceneConfig item);
if (item == null)
{
throw new Exception($"配置找不到,配置表名: {nameof (StartSceneConfig)}配置id: {id}");
}
return item;
}
public bool Contain(int id)
{
return this.dict.ContainsKey(id);
}
public Dictionary<int, StartSceneConfig> GetAll()
{
return this.dict;
}
public StartSceneConfig GetOne()
{
if (this.dict == null || this.dict.Count <= 0)
{
return null;
}
return this.dict.Values.GetEnumerator().Current;
}
}
public partial class StartSceneConfig: ProtoObject, IConfig
{
/// <summary>Id</summary>
public int Id { get; set; }
/// <summary>所属进程</summary>
public int Process { get; set; }
/// <summary>所属区</summary>
public int Zone { get; set; }
/// <summary>类型</summary>
public string SceneType { get; set; }
/// <summary>名字</summary>
public string Name { get; set; }
/// <summary>外网端口</summary>
public int Port { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8dafae098a596734889a32e7c3785118
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace ET
{
[Config]
public partial class StartZoneConfigCategory : ConfigSingleton<StartZoneConfigCategory>, IMerge
{
[BsonElement]
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
private Dictionary<int, StartZoneConfig> dict = new Dictionary<int, StartZoneConfig>();
public void Merge(object o)
{
StartZoneConfigCategory s = o as StartZoneConfigCategory;
foreach (var kv in s.dict)
{
this.dict.Add(kv.Key, kv.Value);
}
}
public StartZoneConfig Get(int id)
{
this.dict.TryGetValue(id, out StartZoneConfig item);
if (item == null)
{
throw new Exception($"配置找不到,配置表名: {nameof (StartZoneConfig)}配置id: {id}");
}
return item;
}
public bool Contain(int id)
{
return this.dict.ContainsKey(id);
}
public Dictionary<int, StartZoneConfig> GetAll()
{
return this.dict;
}
public StartZoneConfig GetOne()
{
if (this.dict == null || this.dict.Count <= 0)
{
return null;
}
return this.dict.Values.GetEnumerator().Current;
}
}
public partial class StartZoneConfig: ProtoObject, IConfig
{
/// <summary>Id</summary>
public int Id { get; set; }
/// <summary>数据库地址</summary>
public string DBConnection { get; set; }
/// <summary>数据库名</summary>
public string DBName { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b6b2c5008672ef8499364a33a5cf7e43
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace ET
{
[Config]
public partial class UnitConfigCategory : ConfigSingleton<UnitConfigCategory>, IMerge
{
[BsonElement]
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
private Dictionary<int, UnitConfig> dict = new Dictionary<int, UnitConfig>();
public void Merge(object o)
{
UnitConfigCategory s = o as UnitConfigCategory;
foreach (var kv in s.dict)
{
this.dict.Add(kv.Key, kv.Value);
}
}
public UnitConfig Get(int id)
{
this.dict.TryGetValue(id, out UnitConfig item);
if (item == null)
{
throw new Exception($"配置找不到,配置表名: {nameof (UnitConfig)}配置id: {id}");
}
return item;
}
public bool Contain(int id)
{
return this.dict.ContainsKey(id);
}
public Dictionary<int, UnitConfig> GetAll()
{
return this.dict;
}
public UnitConfig GetOne()
{
if (this.dict == null || this.dict.Count <= 0)
{
return null;
}
return this.dict.Values.GetEnumerator().Current;
}
}
public partial class UnitConfig: ProtoObject, IConfig
{
/// <summary>Id</summary>
public int Id { get; set; }
/// <summary>Type</summary>
public int Type { get; set; }
/// <summary>名字</summary>
public string Name { get; set; }
/// <summary>位置</summary>
public int Position { get; set; }
/// <summary>身高</summary>
public int Height { get; set; }
/// <summary>体重</summary>
public int Weight { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d22b59afb6cead442811e7f8957781a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 390f281261413d847bd6ceb803f5c38a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,17 @@
using System.Net;
namespace ET
{
public partial class StartProcessConfig
{
public string InnerIP => this.StartMachineConfig.InnerIP;
public string OuterIP => this.StartMachineConfig.OuterIP;
public StartMachineConfig StartMachineConfig => StartMachineConfigCategory.Instance.Get(this.MachineId);
public override void EndInit()
{
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9685de03e39fb524baead6e580a0f4c0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,142 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Net;
namespace ET
{
public partial class StartSceneConfigCategory
{
public MultiMap<int, StartSceneConfig> Gates = new();
public MultiMap<int, StartSceneConfig> ProcessScenes = new();
public Dictionary<int, StartSceneConfig> NetInners = new();
public Dictionary<long, Dictionary<string, StartSceneConfig>> ClientScenesByName = new();
public StartSceneConfig LocationConfig;
public List<StartSceneConfig> Realms = new();
public List<StartSceneConfig> Routers = new();
public List<StartSceneConfig> Robots = new();
public List<StartSceneConfig> Maps = new();
public StartSceneConfig Match;
public List<StartSceneConfig> GetByProcess(int process)
{
return this.ProcessScenes[process];
}
public StartSceneConfig GetBySceneName(int zone, string name)
{
return this.ClientScenesByName[zone][name];
}
public override void EndInit()
{
foreach (StartSceneConfig startSceneConfig in this.GetAll().Values)
{
this.ProcessScenes.Add(startSceneConfig.Process, startSceneConfig);
if (!this.ClientScenesByName.ContainsKey(startSceneConfig.Zone))
{
this.ClientScenesByName.Add(startSceneConfig.Zone, new Dictionary<string, StartSceneConfig>());
}
this.ClientScenesByName[startSceneConfig.Zone].Add(startSceneConfig.Name, startSceneConfig);
switch (startSceneConfig.Type)
{
case SceneType.NetInner:
this.NetInners.Add(startSceneConfig.Process, startSceneConfig);
break;
case SceneType.Realm:
this.Realms.Add(startSceneConfig);
break;
case SceneType.Gate:
this.Gates.Add(startSceneConfig.Zone, startSceneConfig);
break;
case SceneType.Location:
this.LocationConfig = startSceneConfig;
break;
case SceneType.Robot:
this.Robots.Add(startSceneConfig);
break;
case SceneType.Router:
this.Routers.Add(startSceneConfig);
break;
case SceneType.Map:
this.Maps.Add(startSceneConfig);
break;
case SceneType.Match:
this.Match = startSceneConfig;
break;
}
}
}
}
public partial class StartSceneConfig: ISupportInitialize
{
public ActorId ActorId;
public SceneType Type;
public StartProcessConfig StartProcessConfig
{
get
{
return StartProcessConfigCategory.Instance.Get(this.Process);
}
}
public StartZoneConfig StartZoneConfig
{
get
{
return StartZoneConfigCategory.Instance.Get(this.Zone);
}
}
// 内网地址外网端口,通过防火墙映射端口过来
private IPEndPoint innerIPPort;
public IPEndPoint InnerIPPort
{
get
{
if (innerIPPort == null)
{
this.innerIPPort = NetworkHelper.ToIPEndPoint($"{this.StartProcessConfig.InnerIP}:{this.Port}");
}
return this.innerIPPort;
}
}
private IPEndPoint outerIPPort;
// 外网地址外网端口
public IPEndPoint OuterIPPort
{
get
{
if (this.outerIPPort == null)
{
this.outerIPPort = NetworkHelper.ToIPEndPoint($"{this.StartProcessConfig.OuterIP}:{this.Port}");
}
return this.outerIPPort;
}
}
public override void EndInit()
{
this.ActorId = new ActorId(this.Process, this.Id, 1);
this.Type = EnumHelper.FromString<SceneType>(this.SceneType);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 34e8a007b50be614b91a9f397091514c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 10f8fc000e4c48948a66c02e4b373a92
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,77 @@
using ET;
using MemoryPack;
using System.Collections.Generic;
namespace ET
{
// using
[ResponseType(nameof(NetClient2Main_Login))]
[Message(ClientMessage.Main2NetClient_Login)]
[MemoryPackable]
public partial class Main2NetClient_Login: MessageObject, IActorRequest
{
public static Main2NetClient_Login Create(bool isFromPool = true)
{
return !isFromPool? new Main2NetClient_Login() : ObjectPool.Instance.Fetch(typeof(Main2NetClient_Login)) as Main2NetClient_Login;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public string Account { get; set; }
[MemoryPackOrder(2)]
public string Password { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Account = default;
this.Password = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(ClientMessage.NetClient2Main_Login)]
[MemoryPackable]
public partial class NetClient2Main_Login: MessageObject, IActorResponse
{
public static NetClient2Main_Login Create(bool isFromPool = true)
{
return !isFromPool? new NetClient2Main_Login() : ObjectPool.Instance.Fetch(typeof(NetClient2Main_Login)) as NetClient2Main_Login;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
[MemoryPackOrder(3)]
public long PlayerId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
this.PlayerId = default;
ObjectPool.Instance.Recycle(this);
}
}
public static class ClientMessage
{
public const ushort Main2NetClient_Login = 1001;
public const ushort NetClient2Main_Login = 1002;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 92edc085102634d49b0441de1f600ce7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,758 @@
using ET;
using MemoryPack;
using System.Collections.Generic;
namespace ET
{
// using
[ResponseType(nameof(ObjectQueryResponse))]
[Message(InnerMessage.ObjectQueryRequest)]
[MemoryPackable]
public partial class ObjectQueryRequest: MessageObject, IActorRequest
{
public static ObjectQueryRequest Create(bool isFromPool = true)
{
return !isFromPool? new ObjectQueryRequest() : ObjectPool.Instance.Fetch(typeof(ObjectQueryRequest)) as ObjectQueryRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public long Key { get; set; }
[MemoryPackOrder(2)]
public long InstanceId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Key = default;
this.InstanceId = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(A2M_Reload))]
[Message(InnerMessage.M2A_Reload)]
[MemoryPackable]
public partial class M2A_Reload: MessageObject, IActorRequest
{
public static M2A_Reload Create(bool isFromPool = true)
{
return !isFromPool? new M2A_Reload() : ObjectPool.Instance.Fetch(typeof(M2A_Reload)) as M2A_Reload;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.A2M_Reload)]
[MemoryPackable]
public partial class A2M_Reload: MessageObject, IActorResponse
{
public static A2M_Reload Create(bool isFromPool = true)
{
return !isFromPool? new A2M_Reload() : ObjectPool.Instance.Fetch(typeof(A2M_Reload)) as A2M_Reload;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(G2G_LockResponse))]
[Message(InnerMessage.G2G_LockRequest)]
[MemoryPackable]
public partial class G2G_LockRequest: MessageObject, IActorRequest
{
public static G2G_LockRequest Create(bool isFromPool = true)
{
return !isFromPool? new G2G_LockRequest() : ObjectPool.Instance.Fetch(typeof(G2G_LockRequest)) as G2G_LockRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public long Id { get; set; }
[MemoryPackOrder(2)]
public string Address { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Id = default;
this.Address = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.G2G_LockResponse)]
[MemoryPackable]
public partial class G2G_LockResponse: MessageObject, IActorResponse
{
public static G2G_LockResponse Create(bool isFromPool = true)
{
return !isFromPool? new G2G_LockResponse() : ObjectPool.Instance.Fetch(typeof(G2G_LockResponse)) as G2G_LockResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(G2G_LockReleaseResponse))]
[Message(InnerMessage.G2G_LockReleaseRequest)]
[MemoryPackable]
public partial class G2G_LockReleaseRequest: MessageObject, IActorRequest
{
public static G2G_LockReleaseRequest Create(bool isFromPool = true)
{
return !isFromPool? new G2G_LockReleaseRequest() : ObjectPool.Instance.Fetch(typeof(G2G_LockReleaseRequest)) as G2G_LockReleaseRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public long Id { get; set; }
[MemoryPackOrder(2)]
public string Address { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Id = default;
this.Address = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.G2G_LockReleaseResponse)]
[MemoryPackable]
public partial class G2G_LockReleaseResponse: MessageObject, IActorResponse
{
public static G2G_LockReleaseResponse Create(bool isFromPool = true)
{
return !isFromPool? new G2G_LockReleaseResponse() : ObjectPool.Instance.Fetch(typeof(G2G_LockReleaseResponse)) as G2G_LockReleaseResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(ObjectAddResponse))]
[Message(InnerMessage.ObjectAddRequest)]
[MemoryPackable]
public partial class ObjectAddRequest: MessageObject, IActorRequest
{
public static ObjectAddRequest Create(bool isFromPool = true)
{
return !isFromPool? new ObjectAddRequest() : ObjectPool.Instance.Fetch(typeof(ObjectAddRequest)) as ObjectAddRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Type { get; set; }
[MemoryPackOrder(2)]
public long Key { get; set; }
[MemoryPackOrder(3)]
public ActorId ActorId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Type = default;
this.Key = default;
this.ActorId = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.ObjectAddResponse)]
[MemoryPackable]
public partial class ObjectAddResponse: MessageObject, IActorResponse
{
public static ObjectAddResponse Create(bool isFromPool = true)
{
return !isFromPool? new ObjectAddResponse() : ObjectPool.Instance.Fetch(typeof(ObjectAddResponse)) as ObjectAddResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(ObjectLockResponse))]
[Message(InnerMessage.ObjectLockRequest)]
[MemoryPackable]
public partial class ObjectLockRequest: MessageObject, IActorRequest
{
public static ObjectLockRequest Create(bool isFromPool = true)
{
return !isFromPool? new ObjectLockRequest() : ObjectPool.Instance.Fetch(typeof(ObjectLockRequest)) as ObjectLockRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Type { get; set; }
[MemoryPackOrder(2)]
public long Key { get; set; }
[MemoryPackOrder(3)]
public ActorId ActorId { get; set; }
[MemoryPackOrder(4)]
public int Time { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Type = default;
this.Key = default;
this.ActorId = default;
this.Time = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.ObjectLockResponse)]
[MemoryPackable]
public partial class ObjectLockResponse: MessageObject, IActorResponse
{
public static ObjectLockResponse Create(bool isFromPool = true)
{
return !isFromPool? new ObjectLockResponse() : ObjectPool.Instance.Fetch(typeof(ObjectLockResponse)) as ObjectLockResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(ObjectUnLockResponse))]
[Message(InnerMessage.ObjectUnLockRequest)]
[MemoryPackable]
public partial class ObjectUnLockRequest: MessageObject, IActorRequest
{
public static ObjectUnLockRequest Create(bool isFromPool = true)
{
return !isFromPool? new ObjectUnLockRequest() : ObjectPool.Instance.Fetch(typeof(ObjectUnLockRequest)) as ObjectUnLockRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Type { get; set; }
[MemoryPackOrder(2)]
public long Key { get; set; }
[MemoryPackOrder(3)]
public ActorId OldActorId { get; set; }
[MemoryPackOrder(4)]
public ActorId NewActorId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Type = default;
this.Key = default;
this.OldActorId = default;
this.NewActorId = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.ObjectUnLockResponse)]
[MemoryPackable]
public partial class ObjectUnLockResponse: MessageObject, IActorResponse
{
public static ObjectUnLockResponse Create(bool isFromPool = true)
{
return !isFromPool? new ObjectUnLockResponse() : ObjectPool.Instance.Fetch(typeof(ObjectUnLockResponse)) as ObjectUnLockResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(ObjectRemoveResponse))]
[Message(InnerMessage.ObjectRemoveRequest)]
[MemoryPackable]
public partial class ObjectRemoveRequest: MessageObject, IActorRequest
{
public static ObjectRemoveRequest Create(bool isFromPool = true)
{
return !isFromPool? new ObjectRemoveRequest() : ObjectPool.Instance.Fetch(typeof(ObjectRemoveRequest)) as ObjectRemoveRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Type { get; set; }
[MemoryPackOrder(2)]
public long Key { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Type = default;
this.Key = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.ObjectRemoveResponse)]
[MemoryPackable]
public partial class ObjectRemoveResponse: MessageObject, IActorResponse
{
public static ObjectRemoveResponse Create(bool isFromPool = true)
{
return !isFromPool? new ObjectRemoveResponse() : ObjectPool.Instance.Fetch(typeof(ObjectRemoveResponse)) as ObjectRemoveResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(ObjectGetResponse))]
[Message(InnerMessage.ObjectGetRequest)]
[MemoryPackable]
public partial class ObjectGetRequest: MessageObject, IActorRequest
{
public static ObjectGetRequest Create(bool isFromPool = true)
{
return !isFromPool? new ObjectGetRequest() : ObjectPool.Instance.Fetch(typeof(ObjectGetRequest)) as ObjectGetRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Type { get; set; }
[MemoryPackOrder(2)]
public long Key { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Type = default;
this.Key = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.ObjectGetResponse)]
[MemoryPackable]
public partial class ObjectGetResponse: MessageObject, IActorResponse
{
public static ObjectGetResponse Create(bool isFromPool = true)
{
return !isFromPool? new ObjectGetResponse() : ObjectPool.Instance.Fetch(typeof(ObjectGetResponse)) as ObjectGetResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
[MemoryPackOrder(3)]
public int Type { get; set; }
[MemoryPackOrder(4)]
public ActorId ActorId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
this.Type = default;
this.ActorId = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(G2R_GetLoginKey))]
[Message(InnerMessage.R2G_GetLoginKey)]
[MemoryPackable]
public partial class R2G_GetLoginKey: MessageObject, IActorRequest
{
public static R2G_GetLoginKey Create(bool isFromPool = true)
{
return !isFromPool? new R2G_GetLoginKey() : ObjectPool.Instance.Fetch(typeof(R2G_GetLoginKey)) as R2G_GetLoginKey;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public string Account { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Account = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.G2R_GetLoginKey)]
[MemoryPackable]
public partial class G2R_GetLoginKey: MessageObject, IActorResponse
{
public static G2R_GetLoginKey Create(bool isFromPool = true)
{
return !isFromPool? new G2R_GetLoginKey() : ObjectPool.Instance.Fetch(typeof(G2R_GetLoginKey)) as G2R_GetLoginKey;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
[MemoryPackOrder(3)]
public long Key { get; set; }
[MemoryPackOrder(4)]
public long GateId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
this.Key = default;
this.GateId = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.G2M_SessionDisconnect)]
[MemoryPackable]
public partial class G2M_SessionDisconnect: MessageObject, IActorLocationMessage
{
public static G2M_SessionDisconnect Create(bool isFromPool = true)
{
return !isFromPool? new G2M_SessionDisconnect() : ObjectPool.Instance.Fetch(typeof(G2M_SessionDisconnect)) as G2M_SessionDisconnect;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.ObjectQueryResponse)]
[MemoryPackable]
public partial class ObjectQueryResponse: MessageObject, IActorResponse
{
public static ObjectQueryResponse Create(bool isFromPool = true)
{
return !isFromPool? new ObjectQueryResponse() : ObjectPool.Instance.Fetch(typeof(ObjectQueryResponse)) as ObjectQueryResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
[MemoryPackOrder(3)]
public byte[] Entity { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
this.Entity = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(M2M_UnitTransferResponse))]
[Message(InnerMessage.M2M_UnitTransferRequest)]
[MemoryPackable]
public partial class M2M_UnitTransferRequest: MessageObject, IActorRequest
{
public static M2M_UnitTransferRequest Create(bool isFromPool = true)
{
return !isFromPool? new M2M_UnitTransferRequest() : ObjectPool.Instance.Fetch(typeof(M2M_UnitTransferRequest)) as M2M_UnitTransferRequest;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public ActorId OldActorId { get; set; }
[MemoryPackOrder(2)]
public byte[] Unit { get; set; }
[MemoryPackOrder(3)]
public List<byte[]> Entitys { get; set; } = new();
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.OldActorId = default;
this.Unit = default;
this.Entitys.Clear();
ObjectPool.Instance.Recycle(this);
}
}
[Message(InnerMessage.M2M_UnitTransferResponse)]
[MemoryPackable]
public partial class M2M_UnitTransferResponse: MessageObject, IActorResponse
{
public static M2M_UnitTransferResponse Create(bool isFromPool = true)
{
return !isFromPool? new M2M_UnitTransferResponse() : ObjectPool.Instance.Fetch(typeof(M2M_UnitTransferResponse)) as M2M_UnitTransferResponse;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
public static class InnerMessage
{
public const ushort ObjectQueryRequest = 20002;
public const ushort M2A_Reload = 20003;
public const ushort A2M_Reload = 20004;
public const ushort G2G_LockRequest = 20005;
public const ushort G2G_LockResponse = 20006;
public const ushort G2G_LockReleaseRequest = 20007;
public const ushort G2G_LockReleaseResponse = 20008;
public const ushort ObjectAddRequest = 20009;
public const ushort ObjectAddResponse = 20010;
public const ushort ObjectLockRequest = 20011;
public const ushort ObjectLockResponse = 20012;
public const ushort ObjectUnLockRequest = 20013;
public const ushort ObjectUnLockResponse = 20014;
public const ushort ObjectRemoveRequest = 20015;
public const ushort ObjectRemoveResponse = 20016;
public const ushort ObjectGetRequest = 20017;
public const ushort ObjectGetResponse = 20018;
public const ushort R2G_GetLoginKey = 20019;
public const ushort G2R_GetLoginKey = 20020;
public const ushort G2M_SessionDisconnect = 20021;
public const ushort ObjectQueryResponse = 20022;
public const ushort M2M_UnitTransferRequest = 20023;
public const ushort M2M_UnitTransferResponse = 20024;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e0b72155012589840a78d9d64f29bdce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,263 @@
using ET;
using MemoryPack;
using System.Collections.Generic;
namespace ET
{
// 请求匹配
[ResponseType(nameof(Match2G_Match))]
[Message(LockStepInner.G2Match_Match)]
[MemoryPackable]
public partial class G2Match_Match: MessageObject, IActorRequest
{
public static G2Match_Match Create(bool isFromPool = true)
{
return !isFromPool? new G2Match_Match() : ObjectPool.Instance.Fetch(typeof(G2Match_Match)) as G2Match_Match;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public long Id { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Id = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepInner.Match2G_Match)]
[MemoryPackable]
public partial class Match2G_Match: MessageObject, IActorResponse
{
public static Match2G_Match Create(bool isFromPool = true)
{
return !isFromPool? new Match2G_Match() : ObjectPool.Instance.Fetch(typeof(Match2G_Match)) as Match2G_Match;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(Map2Match_GetRoom))]
[Message(LockStepInner.Match2Map_GetRoom)]
[MemoryPackable]
public partial class Match2Map_GetRoom: MessageObject, IActorRequest
{
public static Match2Map_GetRoom Create(bool isFromPool = true)
{
return !isFromPool? new Match2Map_GetRoom() : ObjectPool.Instance.Fetch(typeof(Match2Map_GetRoom)) as Match2Map_GetRoom;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public List<long> PlayerIds { get; set; } = new();
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.PlayerIds.Clear();
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepInner.Map2Match_GetRoom)]
[MemoryPackable]
public partial class Map2Match_GetRoom: MessageObject, IActorResponse
{
public static Map2Match_GetRoom Create(bool isFromPool = true)
{
return !isFromPool? new Map2Match_GetRoom() : ObjectPool.Instance.Fetch(typeof(Map2Match_GetRoom)) as Map2Match_GetRoom;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
// 房间的ActorId
[MemoryPackOrder(3)]
public ActorId ActorId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
this.ActorId = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(Room2G_Reconnect))]
[Message(LockStepInner.G2Room_Reconnect)]
[MemoryPackable]
public partial class G2Room_Reconnect: MessageObject, IActorRequest
{
public static G2Room_Reconnect Create(bool isFromPool = true)
{
return !isFromPool? new G2Room_Reconnect() : ObjectPool.Instance.Fetch(typeof(G2Room_Reconnect)) as G2Room_Reconnect;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public long PlayerId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.PlayerId = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepInner.Room2G_Reconnect)]
[MemoryPackable]
public partial class Room2G_Reconnect: MessageObject, IActorResponse
{
public static Room2G_Reconnect Create(bool isFromPool = true)
{
return !isFromPool? new Room2G_Reconnect() : ObjectPool.Instance.Fetch(typeof(Room2G_Reconnect)) as Room2G_Reconnect;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
[MemoryPackOrder(3)]
public long StartTime { get; set; }
[MemoryPackOrder(4)]
public List<LockStepUnitInfo> UnitInfos { get; set; } = new();
[MemoryPackOrder(5)]
public int Frame { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
this.StartTime = default;
this.UnitInfos.Clear();
this.Frame = default;
ObjectPool.Instance.Recycle(this);
}
}
[ResponseType(nameof(Room2RoomManager_Init))]
[Message(LockStepInner.RoomManager2Room_Init)]
[MemoryPackable]
public partial class RoomManager2Room_Init: MessageObject, IActorRequest
{
public static RoomManager2Room_Init Create(bool isFromPool = true)
{
return !isFromPool? new RoomManager2Room_Init() : ObjectPool.Instance.Fetch(typeof(RoomManager2Room_Init)) as RoomManager2Room_Init;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public List<long> PlayerIds { get; set; } = new();
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.PlayerIds.Clear();
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepInner.Room2RoomManager_Init)]
[MemoryPackable]
public partial class Room2RoomManager_Init: MessageObject, IActorResponse
{
public static Room2RoomManager_Init Create(bool isFromPool = true)
{
return !isFromPool? new Room2RoomManager_Init() : ObjectPool.Instance.Fetch(typeof(Room2RoomManager_Init)) as Room2RoomManager_Init;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
public static class LockStepInner
{
public const ushort G2Match_Match = 21002;
public const ushort Match2G_Match = 21003;
public const ushort Match2Map_GetRoom = 21004;
public const ushort Map2Match_GetRoom = 21005;
public const ushort G2Room_Reconnect = 21006;
public const ushort Room2G_Reconnect = 21007;
public const ushort RoomManager2Room_Init = 21008;
public const ushort Room2RoomManager_Init = 21009;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9a6810f88918d4d20ae7b353895f1af1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,342 @@
using ET;
using MemoryPack;
using System.Collections.Generic;
namespace ET
{
[ResponseType(nameof(G2C_Match))]
[Message(LockStepOuter.C2G_Match)]
[MemoryPackable]
public partial class C2G_Match: MessageObject, IRequest
{
public static C2G_Match Create(bool isFromPool = true)
{
return !isFromPool? new C2G_Match() : ObjectPool.Instance.Fetch(typeof(C2G_Match)) as C2G_Match;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepOuter.G2C_Match)]
[MemoryPackable]
public partial class G2C_Match: MessageObject, IResponse
{
public static G2C_Match Create(bool isFromPool = true)
{
return !isFromPool? new G2C_Match() : ObjectPool.Instance.Fetch(typeof(G2C_Match)) as G2C_Match;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
[MemoryPackOrder(1)]
public int Error { get; set; }
[MemoryPackOrder(2)]
public string Message { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.Error = default;
this.Message = default;
ObjectPool.Instance.Recycle(this);
}
}
// 匹配成功,通知客户端切换场景
[Message(LockStepOuter.Match2G_NotifyMatchSuccess)]
[MemoryPackable]
public partial class Match2G_NotifyMatchSuccess: MessageObject, IActorMessage
{
public static Match2G_NotifyMatchSuccess Create(bool isFromPool = true)
{
return !isFromPool? new Match2G_NotifyMatchSuccess() : ObjectPool.Instance.Fetch(typeof(Match2G_NotifyMatchSuccess)) as Match2G_NotifyMatchSuccess;
}
[MemoryPackOrder(0)]
public int RpcId { get; set; }
// 房间的ActorId
[MemoryPackOrder(1)]
public ActorId ActorId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.RpcId = default;
this.ActorId = default;
ObjectPool.Instance.Recycle(this);
}
}
// 客户端通知房间切换场景完成
[Message(LockStepOuter.C2Room_ChangeSceneFinish)]
[MemoryPackable]
public partial class C2Room_ChangeSceneFinish: MessageObject, IActorRoom
{
public static C2Room_ChangeSceneFinish Create(bool isFromPool = true)
{
return !isFromPool? new C2Room_ChangeSceneFinish() : ObjectPool.Instance.Fetch(typeof(C2Room_ChangeSceneFinish)) as C2Room_ChangeSceneFinish;
}
[MemoryPackOrder(0)]
public long PlayerId { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.PlayerId = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepOuter.LockStepUnitInfo)]
[MemoryPackable]
public partial class LockStepUnitInfo: MessageObject
{
public static LockStepUnitInfo Create(bool isFromPool = true)
{
return !isFromPool? new LockStepUnitInfo() : ObjectPool.Instance.Fetch(typeof(LockStepUnitInfo)) as LockStepUnitInfo;
}
[MemoryPackOrder(0)]
public long PlayerId { get; set; }
[MemoryPackOrder(1)]
public TrueSync.TSVector Position { get; set; }
[MemoryPackOrder(2)]
public TrueSync.TSQuaternion Rotation { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.PlayerId = default;
this.Position = default;
this.Rotation = default;
ObjectPool.Instance.Recycle(this);
}
}
// 房间通知客户端进入战斗
[Message(LockStepOuter.Room2C_Start)]
[MemoryPackable]
public partial class Room2C_Start: MessageObject, IActorMessage
{
public static Room2C_Start Create(bool isFromPool = true)
{
return !isFromPool? new Room2C_Start() : ObjectPool.Instance.Fetch(typeof(Room2C_Start)) as Room2C_Start;
}
[MemoryPackOrder(0)]
public long StartTime { get; set; }
[MemoryPackOrder(1)]
public List<LockStepUnitInfo> UnitInfo { get; set; } = new();
public override void Dispose()
{
if (!this.IsFromPool) return;
this.StartTime = default;
this.UnitInfo.Clear();
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepOuter.FrameMessage)]
[MemoryPackable]
public partial class FrameMessage: MessageObject, IActorMessage
{
public static FrameMessage Create(bool isFromPool = true)
{
return !isFromPool? new FrameMessage() : ObjectPool.Instance.Fetch(typeof(FrameMessage)) as FrameMessage;
}
[MemoryPackOrder(0)]
public int Frame { get; set; }
[MemoryPackOrder(1)]
public long PlayerId { get; set; }
[MemoryPackOrder(2)]
public LSInput Input { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.Frame = default;
this.PlayerId = default;
this.Input = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepOuter.OneFrameInputs)]
[MemoryPackable]
public partial class OneFrameInputs: MessageObject, IActorMessage
{
public static OneFrameInputs Create(bool isFromPool = true)
{
return !isFromPool? new OneFrameInputs() : ObjectPool.Instance.Fetch(typeof(OneFrameInputs)) as OneFrameInputs;
}
[MongoDB.Bson.Serialization.Attributes.BsonDictionaryOptions(MongoDB.Bson.Serialization.Options.DictionaryRepresentation.ArrayOfArrays)]
[MemoryPackOrder(1)]
public Dictionary<long, LSInput> Inputs { get; set; } = new();
public override void Dispose()
{
if (!this.IsFromPool) return;
this.Inputs.Clear();
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepOuter.Room2C_AdjustUpdateTime)]
[MemoryPackable]
public partial class Room2C_AdjustUpdateTime: MessageObject, IActorMessage
{
public static Room2C_AdjustUpdateTime Create(bool isFromPool = true)
{
return !isFromPool? new Room2C_AdjustUpdateTime() : ObjectPool.Instance.Fetch(typeof(Room2C_AdjustUpdateTime)) as Room2C_AdjustUpdateTime;
}
[MemoryPackOrder(0)]
public int DiffTime { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.DiffTime = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepOuter.C2Room_CheckHash)]
[MemoryPackable]
public partial class C2Room_CheckHash: MessageObject, IActorRoom
{
public static C2Room_CheckHash Create(bool isFromPool = true)
{
return !isFromPool? new C2Room_CheckHash() : ObjectPool.Instance.Fetch(typeof(C2Room_CheckHash)) as C2Room_CheckHash;
}
[MemoryPackOrder(0)]
public long PlayerId { get; set; }
[MemoryPackOrder(1)]
public int Frame { get; set; }
[MemoryPackOrder(2)]
public long Hash { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.PlayerId = default;
this.Frame = default;
this.Hash = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepOuter.Room2C_CheckHashFail)]
[MemoryPackable]
public partial class Room2C_CheckHashFail: MessageObject, IActorMessage
{
public static Room2C_CheckHashFail Create(bool isFromPool = true)
{
return !isFromPool? new Room2C_CheckHashFail() : ObjectPool.Instance.Fetch(typeof(Room2C_CheckHashFail)) as Room2C_CheckHashFail;
}
[MemoryPackOrder(0)]
public int Frame { get; set; }
[MemoryPackOrder(1)]
public byte[] LSWorldBytes { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.Frame = default;
this.LSWorldBytes = default;
ObjectPool.Instance.Recycle(this);
}
}
[Message(LockStepOuter.G2C_Reconnect)]
[MemoryPackable]
public partial class G2C_Reconnect: MessageObject, IActorMessage
{
public static G2C_Reconnect Create(bool isFromPool = true)
{
return !isFromPool? new G2C_Reconnect() : ObjectPool.Instance.Fetch(typeof(G2C_Reconnect)) as G2C_Reconnect;
}
[MemoryPackOrder(0)]
public long StartTime { get; set; }
[MemoryPackOrder(1)]
public List<LockStepUnitInfo> UnitInfos { get; set; } = new();
[MemoryPackOrder(2)]
public int Frame { get; set; }
public override void Dispose()
{
if (!this.IsFromPool) return;
this.StartTime = default;
this.UnitInfos.Clear();
this.Frame = default;
ObjectPool.Instance.Recycle(this);
}
}
public static class LockStepOuter
{
public const ushort C2G_Match = 11002;
public const ushort G2C_Match = 11003;
public const ushort Match2G_NotifyMatchSuccess = 11004;
public const ushort C2Room_ChangeSceneFinish = 11005;
public const ushort LockStepUnitInfo = 11006;
public const ushort Room2C_Start = 11007;
public const ushort FrameMessage = 11008;
public const ushort OneFrameInputs = 11009;
public const ushort Room2C_AdjustUpdateTime = 11010;
public const ushort C2Room_CheckHash = 11011;
public const ushort Room2C_CheckHashFail = 11012;
public const ushort G2C_Reconnect = 11013;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f493672bf2fa046739a1f8fbf88a28c3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9a420edf6a4a57a4c8d98e5acdffcfe9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: