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:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b8404cea481db34c91f2ba7567620db
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc782e6aee9c7654a85ff3e8178e1f53
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
using TEngine.Core;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
// ReSharper disable CollectionNeverUpdated.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
#pragma warning disable CS0169
|
||||
#pragma warning disable CS8618
|
||||
#pragma warning disable CS8625
|
||||
#pragma warning disable CS8603
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
[ProtoContract]
|
||||
public sealed partial class MachineConfigData : AProto, IConfigTable, IDisposable
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public List<MachineConfig> List { get; set; } = new List<MachineConfig>();
|
||||
[ProtoIgnore]
|
||||
private readonly Dictionary<uint, MachineConfig> _configs = new Dictionary<uint, MachineConfig>();
|
||||
private static MachineConfigData _instance;
|
||||
|
||||
public static MachineConfigData Instance
|
||||
{
|
||||
get { return _instance ??= ConfigTableManage.Load<MachineConfigData>(); }
|
||||
private set => _instance = value;
|
||||
}
|
||||
|
||||
public MachineConfig Get(uint id, bool check = true)
|
||||
{
|
||||
if (_configs.ContainsKey(id))
|
||||
{
|
||||
return _configs[id];
|
||||
}
|
||||
|
||||
if (check)
|
||||
{
|
||||
throw new Exception($"MachineConfig not find {id} Id");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public bool TryGet(uint id, out MachineConfig config)
|
||||
{
|
||||
config = null;
|
||||
|
||||
if (!_configs.ContainsKey(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
config = _configs[id];
|
||||
return true;
|
||||
}
|
||||
public override void AfterDeserialization()
|
||||
{
|
||||
for (var i = 0; i < List.Count; i++)
|
||||
{
|
||||
MachineConfig config = List[i];
|
||||
_configs.Add(config.Id, config);
|
||||
config.AfterDeserialization();
|
||||
}
|
||||
|
||||
base.AfterDeserialization();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public sealed partial class MachineConfig : AProto
|
||||
{
|
||||
[ProtoMember(1, IsRequired = true)]
|
||||
public uint Id { get; set; } // Id
|
||||
[ProtoMember(2, IsRequired = true)]
|
||||
public string OuterIP { get; set; } // 外网IP
|
||||
[ProtoMember(3, IsRequired = true)]
|
||||
public string OuterBindIP { get; set; } // 外网绑定IP
|
||||
[ProtoMember(4, IsRequired = true)]
|
||||
public string InnerBindIP { get; set; } // 内网绑定IP
|
||||
[ProtoMember(5, IsRequired = true)]
|
||||
public int ManagementPort { get; set; } // 管理端口
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9853ff3c8cde9a34f89c6e77f01c2b0f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
using TEngine.Core;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
// ReSharper disable CollectionNeverUpdated.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
#pragma warning disable CS0169
|
||||
#pragma warning disable CS8618
|
||||
#pragma warning disable CS8625
|
||||
#pragma warning disable CS8603
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
[ProtoContract]
|
||||
public sealed partial class SceneConfigData : AProto, IConfigTable, IDisposable
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public List<SceneConfig> List { get; set; } = new List<SceneConfig>();
|
||||
[ProtoIgnore]
|
||||
private readonly Dictionary<uint, SceneConfig> _configs = new Dictionary<uint, SceneConfig>();
|
||||
private static SceneConfigData _instance;
|
||||
|
||||
public static SceneConfigData Instance
|
||||
{
|
||||
get { return _instance ??= ConfigTableManage.Load<SceneConfigData>(); }
|
||||
private set => _instance = value;
|
||||
}
|
||||
|
||||
public SceneConfig Get(uint id, bool check = true)
|
||||
{
|
||||
if (_configs.ContainsKey(id))
|
||||
{
|
||||
return _configs[id];
|
||||
}
|
||||
|
||||
if (check)
|
||||
{
|
||||
throw new Exception($"SceneConfig not find {id} Id");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public bool TryGet(uint id, out SceneConfig config)
|
||||
{
|
||||
config = null;
|
||||
|
||||
if (!_configs.ContainsKey(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
config = _configs[id];
|
||||
return true;
|
||||
}
|
||||
public override void AfterDeserialization()
|
||||
{
|
||||
for (var i = 0; i < List.Count; i++)
|
||||
{
|
||||
SceneConfig config = List[i];
|
||||
_configs.Add(config.Id, config);
|
||||
config.AfterDeserialization();
|
||||
}
|
||||
|
||||
base.AfterDeserialization();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public sealed partial class SceneConfig : AProto
|
||||
{
|
||||
[ProtoMember(1, IsRequired = true)]
|
||||
public uint Id { get; set; } // ID
|
||||
[ProtoMember(2, IsRequired = true)]
|
||||
public long EntityId { get; set; } // 实体Id
|
||||
[ProtoMember(3, IsRequired = true)]
|
||||
public uint RouteId { get; set; } // 路由Id
|
||||
[ProtoMember(4, IsRequired = true)]
|
||||
public uint WorldId { get; set; } // 世界Id
|
||||
[ProtoMember(5, IsRequired = true)]
|
||||
public string SceneType { get; set; } // Scene类型
|
||||
[ProtoMember(6, IsRequired = true)]
|
||||
public string Name { get; set; } // 名称
|
||||
[ProtoMember(7, IsRequired = true)]
|
||||
public string NetworkProtocol { get; set; } // 协议类型
|
||||
[ProtoMember(8, IsRequired = true)]
|
||||
public int OuterPort { get; set; } // 外网端口
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e4c00f667c811947b6c191342eab7ac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
using TEngine.Core;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
// ReSharper disable CollectionNeverUpdated.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
#pragma warning disable CS0169
|
||||
#pragma warning disable CS8618
|
||||
#pragma warning disable CS8625
|
||||
#pragma warning disable CS8603
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
[ProtoContract]
|
||||
public sealed partial class ServerConfigData : AProto, IConfigTable, IDisposable
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public List<ServerConfig> List { get; set; } = new List<ServerConfig>();
|
||||
[ProtoIgnore]
|
||||
private readonly Dictionary<uint, ServerConfig> _configs = new Dictionary<uint, ServerConfig>();
|
||||
private static ServerConfigData _instance;
|
||||
|
||||
public static ServerConfigData Instance
|
||||
{
|
||||
get { return _instance ??= ConfigTableManage.Load<ServerConfigData>(); }
|
||||
private set => _instance = value;
|
||||
}
|
||||
|
||||
public ServerConfig Get(uint id, bool check = true)
|
||||
{
|
||||
if (_configs.ContainsKey(id))
|
||||
{
|
||||
return _configs[id];
|
||||
}
|
||||
|
||||
if (check)
|
||||
{
|
||||
throw new Exception($"ServerConfig not find {id} Id");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public bool TryGet(uint id, out ServerConfig config)
|
||||
{
|
||||
config = null;
|
||||
|
||||
if (!_configs.ContainsKey(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
config = _configs[id];
|
||||
return true;
|
||||
}
|
||||
public override void AfterDeserialization()
|
||||
{
|
||||
for (var i = 0; i < List.Count; i++)
|
||||
{
|
||||
ServerConfig config = List[i];
|
||||
_configs.Add(config.Id, config);
|
||||
config.AfterDeserialization();
|
||||
}
|
||||
|
||||
base.AfterDeserialization();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public sealed partial class ServerConfig : AProto
|
||||
{
|
||||
[ProtoMember(1, IsRequired = true)]
|
||||
public uint Id { get; set; } // 路由Id
|
||||
[ProtoMember(2, IsRequired = true)]
|
||||
public uint MachineId { get; set; } // 机器ID
|
||||
[ProtoMember(3, IsRequired = true)]
|
||||
public int InnerPort { get; set; } // 内网端口
|
||||
[ProtoMember(4, IsRequired = true)]
|
||||
public bool ReleaseMode { get; set; } // Release下运行
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86a653380b833dc4abd9816ea3cc27d9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
using TEngine.Core;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
// ReSharper disable CollectionNeverUpdated.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
#pragma warning disable CS0169
|
||||
#pragma warning disable CS8618
|
||||
#pragma warning disable CS8625
|
||||
#pragma warning disable CS8603
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
[ProtoContract]
|
||||
public sealed partial class WorldConfigData : AProto, IConfigTable, IDisposable
|
||||
{
|
||||
[ProtoMember(1)]
|
||||
public List<WorldConfig> List { get; set; } = new List<WorldConfig>();
|
||||
[ProtoIgnore]
|
||||
private readonly Dictionary<uint, WorldConfig> _configs = new Dictionary<uint, WorldConfig>();
|
||||
private static WorldConfigData _instance;
|
||||
|
||||
public static WorldConfigData Instance
|
||||
{
|
||||
get { return _instance ??= ConfigTableManage.Load<WorldConfigData>(); }
|
||||
private set => _instance = value;
|
||||
}
|
||||
|
||||
public WorldConfig Get(uint id, bool check = true)
|
||||
{
|
||||
if (_configs.ContainsKey(id))
|
||||
{
|
||||
return _configs[id];
|
||||
}
|
||||
|
||||
if (check)
|
||||
{
|
||||
throw new Exception($"WorldConfig not find {id} Id");
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public bool TryGet(uint id, out WorldConfig config)
|
||||
{
|
||||
config = null;
|
||||
|
||||
if (!_configs.ContainsKey(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
config = _configs[id];
|
||||
return true;
|
||||
}
|
||||
public override void AfterDeserialization()
|
||||
{
|
||||
for (var i = 0; i < List.Count; i++)
|
||||
{
|
||||
WorldConfig config = List[i];
|
||||
_configs.Add(config.Id, config);
|
||||
config.AfterDeserialization();
|
||||
}
|
||||
|
||||
base.AfterDeserialization();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public sealed partial class WorldConfig : AProto
|
||||
{
|
||||
[ProtoMember(1, IsRequired = true)]
|
||||
public uint Id { get; set; } // Id
|
||||
[ProtoMember(2, IsRequired = true)]
|
||||
public string WorldName { get; set; } // 名称
|
||||
[ProtoMember(3, IsRequired = true)]
|
||||
public string DbConnection { get; set; } // 连接字符串
|
||||
[ProtoMember(4, IsRequired = true)]
|
||||
public string DbName { get; set; } // 数据库名称
|
||||
[ProtoMember(5, IsRequired = true)]
|
||||
public string DbType { get; set; } // 数据库类型
|
||||
[ProtoMember(6, IsRequired = true)]
|
||||
public bool IsGameWorld { get; set; } // 是否游戏服
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0effffaeff49200459ca1ea5dce76982
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34d6b1a4a6ca2eb4390f6ce02c611461
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
// 生成器自动生成,请不要手动编辑。
|
||||
public class SceneType
|
||||
{
|
||||
public const int Gate = 1;
|
||||
public const int Addressable = 2;
|
||||
public const int Map = 3;
|
||||
public const int Chat = 4;
|
||||
|
||||
public static readonly Dictionary<string, int> SceneDic = new Dictionary<string, int>()
|
||||
{
|
||||
{ "Gate", 1 },
|
||||
{ "Addressable", 2 },
|
||||
{ "Map", 3 },
|
||||
{ "Chat", 4 },
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e77592eb467992947a57a22ed5249c0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb7989dfa4f501845a696744157d57b2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,9 @@
|
||||
using ProtoBuf;
|
||||
using Unity.Mathematics;
|
||||
using System.Collections.Generic;
|
||||
using TEngine.Core.Network;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c2857a2685547246874c19eb182188a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,6 @@
|
||||
namespace TEngine
|
||||
{
|
||||
public static partial class InnerBsonOpcode
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec1d3cc361a3cdf498afd9bef149ded6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,31 @@
|
||||
using ProtoBuf;
|
||||
using Unity.Mathematics;
|
||||
using System.Collections.Generic;
|
||||
using TEngine.Core.Network;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// Gate跟Map服务器进行通讯、注册Address协议
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class I_G2M_LoginAddressRequest : AProto, IRouteRequest
|
||||
{
|
||||
[ProtoIgnore]
|
||||
public I_M2G_LoginAddressResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.I_G2M_LoginAddressRequest; }
|
||||
public long RouteTypeOpCode() { return CoreRouteType.Route; }
|
||||
[ProtoMember(1)]
|
||||
public long AddressId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long GateRouteId { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class I_M2G_LoginAddressResponse : AProto, IRouteResponse
|
||||
{
|
||||
public uint OpCode() { return InnerOpcode.I_M2G_LoginAddressResponse; }
|
||||
[ProtoMember(91, IsRequired = true)]
|
||||
public int ErrorCode { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a087e0d601b77a34c91d2a27a3caaa59
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
namespace TEngine
|
||||
{
|
||||
public static partial class InnerOpcode
|
||||
{
|
||||
public const int I_G2M_LoginAddressRequest = 220001001;
|
||||
public const int I_M2G_LoginAddressResponse = 260001001;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b495abbd9ecfd7547a2c986416e701fa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,157 @@
|
||||
using ProtoBuf;
|
||||
using Unity.Mathematics;
|
||||
using System.Collections.Generic;
|
||||
using TEngine.Core.Network;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 发送一个消息到Gate服务器
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_C2G_Message : AProto, IMessage
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_C2G_Message; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送一个RPC消息到Gate服务器
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_C2G_MessageRequest : AProto, IRequest
|
||||
{
|
||||
[ProtoIgnore]
|
||||
public H_G2C_MessageResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.H_C2G_MessageRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class H_G2C_MessageResponse : AProto, IResponse
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_G2C_MessageResponse; }
|
||||
[ProtoMember(91, IsRequired = true)]
|
||||
public int ErrorCode { get; set; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送一个消息通知服务器给客户端推送一个消息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_C2G_PushMessageToClient : AProto, IMessage
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_C2G_PushMessageToClient; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端接收服务器推送的一条消息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_G2C_ReceiveMessageToServer : AProto, IMessage
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_G2C_ReceiveMessageToServer; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 注册Address消息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_C2G_LoginAddressRequest : AProto, IRequest
|
||||
{
|
||||
[ProtoIgnore]
|
||||
public H_G2C_LoginAddressResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.H_C2G_LoginAddressRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class H_G2C_LoginAddressResponse : AProto, IResponse
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_G2C_LoginAddressResponse; }
|
||||
[ProtoMember(91, IsRequired = true)]
|
||||
public int ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送一个Address消息给Map
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_C2M_Message : AProto, IAddressableRouteMessage
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_C2M_Message; }
|
||||
public long RouteTypeOpCode() { return CoreRouteType.Addressable; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送一个AddressRPC消息给Map
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_C2M_MessageRequest : AProto, IAddressableRouteRequest
|
||||
{
|
||||
[ProtoIgnore]
|
||||
public H_M2C_MessageResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.H_C2M_MessageRequest; }
|
||||
public long RouteTypeOpCode() { return CoreRouteType.Addressable; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class H_M2C_MessageResponse : AProto, IAddressableRouteResponse
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_M2C_MessageResponse; }
|
||||
[ProtoMember(91, IsRequired = true)]
|
||||
public int ErrorCode { get; set; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送一个消息通知服务器给客户端推送一个Address消息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_C2M_PushAddressMessageToClient : AProto, IAddressableRouteMessage
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_C2M_PushAddressMessageToClient; }
|
||||
public long RouteTypeOpCode() { return CoreRouteType.Addressable; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端接收服务器推送的一条Address消息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_M2C_ReceiveAddressMessageToServer : AProto, IAddressableRouteMessage
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_M2C_ReceiveAddressMessageToServer; }
|
||||
public long RouteTypeOpCode() { return CoreRouteType.Addressable; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端发送消息请求登录服务器
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class H_C2G_LoginRequest : AProto, IRequest
|
||||
{
|
||||
[ProtoIgnore]
|
||||
public H_G2C_LoginResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.H_C2G_LoginRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string UserName { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public string Password { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class H_G2C_LoginResponse : AProto, IResponse
|
||||
{
|
||||
public uint OpCode() { return OuterOpcode.H_G2C_LoginResponse; }
|
||||
[ProtoMember(91, IsRequired = true)]
|
||||
public int ErrorCode { get; set; }
|
||||
[ProtoMember(1)]
|
||||
public string Text { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fed81665632c0eb40a9704d33e8a3b22
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,20 @@
|
||||
namespace TEngine
|
||||
{
|
||||
public static partial class OuterOpcode
|
||||
{
|
||||
public const int H_C2G_Message = 100000001;
|
||||
public const int H_C2G_MessageRequest = 110000001;
|
||||
public const int H_G2C_MessageResponse = 160000001;
|
||||
public const int H_C2G_PushMessageToClient = 100000002;
|
||||
public const int H_G2C_ReceiveMessageToServer = 100000003;
|
||||
public const int H_C2G_LoginAddressRequest = 110000002;
|
||||
public const int H_G2C_LoginAddressResponse = 160000002;
|
||||
public const int H_C2M_Message = 190000001;
|
||||
public const int H_C2M_MessageRequest = 200000001;
|
||||
public const int H_M2C_MessageResponse = 250000001;
|
||||
public const int H_C2M_PushAddressMessageToClient = 190000002;
|
||||
public const int H_M2C_ReceiveAddressMessageToServer = 190000003;
|
||||
public const int H_C2G_LoginRequest = 110000003;
|
||||
public const int H_G2C_LoginResponse = 160000003;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47365b17af2f7c744aa93ff7e9dfec0e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
namespace TEngine.Core.Network
|
||||
{
|
||||
// Route协议定义(需要定义1000以上、因为1000以内的框架预留)
|
||||
public enum RouteType : long
|
||||
{
|
||||
ChatRoute = 1001, // 聊天服协议
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b6880642b7d6ca4b995a988465c77a1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user