修改协议工具
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
&é"MultiThread*Addressable@ůUH
|
||||
(ę"MultiThread*Gate2KCP8 ś@úUH
|
||||
ë"MultiThread*Map@űUH
|
||||
ě"MultiThread*Chat@üUH
|
||||
í"MultiThread*Map@ýUH
|
||||
/é"MultiThread*Addressable2KCP8ˇś@ůUH
|
||||
&ę"MultiThread*Addressable@<40>VH
|
||||
(ë"MultiThread*Gate2KCP8 ś@ŤVH
|
||||
ě"MultiThread*Map@—VH
|
||||
í"MultiThread*Map@ˇVH
|
||||
î"MultiThread*Chat@«VH
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
{"WorksheetNames":[-8419147776733210060,-3495952183970875596,-1088042625810372120,1720330851179383898],"Tables":{"-3495952183970875596":1750919742778,"-1088042625810372120":1731573652950,"1720330851179383898":1728449870789,"3730651590607244245":1731575713470,"5812538452563588342":1748394916174}}
|
||||
{"WorksheetNames":[-8419147776733210060,-3495952183970875596,1720330851179383898,3730651590607244245],"Tables":{"-3495952183970875596":1753598025078,"-1088042625810372120":1753532052628,"1720330851179383898":1753532052630,"3730651590607244245":1753532052629,"5812538452563588342":1753532052630}}
|
||||
@@ -1,8 +1,8 @@
|
||||
{"List":[
|
||||
{"Id":1001,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Authentication","NetworkProtocol":"KCP","OuterPort":20001,"InnerPort":11001,"SceneType":1},
|
||||
{"Id":1006,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Addressable","NetworkProtocol":null,"OuterPort":0,"InnerPort":11006,"SceneType":2},
|
||||
{"Id":1002,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":20000,"InnerPort":11002,"SceneType":3},
|
||||
{"Id":1003,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11003,"SceneType":4},
|
||||
{"Id":1004,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":null,"OuterPort":0,"InnerPort":11004,"SceneType":8},
|
||||
{"Id":1005,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11005,"SceneType":4}
|
||||
{"Id":1001,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Addressable","NetworkProtocol":"KCP","OuterPort":20001,"InnerPort":11001,"SceneType":1},
|
||||
{"Id":1002,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Addressable","NetworkProtocol":null,"OuterPort":0,"InnerPort":11011,"SceneType":2},
|
||||
{"Id":1003,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":20000,"InnerPort":11021,"SceneType":3},
|
||||
{"Id":1004,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11031,"SceneType":5},
|
||||
{"Id":1005,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11041,"SceneType":5},
|
||||
{"Id":1006,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":null,"OuterPort":0,"InnerPort":11051,"SceneType":8}
|
||||
]}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{"List":[
|
||||
{"Id":1,"WorldName":"测试服","DbConnection":"mongodb://127.0.0.1","DbName":"fantasy_main","DbType":"MongoDB"}
|
||||
{"Id":1,"WorldName":"测试服","DbConnection":null,"DbName":"fantasy_main","DbType":"MongoDB"}
|
||||
]}
|
||||
|
||||
@@ -1,75 +1,2 @@
|
||||
syntax = "proto3";
|
||||
package Sining.Message;
|
||||
message G2A_TestMessage // IRouteMessage
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
message G2A_TestRequest // IRouteRequest,G2A_TestResponse
|
||||
{
|
||||
|
||||
}
|
||||
message G2A_TestResponse // IRouteResponse
|
||||
{
|
||||
|
||||
}
|
||||
message G2M_RequestAddressableId // IRouteRequest,M2G_ResponseAddressableId
|
||||
{
|
||||
|
||||
}
|
||||
message M2G_ResponseAddressableId // IRouteResponse
|
||||
{
|
||||
int64 AddressableId = 1; // Map服务器返回的AddressableId
|
||||
}
|
||||
/// 通知Chat服务器创建一个RouteId
|
||||
message G2Chat_CreateRouteRequest // IRouteRequest,Chat2G_CreateRouteResponse
|
||||
{
|
||||
int64 GateRouteId = 1;
|
||||
}
|
||||
message Chat2G_CreateRouteResponse // IRouteResponse
|
||||
{
|
||||
int64 ChatRouteId = 1;
|
||||
}
|
||||
/// Map给另外一个Map发送Unit数据
|
||||
// Protocol Bson
|
||||
message M2M_SendUnitRequest // IRouteRequest,M2M_SendUnitResponse
|
||||
{
|
||||
|
||||
}
|
||||
// Protocol Bson
|
||||
message M2M_SendUnitResponse // IRouteResponse
|
||||
{
|
||||
|
||||
}
|
||||
/// Gate发送Addressable消息给MAP
|
||||
message G2M_SendAddressableMessage // IAddressableRouteMessage
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
// Gate通知Map创建一个SubScene
|
||||
message G2M_CreateSubSceneRequest // IRouteRequest,M2G_CreateSubSceneResponse
|
||||
{
|
||||
|
||||
}
|
||||
message M2G_CreateSubSceneResponse // IRouteResponse
|
||||
{
|
||||
int64 SubSceneRouteId = 1;
|
||||
}
|
||||
// Gate给SubScene发送一个消息
|
||||
message G2SubScene_SentMessage // IRouteMessage
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
/// Gate通知SubScene创建一个Addressable消息
|
||||
message G2SubScene_AddressableIdRequest // IRouteRequest,SubScene2G_AddressableIdResponse
|
||||
{
|
||||
|
||||
}
|
||||
message SubScene2G_AddressableIdResponse // IRouteResponse
|
||||
{
|
||||
int64 AddressableId = 1; // SubScene服务器返回的AddressableId
|
||||
}
|
||||
/// Chat发送一个漫游消息给Map
|
||||
message Chat2M_TestMessage // IRoamingMessage,MapRoamingType
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
@@ -7,15 +7,6 @@ package Fantasy.Network.Message;
|
||||
// 使用方式:
|
||||
// 在message协议上方添加// Protocol+空格+协议名字
|
||||
// 例如:// Protocol ProtoBuf 或 // Protocol MemoryPack
|
||||
message C2A_RegisterRequest // IRequest,A2C_RegisterResponse
|
||||
{
|
||||
string Username = 1;
|
||||
string Password = 2;
|
||||
}
|
||||
message A2C_RegisterResponse // IResponse
|
||||
{
|
||||
|
||||
}
|
||||
message C2A_LoginRequest // IRequest,A2C_LoginResponse
|
||||
{
|
||||
string Username = 1;
|
||||
@@ -54,61 +45,4 @@ message C2G_GetAccountInfoRequest // IRequest,G2C_GetAccountInfoResponse
|
||||
message G2C_GetAccountInfoResponse // IResponse
|
||||
{
|
||||
GameAccountInfo GameAccountInfo = 1;
|
||||
}
|
||||
|
||||
|
||||
message C2G_TestMessage // IMessage
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
message C2G_TestRequest // IRequest,G2C_TestResponse
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
message G2C_TestResponse // IResponse
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
message C2G_CreateAddressableRequest // IRequest,G2C_CreateAddressableResponse
|
||||
{
|
||||
|
||||
}
|
||||
message G2C_CreateAddressableResponse // IResponse
|
||||
{
|
||||
|
||||
}
|
||||
message C2M_TestMessage // IAddressableRouteMessage
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
message C2M_TestRequest // IAddressableRouteRequest,M2C_TestResponse
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
message M2C_TestResponse // IAddressableRouteResponse
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
/// 通知Gate服务器创建一个Chat的Route连接
|
||||
message C2G_CreateChatRouteRequest // IRequest,G2C_CreateChatRouteResponse
|
||||
{
|
||||
|
||||
}
|
||||
message G2C_CreateChatRouteResponse // IResponse
|
||||
{
|
||||
|
||||
}
|
||||
/// 发送一个Route消息给Chat
|
||||
message C2Chat_TestMessage // ICustomRouteMessage,ChatRoute
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
/// 发送一个RPCRoute消息给Chat
|
||||
message C2Chat_TestMessageRequest // ICustomRouteRequest,Chat2C_TestMessageResponse,ChatRoute
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
message Chat2C_TestMessageResponse // ICustomRouteResponse
|
||||
{
|
||||
string Tag = 1;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
|
||||
public class ItemComponent : Entity
|
||||
{
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace NB;
|
||||
|
||||
/// <summary>
|
||||
/// 挂这个 玩家Role创建时会自动添加此组件
|
||||
/// 挂这个 玩家Unit创建时会自动添加此组件
|
||||
/// </summary>
|
||||
public class RoleComAttribute : BaseAttribute
|
||||
{
|
||||
|
||||
@@ -4,5 +4,8 @@ namespace NB;
|
||||
|
||||
public class RoleManagerComponent : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏列表
|
||||
/// </summary>
|
||||
public readonly Dictionary<long, Role> Roles = new();
|
||||
}
|
||||
@@ -9,6 +9,5 @@ public sealed class Player : Entity
|
||||
public long LoginTime;
|
||||
|
||||
[BsonIgnore]
|
||||
// BsonIgnore特性是让Bson保存到数据库中忽略掉这个字段。
|
||||
public long SessionRunTimeId;
|
||||
}
|
||||
@@ -11,5 +11,5 @@ public sealed class PlayerFlagComponent : Entity
|
||||
// 有一种可能,当在Account在其他地方被销毁
|
||||
// 这时候因为这个Account是会回收到池子中,所以这个引用还是有效的
|
||||
// 那这时候就会出现这个引用的Account可能是其他用户的了。
|
||||
public EntityReference<Player> Account;
|
||||
public EntityReference<Player> Player;
|
||||
}
|
||||
@@ -6,10 +6,10 @@ namespace Fantasy
|
||||
public const int Authentication = 1;
|
||||
public const int Addressable = 2;
|
||||
public const int Gate = 3;
|
||||
public const int Map = 4;
|
||||
public const int CopyDispatcher = 5;
|
||||
public const int CopyManager = 6;
|
||||
public const int Copy = 7;
|
||||
public const int Game = 4;
|
||||
public const int Map = 5;
|
||||
public const int Activity = 6;
|
||||
public const int Cache = 7;
|
||||
public const int Chat = 8;
|
||||
|
||||
public static readonly Dictionary<string, int> SceneTypeDic = new Dictionary<string, int>()
|
||||
@@ -17,10 +17,10 @@ namespace Fantasy
|
||||
{ "Authentication", 1 },
|
||||
{ "Addressable", 2 },
|
||||
{ "Gate", 3 },
|
||||
{ "Map", 4 },
|
||||
{ "CopyDispatcher", 5 },
|
||||
{ "CopyManager", 6 },
|
||||
{ "Copy", 7 },
|
||||
{ "Game", 4 },
|
||||
{ "Map", 5 },
|
||||
{ "Activity", 6 },
|
||||
{ "Cache", 7 },
|
||||
{ "Chat", 8 },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,317 +15,6 @@ using Fantasy.Serialize;
|
||||
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace Fantasy
|
||||
namespace NBC
|
||||
{
|
||||
[ProtoContract]
|
||||
public partial class G2A_TestMessage : AMessage, IRouteMessage, IProto
|
||||
{
|
||||
public static G2A_TestMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2A_TestMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2A_TestMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.G2A_TestMessage; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2A_TestRequest : AMessage, IRouteRequest, IProto
|
||||
{
|
||||
public static G2A_TestRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2A_TestRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2A_TestRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public G2A_TestResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.G2A_TestRequest; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2A_TestResponse : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static G2A_TestResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2A_TestResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2A_TestResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.G2A_TestResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2M_RequestAddressableId : AMessage, IRouteRequest, IProto
|
||||
{
|
||||
public static G2M_RequestAddressableId Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2M_RequestAddressableId>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2M_RequestAddressableId>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public M2G_ResponseAddressableId ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.G2M_RequestAddressableId; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class M2G_ResponseAddressableId : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static M2G_ResponseAddressableId Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<M2G_ResponseAddressableId>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
AddressableId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<M2G_ResponseAddressableId>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.M2G_ResponseAddressableId; }
|
||||
[ProtoMember(1)]
|
||||
public long AddressableId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 通知Chat服务器创建一个RouteId
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class G2Chat_CreateRouteRequest : AMessage, IRouteRequest, IProto
|
||||
{
|
||||
public static G2Chat_CreateRouteRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2Chat_CreateRouteRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
GateRouteId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2Chat_CreateRouteRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Chat2G_CreateRouteResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.G2Chat_CreateRouteRequest; }
|
||||
[ProtoMember(1)]
|
||||
public long GateRouteId { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Chat2G_CreateRouteResponse : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static Chat2G_CreateRouteResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Chat2G_CreateRouteResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
ChatRouteId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Chat2G_CreateRouteResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.Chat2G_CreateRouteResponse; }
|
||||
[ProtoMember(1)]
|
||||
public long ChatRouteId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Map给另外一个Map发送Unit数据
|
||||
/// </summary>
|
||||
public partial class M2M_SendUnitRequest : AMessage, IRouteRequest
|
||||
{
|
||||
public static M2M_SendUnitRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<M2M_SendUnitRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<M2M_SendUnitRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[BsonIgnore]
|
||||
public M2M_SendUnitResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.M2M_SendUnitRequest; }
|
||||
}
|
||||
public partial class M2M_SendUnitResponse : AMessage, IRouteResponse
|
||||
{
|
||||
public static M2M_SendUnitResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<M2M_SendUnitResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<M2M_SendUnitResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.M2M_SendUnitResponse; }
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gate发送Addressable消息给MAP
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class G2M_SendAddressableMessage : AMessage, IAddressableRouteMessage, IProto
|
||||
{
|
||||
public static G2M_SendAddressableMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2M_SendAddressableMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2M_SendAddressableMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.G2M_SendAddressableMessage; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2M_CreateSubSceneRequest : AMessage, IRouteRequest, IProto
|
||||
{
|
||||
public static G2M_CreateSubSceneRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2M_CreateSubSceneRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2M_CreateSubSceneRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public M2G_CreateSubSceneResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.G2M_CreateSubSceneRequest; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class M2G_CreateSubSceneResponse : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static M2G_CreateSubSceneResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<M2G_CreateSubSceneResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
SubSceneRouteId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<M2G_CreateSubSceneResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.M2G_CreateSubSceneResponse; }
|
||||
[ProtoMember(1)]
|
||||
public long SubSceneRouteId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2SubScene_SentMessage : AMessage, IRouteMessage, IProto
|
||||
{
|
||||
public static G2SubScene_SentMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2SubScene_SentMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2SubScene_SentMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.G2SubScene_SentMessage; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gate通知SubScene创建一个Addressable消息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class G2SubScene_AddressableIdRequest : AMessage, IRouteRequest, IProto
|
||||
{
|
||||
public static G2SubScene_AddressableIdRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2SubScene_AddressableIdRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2SubScene_AddressableIdRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public SubScene2G_AddressableIdResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.G2SubScene_AddressableIdRequest; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class SubScene2G_AddressableIdResponse : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static SubScene2G_AddressableIdResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<SubScene2G_AddressableIdResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
AddressableId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<SubScene2G_AddressableIdResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.SubScene2G_AddressableIdResponse; }
|
||||
[ProtoMember(1)]
|
||||
public long AddressableId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Chat发送一个漫游消息给Map
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Chat2M_TestMessage : AMessage, IRoamingMessage, IProto
|
||||
{
|
||||
public static Chat2M_TestMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Chat2M_TestMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Chat2M_TestMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.Chat2M_TestMessage; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RoamingType.MapRoamingType;
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,21 +2,5 @@ namespace Fantasy
|
||||
{
|
||||
public static partial class InnerOpcode
|
||||
{
|
||||
public const uint G2A_TestMessage = 939534097;
|
||||
public const uint G2A_TestRequest = 1073751825;
|
||||
public const uint G2A_TestResponse = 1207969553;
|
||||
public const uint G2M_RequestAddressableId = 1073751826;
|
||||
public const uint M2G_ResponseAddressableId = 1207969554;
|
||||
public const uint G2Chat_CreateRouteRequest = 1073751827;
|
||||
public const uint Chat2G_CreateRouteResponse = 1207969555;
|
||||
public const uint M2M_SendUnitRequest = 1082140436;
|
||||
public const uint M2M_SendUnitResponse = 1216358164;
|
||||
public const uint G2M_SendAddressableMessage = 1744840465;
|
||||
public const uint G2M_CreateSubSceneRequest = 1073751829;
|
||||
public const uint M2G_CreateSubSceneResponse = 1207969557;
|
||||
public const uint G2SubScene_SentMessage = 939534098;
|
||||
public const uint G2SubScene_AddressableIdRequest = 1073751830;
|
||||
public const uint SubScene2G_AddressableIdResponse = 1207969558;
|
||||
public const uint Chat2M_TestMessage = 2952800017;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,49 +15,8 @@ using Fantasy.Serialize;
|
||||
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace Fantasy
|
||||
namespace NBC
|
||||
{
|
||||
[ProtoContract]
|
||||
public partial class C2A_RegisterRequest : AMessage, IRequest, IProto
|
||||
{
|
||||
public static C2A_RegisterRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2A_RegisterRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Username = default;
|
||||
Password = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2A_RegisterRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public A2C_RegisterResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2A_RegisterRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string Username { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public string Password { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class A2C_RegisterResponse : AMessage, IResponse, IProto
|
||||
{
|
||||
public static A2C_RegisterResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<A2C_RegisterResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<A2C_RegisterResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.A2C_RegisterResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2A_LoginRequest : AMessage, IRequest, IProto
|
||||
{
|
||||
@@ -231,264 +190,4 @@ namespace Fantasy
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2G_TestMessage : AMessage, IMessage, IProto
|
||||
{
|
||||
public static C2G_TestMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2G_TestMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2G_TestMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.C2G_TestMessage; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2G_TestRequest : AMessage, IRequest, IProto
|
||||
{
|
||||
public static C2G_TestRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2G_TestRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2G_TestRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public G2C_TestResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2G_TestRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2C_TestResponse : AMessage, IResponse, IProto
|
||||
{
|
||||
public static G2C_TestResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2C_TestResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2C_TestResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.G2C_TestResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2G_CreateAddressableRequest : AMessage, IRequest, IProto
|
||||
{
|
||||
public static C2G_CreateAddressableRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2G_CreateAddressableRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2G_CreateAddressableRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public G2C_CreateAddressableResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2G_CreateAddressableRequest; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2C_CreateAddressableResponse : AMessage, IResponse, IProto
|
||||
{
|
||||
public static G2C_CreateAddressableResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2C_CreateAddressableResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2C_CreateAddressableResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.G2C_CreateAddressableResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2M_TestMessage : AMessage, IAddressableRouteMessage, IProto
|
||||
{
|
||||
public static C2M_TestMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2M_TestMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2M_TestMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.C2M_TestMessage; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2M_TestRequest : AMessage, IAddressableRouteRequest, IProto
|
||||
{
|
||||
public static C2M_TestRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2M_TestRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2M_TestRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public M2C_TestResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2M_TestRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class M2C_TestResponse : AMessage, IAddressableRouteResponse, IProto
|
||||
{
|
||||
public static M2C_TestResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<M2C_TestResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<M2C_TestResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.M2C_TestResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 通知Gate服务器创建一个Chat的Route连接
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2G_CreateChatRouteRequest : AMessage, IRequest, IProto
|
||||
{
|
||||
public static C2G_CreateChatRouteRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2G_CreateChatRouteRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2G_CreateChatRouteRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public G2C_CreateChatRouteResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2G_CreateChatRouteRequest; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2C_CreateChatRouteResponse : AMessage, IResponse, IProto
|
||||
{
|
||||
public static G2C_CreateChatRouteResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2C_CreateChatRouteResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2C_CreateChatRouteResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.G2C_CreateChatRouteResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送一个Route消息给Chat
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Chat_TestMessage : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static C2Chat_TestMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Chat_TestMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Chat_TestMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.C2Chat_TestMessage; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送一个RPCRoute消息给Chat
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Chat_TestMessageRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Chat_TestMessageRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Chat_TestMessageRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Chat_TestMessageRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Chat2C_TestMessageResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2Chat_TestMessageRequest; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Chat2C_TestMessageResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Chat2C_TestMessageResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Chat2C_TestMessageResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Chat2C_TestMessageResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Chat2C_TestMessageResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,27 +2,12 @@ namespace Fantasy
|
||||
{
|
||||
public static partial class OuterOpcode
|
||||
{
|
||||
public const uint C2A_RegisterRequest = 268445457;
|
||||
public const uint A2C_RegisterResponse = 402663185;
|
||||
public const uint C2A_LoginRequest = 268445458;
|
||||
public const uint A2C_LoginResponse = 402663186;
|
||||
public const uint C2G_LoginRequest = 268445459;
|
||||
public const uint G2C_LoginResponse = 402663187;
|
||||
public const uint C2A_LoginRequest = 268445457;
|
||||
public const uint A2C_LoginResponse = 402663185;
|
||||
public const uint C2G_LoginRequest = 268445458;
|
||||
public const uint G2C_LoginResponse = 402663186;
|
||||
public const uint G2C_RepeatLogin = 134227729;
|
||||
public const uint C2G_GetAccountInfoRequest = 268445460;
|
||||
public const uint G2C_GetAccountInfoResponse = 402663188;
|
||||
public const uint C2G_TestMessage = 134227730;
|
||||
public const uint C2G_TestRequest = 268445461;
|
||||
public const uint G2C_TestResponse = 402663189;
|
||||
public const uint C2G_CreateAddressableRequest = 268445462;
|
||||
public const uint G2C_CreateAddressableResponse = 402663190;
|
||||
public const uint C2M_TestMessage = 1342187281;
|
||||
public const uint C2M_TestRequest = 1476405009;
|
||||
public const uint M2C_TestResponse = 1610622737;
|
||||
public const uint C2G_CreateChatRouteRequest = 268445463;
|
||||
public const uint G2C_CreateChatRouteResponse = 402663191;
|
||||
public const uint C2Chat_TestMessage = 2147493649;
|
||||
public const uint C2Chat_TestMessageRequest = 2281711377;
|
||||
public const uint Chat2C_TestMessageResponse = 2415929105;
|
||||
public const uint C2G_GetAccountInfoRequest = 268445459;
|
||||
public const uint G2C_GetAccountInfoResponse = 402663187;
|
||||
}
|
||||
}
|
||||
|
||||
49
Hotfix/Game/Role/RoleManagerComponentSystem.cs
Normal file
49
Hotfix/Game/Role/RoleManagerComponentSystem.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
namespace NB;
|
||||
|
||||
public sealed class RoleManagerComponentDestroySystem : DestroySystem<RoleManagerComponent>
|
||||
{
|
||||
protected override void Destroy(RoleManagerComponent self)
|
||||
{
|
||||
foreach (var (_, role) in self.Roles)
|
||||
{
|
||||
role.Dispose();
|
||||
}
|
||||
|
||||
self.Roles.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public static class RoleManagerComponentSystem
|
||||
{
|
||||
public static void Add(this RoleManagerComponent self, Role account)
|
||||
{
|
||||
self.Roles.Add(account.Id, account);
|
||||
}
|
||||
|
||||
public static Role Get(this RoleManagerComponent self, long accountId)
|
||||
{
|
||||
return self.Roles.GetValueOrDefault(accountId);
|
||||
}
|
||||
|
||||
public static bool TryGet(this RoleManagerComponent self, long accountId, out Role account)
|
||||
{
|
||||
return self.Roles.TryGetValue(accountId, out account);
|
||||
}
|
||||
|
||||
public static void Remove(this RoleManagerComponent self, long accountId, bool isDispose = true)
|
||||
{
|
||||
if (!self.Roles.Remove(accountId, out var account))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isDispose)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
account.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public sealed class C2G_GetAccountInfoRequestHandler : MessageRPC<C2G_GetAccount
|
||||
return;
|
||||
}
|
||||
|
||||
Player account = gameAccountFlagComponent.Account;
|
||||
Player account = gameAccountFlagComponent.Player;
|
||||
|
||||
if (account == null)
|
||||
{
|
||||
@@ -79,7 +79,7 @@ public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_L
|
||||
|
||||
var gameAccountFlagComponent = oldSession.GetComponent<PlayerFlagComponent>();
|
||||
gameAccountFlagComponent.AccountID = 0;
|
||||
gameAccountFlagComponent.Account = null;
|
||||
gameAccountFlagComponent.Player = null;
|
||||
// 给客户端发送一个重复登录的消息,如果当前客户端是自己上次登录的,发送也不会收到。
|
||||
oldSession.Send(new G2C_RepeatLogin());
|
||||
// 给当前Session做一个定时销毁的任务,因为不做这个定时销毁,直接销毁的话,有可能消息还没有发送过去就销毁了
|
||||
@@ -90,10 +90,12 @@ public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_L
|
||||
// 给当前Session添加一个组件,当Session销毁的时候会销毁这个组件。
|
||||
var accountFlagComponent = session.AddComponent<PlayerFlagComponent>();
|
||||
accountFlagComponent.AccountID = accountId;
|
||||
accountFlagComponent.Account = account;
|
||||
accountFlagComponent.Player = account;
|
||||
|
||||
account.SessionRunTimeId = session.RuntimeId;
|
||||
response.GameAccountInfo = account.GetGameAccountInfo();
|
||||
Log.Debug($"当前的Gate服务器:{session.Scene.SceneConfigId} accountId:{accountId}");
|
||||
|
||||
//连接到游戏中心服
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,6 @@ public sealed class PlayerFlagComponentDestroySystem : DestroySystem<PlayerFlagC
|
||||
self.AccountID = 0;
|
||||
}
|
||||
|
||||
self.Account = null;
|
||||
self.Player = null;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ public static class PlayerHelper
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="accountId">账号Id</param>
|
||||
/// <returns></returns>
|
||||
public static async FTask<Player?> LoadDataBase(Scene scene, long accountId)
|
||||
public static async FTask<Player> LoadDataBase(Scene scene, long accountId)
|
||||
{
|
||||
var account = await scene.World.DataBase.First<Player>(d => d.Id == accountId);
|
||||
if (account == null)
|
||||
@@ -29,7 +29,7 @@ public static class PlayerHelper
|
||||
/// 保存账号到数据库中
|
||||
/// </summary>
|
||||
/// <param name="self"></param>
|
||||
public static async FTask SaveDataBase(this Player self)
|
||||
public static async FTask SaveDataBase(this Player self)
|
||||
{
|
||||
await self.Scene.World.DataBase.Save(self);
|
||||
}
|
||||
@@ -12,8 +12,4 @@
|
||||
<ProjectReference Include="..\Fantasy\Fantasy.Net\Fantasy.Net\Fantasy.Net.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Outer\Gate\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace Fantasy;
|
||||
|
||||
public class G2A_TestMessageHandler : Route<Scene,G2A_TestMessage>
|
||||
{
|
||||
protected override async FTask Run(Scene entity, G2A_TestMessage message)
|
||||
{
|
||||
|
||||
|
||||
Log.Debug($"G2A_TestMessageHandler :{message.Tag}");
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace Fantasy;
|
||||
|
||||
public class G2A_TestRequestHandler : RouteRPC<Scene, G2A_TestRequest, G2A_TestResponse>
|
||||
{
|
||||
private static int Count;
|
||||
protected override async FTask Run(Scene entity, G2A_TestRequest request, G2A_TestResponse response, Action reply)
|
||||
{
|
||||
if (++Count % 1000000 == 0)
|
||||
{
|
||||
Log.Debug($"count:1000000");
|
||||
}
|
||||
// Log.Debug($"{Count}");
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace Fantasy;
|
||||
|
||||
public sealed class G2Chat_CreateRouteRequestHandler : RouteRPC<Scene, G2Chat_CreateRouteRequest, Chat2G_CreateRouteResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene scene, G2Chat_CreateRouteRequest request, Chat2G_CreateRouteResponse response, Action reply)
|
||||
{
|
||||
// 接收到Gate消息后,首先建立一个实体用来后面接收Route消息。
|
||||
// 这里就拿ChatUnit来做这个。
|
||||
var chatUnit = Entity.Create<ChatUnit>(scene, true, true);
|
||||
// 把Gate传递过来的RouteId保存住,以便后面可以直接给Gate发送消息。
|
||||
// 例如断线等操作,都可以通过这个GateRouteId发送到Gate的Session上。
|
||||
chatUnit.GateRouteId = request.GateRouteId;
|
||||
// 把chatUnit的RunTimeId发送给Gate。
|
||||
// 正如之前所说任何实体的RunTimeId都可以当做RouteId使用。
|
||||
response.ChatRouteId = chatUnit.RouteId;
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -26,10 +26,16 @@ public class OnSceneCreate_Init : AsyncEventSystem<OnCreateScene>
|
||||
{
|
||||
// 用于验证JWT是否合法的组件
|
||||
scene.AddComponent<GateJWTComponent>();
|
||||
// 用于管理GameAccount的组件
|
||||
// 用于管理玩家的组件
|
||||
scene.AddComponent<PlayerManageComponent>();
|
||||
break;
|
||||
}
|
||||
case SceneType.Game:
|
||||
{
|
||||
//游戏服用于管理用户的组件
|
||||
scene.AddComponent<RoleManagerComponent>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"Export": {
|
||||
"ExcelProgramPath": {
|
||||
"Value": "../../../Examples/Config/Excel/",
|
||||
"Value": "../../Config/Excel/",
|
||||
"Comment": "Excel文件夹的根目录"
|
||||
},
|
||||
"ExcelVersionFile": {
|
||||
"Value": "../../../Examples/Config/Excel/Version.txt",
|
||||
"Value": "../../Config/Excel/Version.txt",
|
||||
"Comment": "Excel的Version文件位置、这个文件用于记录每次导出对比是否需要再次导出的文件"
|
||||
},
|
||||
"ExcelServerFileDirectory": {
|
||||
"Value": "../../../Examples/Server/Entity/Generate/ConfigTable/Entity/",
|
||||
"Value": "../../Entity/Generate/ConfigTable/Entity/",
|
||||
"Comment": "Excel生成的代码文件、在服务端文件夹位置"
|
||||
},
|
||||
"ExcelClientFileDirectory": {
|
||||
"Value": "../../../Examples/Client/Unity/Assets/Scripts/Hotfix/Generate/ConfigTable/Entity/",
|
||||
"Value": "../../../Fishing2/Assets/Scripts/Generate/ConfigTable/Entity/",
|
||||
"Comment": "Excel生成的代码文件、在客户端文件夹位置"
|
||||
},
|
||||
"ExcelServerBinaryDirectory": {
|
||||
"Value": "../../../Examples/Config/Binary/",
|
||||
"Value": "../../Config/Binary/",
|
||||
"Comment": "Excel生成服务器二进制数据文件夹位置"
|
||||
},
|
||||
"ExcelClientBinaryDirectory": {
|
||||
@@ -25,15 +25,15 @@
|
||||
"Comment": "Excel生成在客户端的二进制数据文件夹位置"
|
||||
},
|
||||
"ExcelServerJsonDirectory": {
|
||||
"Value": "../../../Examples/Config/Json/Server/",
|
||||
"Value": "../../Config/Json/Server/",
|
||||
"Comment": "Excel生成在服务端的Json数据文件夹位置"
|
||||
},
|
||||
"ExcelClientJsonDirectory": {
|
||||
"Value": "../../../Examples/Config/Json/Client/",
|
||||
"Value": "../../Config/Json/Client/",
|
||||
"Comment": "Excel生成在客户端的Json数据文件夹位置"
|
||||
},
|
||||
"ServerCustomExportDirectory": {
|
||||
"Value": "../../../Examples/Server/Entity/Generate/CustomExport/",
|
||||
"Value": "../../Entity/Generate/CustomExport/",
|
||||
"Comment": "Excel在服务端生成自定义代码的文件夹位置"
|
||||
},
|
||||
"ClientCustomExportDirectory": {
|
||||
|
||||
BIN
Tools/Exporter/NetworkProtocol/CommandLine.dll
Normal file
BIN
Tools/Exporter/NetworkProtocol/CommandLine.dll
Normal file
Binary file not shown.
29
Tools/Exporter/NetworkProtocol/ExporterSettings.json
Normal file
29
Tools/Exporter/NetworkProtocol/ExporterSettings.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"Export": {
|
||||
"NetworkProtocolDirectory": {
|
||||
"Value": "../../../Config/NetworkProtocol/",
|
||||
"Comment": "ProtoBuf文件所在的文件夹位置"
|
||||
},
|
||||
"NetworkProtocolServerDirectory": {
|
||||
"Value": "../../../Entity/Generate/NetworkProtocol/",
|
||||
"Comment": "ProtoBuf生成到服务端的文件夹位置"
|
||||
},
|
||||
"NetworkProtocolClientDirectory": {
|
||||
"Value": "../../../../Fishing2/Assets/Scripts/Generate/NetworkProtocol/",
|
||||
"Comment": "ProtoBuf生成到客户端的文件夹位置"
|
||||
},
|
||||
"Serializes": {
|
||||
"Value": [
|
||||
// {
|
||||
// "KeyIndex": 0,
|
||||
// "NameSpace" : "MemoryPack",
|
||||
// "SerializeName": "MemoryPack",
|
||||
// "Attribute": "\t[MemoryPackable]",
|
||||
// "Ignore": "\t\t[MemoryPackIgnore]",
|
||||
// "Member": "MemoryPackOrder"
|
||||
// }
|
||||
],
|
||||
"Comment": "自定义序列化器"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v9.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v9.0": {
|
||||
"Fantasy.Tools.NetworkProtocol/1.0.0": {
|
||||
"dependencies": {
|
||||
"CommandLineParser": "2.9.1",
|
||||
"Microsoft.Extensions.Configuration.Json": "9.0.6",
|
||||
"Newtonsoft.Json": "13.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"Fantasy.Tools.NetworkProtocol.dll": {}
|
||||
}
|
||||
},
|
||||
"CommandLineParser/2.9.1": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/CommandLine.dll": {
|
||||
"assemblyVersion": "2.9.1.0",
|
||||
"fileVersion": "2.9.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "9.0.6",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "9.0.6",
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.FileExtensions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "9.0.6",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "9.0.6",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.Json.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Physical/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.FileSystemGlobbing": "9.0.6",
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileProviders.Physical.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileSystemGlobbing.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net9.0/Microsoft.Extensions.Primitives.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Fantasy.Tools.NetworkProtocol/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"CommandLineParser/2.9.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==",
|
||||
"path": "commandlineparser/2.9.1",
|
||||
"hashPath": "commandlineparser.2.9.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-VWB5jdkxHsRiuoniTqwOL32R4OWyp5If/bAucLjRJczRVNcwb8iCXKLjn3Inv8fv+jHMVMnvQLg7xhSys+y5PA==",
|
||||
"path": "microsoft.extensions.configuration/9.0.6",
|
||||
"hashPath": "microsoft.extensions.configuration.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3GgMIi2jP8g1fBW93Z9b9Unamc0SIsgyhiCmC91gq4loTixK9vQMuxxUsfJ1kRGwn+/FqLKwOHqmn0oYWn3Fvw==",
|
||||
"path": "microsoft.extensions.configuration.abstractions/9.0.6",
|
||||
"hashPath": "microsoft.extensions.configuration.abstractions.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-pCEueasI5JhJ24KYzMFxtG40zyLnWpcQYawpARh9FNq9XbWozuWgexmdkPa8p8YoVNlpi3ecKfcjfoRMkKAufw==",
|
||||
"path": "microsoft.extensions.configuration.fileextensions/9.0.6",
|
||||
"hashPath": "microsoft.extensions.configuration.fileextensions.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-N0dgOYQ9tDzJouL9Tyx2dgMCcHV2pBaY8yVtorbDqYYwiDRS2zd1TbhTA2FMHqXF3SMjBoO+gONZcDoA79gdSA==",
|
||||
"path": "microsoft.extensions.configuration.json/9.0.6",
|
||||
"hashPath": "microsoft.extensions.configuration.json.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-q9FPkSGVA9ipI255p3PBAvWNXas5Tzjyp/DwYSwT+46mIFw9fWZahsF6vHpoxLt5/vtANotH2sAm7HunuFIx9g==",
|
||||
"path": "microsoft.extensions.fileproviders.abstractions/9.0.6",
|
||||
"hashPath": "microsoft.extensions.fileproviders.abstractions.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Physical/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-l+dFA0NRl90vSIiJNy5d7V0kpTEOWHTqbgoWYzlTwF5uiM5sWJ953haaELKE05jkyJdnemVTnqjrlgo4wo7oyg==",
|
||||
"path": "microsoft.extensions.fileproviders.physical/9.0.6",
|
||||
"hashPath": "microsoft.extensions.fileproviders.physical.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-1HJCAbwukNEoYbHgHbKHmenU0V/0huw8+i7Qtf5rLUG1E+3kEwRJQxpwD3wbTEagIgPSQisNgJTvmUX9yYVc6g==",
|
||||
"path": "microsoft.extensions.filesystemglobbing/9.0.6",
|
||||
"hashPath": "microsoft.extensions.filesystemglobbing.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-BHniU24QV67qp1pJknqYSofAPYGmijGI8D+ci9yfw33iuFdyOeB9lWTg78ThyYLyQwZw3s0vZ36VMb0MqbUuLw==",
|
||||
"path": "microsoft.extensions.primitives/9.0.6",
|
||||
"hashPath": "microsoft.extensions.primitives.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
|
||||
"path": "newtonsoft.json/13.0.3",
|
||||
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Tools/Exporter/NetworkProtocol/Fantasy.Tools.NetworkProtocol.dll
Normal file
BIN
Tools/Exporter/NetworkProtocol/Fantasy.Tools.NetworkProtocol.dll
Normal file
Binary file not shown.
BIN
Tools/Exporter/NetworkProtocol/Fantasy.Tools.NetworkProtocol.exe
Normal file
BIN
Tools/Exporter/NetworkProtocol/Fantasy.Tools.NetworkProtocol.exe
Normal file
Binary file not shown.
BIN
Tools/Exporter/NetworkProtocol/Fantasy.Tools.NetworkProtocol.pdb
Normal file
BIN
Tools/Exporter/NetworkProtocol/Fantasy.Tools.NetworkProtocol.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net9.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "9.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Tools/Exporter/NetworkProtocol/Newtonsoft.Json.dll
Normal file
BIN
Tools/Exporter/NetworkProtocol/Newtonsoft.Json.dll
Normal file
Binary file not shown.
21
Tools/Exporter/NetworkProtocol/Run.bat
Normal file
21
Tools/Exporter/NetworkProtocol/Run.bat
Normal file
@@ -0,0 +1,21 @@
|
||||
@echo off
|
||||
|
||||
echo Please select an option:
|
||||
echo 1. Client
|
||||
echo 2. Server
|
||||
echo 3. All
|
||||
|
||||
set /p choice=Please select an option:
|
||||
|
||||
if "%choice%"=="1" (
|
||||
echo Client
|
||||
dotnet Fantasy.Tools.NetworkProtocol.dll --p 1
|
||||
) else if "%choice%"=="2" (
|
||||
echo Server
|
||||
dotnet Fantasy.Tools.NetworkProtocol.dll --p 2
|
||||
) else if "%choice%"=="3" (
|
||||
echo All
|
||||
dotnet Fantasy.Tools.NetworkProtocol.dll --p 3
|
||||
) else (
|
||||
echo Invalid option
|
||||
)
|
||||
24
Tools/Exporter/NetworkProtocol/Run.sh
Normal file
24
Tools/Exporter/NetworkProtocol/Run.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "1. Client"
|
||||
echo "2. Server"
|
||||
echo "3. All"
|
||||
|
||||
read -n 1 -p "Please select an option:" choice
|
||||
echo ""
|
||||
echo ""
|
||||
script_dir=$(cd $(dirname $0) && pwd)
|
||||
case $choice in
|
||||
1)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 1 --f $script_dir
|
||||
;;
|
||||
2)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 2 --f $script_dir
|
||||
;;
|
||||
3)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 3 --f $script_dir
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option"
|
||||
;;
|
||||
esac
|
||||
BIN
Tools/Exporter/NetworkProtocol/System.IO.Pipelines.dll
Normal file
BIN
Tools/Exporter/NetworkProtocol/System.IO.Pipelines.dll
Normal file
Binary file not shown.
BIN
Tools/Exporter/NetworkProtocol/System.Text.Encodings.Web.dll
Normal file
BIN
Tools/Exporter/NetworkProtocol/System.Text.Encodings.Web.dll
Normal file
Binary file not shown.
BIN
Tools/Exporter/NetworkProtocol/System.Text.Json.dll
Normal file
BIN
Tools/Exporter/NetworkProtocol/System.Text.Json.dll
Normal file
Binary file not shown.
33
Tools/Exporter/NetworkProtocol/Template.txt
Normal file
33
Tools/Exporter/NetworkProtocol/Template.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
#if SERVER
|
||||
using ProtoBuf;
|
||||
(UsingNamespace)
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using Fantasy;
|
||||
using Fantasy.Network.Interface;
|
||||
using Fantasy.Serialize;
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
// ReSharper disable RedundantOverriddenMember
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable CheckNamespace
|
||||
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace NBC
|
||||
{
|
||||
#else
|
||||
using ProtoBuf;
|
||||
(UsingNamespace)
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Network.Interface;
|
||||
using Fantasy.Serialize;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace Fantasy
|
||||
{
|
||||
#endif
|
||||
(Content)}
|
||||
Binary file not shown.
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"name": ".NETCoreApp,Version=v9.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
".NETCoreApp,Version=v9.0": {
|
||||
"Fantasy.Tools.NetworkProtocol/1.0.0": {
|
||||
"dependencies": {
|
||||
"CommandLineParser": "2.9.1",
|
||||
@@ -30,7 +30,7 @@
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.dll": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
@@ -41,7 +41,7 @@
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.Abstractions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
@@ -56,7 +56,7 @@
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.FileExtensions.dll": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.FileExtensions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
@@ -67,11 +67,10 @@
|
||||
"Microsoft.Extensions.Configuration": "9.0.6",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "9.0.6",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.6",
|
||||
"System.Text.Json": "9.0.6"
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.Json.dll": {
|
||||
"lib/net9.0/Microsoft.Extensions.Configuration.Json.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
@@ -82,7 +81,7 @@
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
@@ -95,7 +94,7 @@
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.FileProviders.Physical.dll": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileProviders.Physical.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
@@ -103,7 +102,7 @@
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.FileSystemGlobbing.dll": {
|
||||
"lib/net9.0/Microsoft.Extensions.FileSystemGlobbing.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
@@ -111,7 +110,7 @@
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Primitives.dll": {
|
||||
"lib/net9.0/Microsoft.Extensions.Primitives.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
@@ -124,42 +123,6 @@
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Pipelines/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.IO.Pipelines.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Text.Encodings.Web/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.Text.Encodings.Web.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll": {
|
||||
"rid": "browser",
|
||||
"assetType": "runtime",
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Text.Json/9.0.6": {
|
||||
"dependencies": {
|
||||
"System.IO.Pipelines": "9.0.6",
|
||||
"System.Text.Encodings.Web": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/System.Text.Json.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -238,27 +201,6 @@
|
||||
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
|
||||
"path": "newtonsoft.json/13.0.3",
|
||||
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
|
||||
},
|
||||
"System.IO.Pipelines/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-0nlr0reXrRmkZNKifKqh2DgGhQgfkT7Qa3gQxIn/JI7/y3WDiTz67M+Sq3vFhUqcG8O5zVrpqHvIHeGPGUBsEw==",
|
||||
"path": "system.io.pipelines/9.0.6",
|
||||
"hashPath": "system.io.pipelines.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"System.Text.Encodings.Web/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-uWRgViw2yJAUyGxrzDLCc6fkzE2dZIoXxs8V6YjCujKsJuP0pnpYSlbm2/7tKd0SjBnMtwfDQhLenk3bXonVOA==",
|
||||
"path": "system.text.encodings.web/9.0.6",
|
||||
"hashPath": "system.text.encodings.web.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"System.Text.Json/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-h+ZtYTyTnTh5Ju6mHCKb3FPGx4ylJZgm9W7Y2psUnkhQRPMOIxX+TCN0ZgaR/+Yea+93XHWAaMzYTar1/EHIPg==",
|
||||
"path": "system.text.json/9.0.6",
|
||||
"hashPath": "system.text.json.9.0.6.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
BIN
Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.exe
Normal file
BIN
Tools/NetworkProtocol/Fantasy.Tools.NetworkProtocol.exe
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"tfm": "net9.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
"version": "9.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,6 +18,4 @@ if "%choice%"=="1" (
|
||||
dotnet Fantasy.Tools.NetworkProtocol.dll --p 3
|
||||
) else (
|
||||
echo Invalid option
|
||||
)
|
||||
|
||||
PAUSE
|
||||
)
|
||||
34
Tools/NetworkProtocol/Template.txt
Normal file
34
Tools/NetworkProtocol/Template.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
#if SERVER
|
||||
using ProtoBuf;
|
||||
(UsingNamespace)
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using Fantasy;
|
||||
using Fantasy.Network.Interface;
|
||||
using Fantasy.Serialize;
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
// ReSharper disable RedundantOverriddenMember
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable CheckNamespace
|
||||
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace NBC
|
||||
{
|
||||
#else
|
||||
using ProtoBuf;
|
||||
(UsingNamespace)
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using NBC;
|
||||
using NBC.Network.Interface;
|
||||
using NBC.Serialize;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace NBC
|
||||
{
|
||||
#endif
|
||||
(Content)}
|
||||
BIN
Tools/NetworkProtocol2/CommandLine.dll
Normal file
BIN
Tools/NetworkProtocol2/CommandLine.dll
Normal file
Binary file not shown.
29
Tools/NetworkProtocol2/ExporterSettings.json
Normal file
29
Tools/NetworkProtocol2/ExporterSettings.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"Export": {
|
||||
"NetworkProtocolDirectory": {
|
||||
"Value": "../../Config/NetworkProtocol/",
|
||||
"Comment": "ProtoBuf文件所在的文件夹位置"
|
||||
},
|
||||
"NetworkProtocolServerDirectory": {
|
||||
"Value": "../../Entity/Generate/NetworkProtocol/",
|
||||
"Comment": "ProtoBuf生成到服务端的文件夹位置"
|
||||
},
|
||||
"NetworkProtocolClientDirectory": {
|
||||
"Value": "../../../Fishing2/Assets/Scripts/Generate/NetworkProtocol/",
|
||||
"Comment": "ProtoBuf生成到客户端的文件夹位置"
|
||||
},
|
||||
"Serializes": {
|
||||
"Value": [
|
||||
// {
|
||||
// "KeyIndex": 0,
|
||||
// "NameSpace" : "MemoryPack",
|
||||
// "SerializeName": "MemoryPack",
|
||||
// "Attribute": "\t[MemoryPackable]",
|
||||
// "Ignore": "\t\t[MemoryPackIgnore]",
|
||||
// "Member": "MemoryPackOrder"
|
||||
// }
|
||||
],
|
||||
"Comment": "自定义序列化器"
|
||||
}
|
||||
}
|
||||
}
|
||||
264
Tools/NetworkProtocol2/Fantasy.Tools.NetworkProtocol.deps.json
Normal file
264
Tools/NetworkProtocol2/Fantasy.Tools.NetworkProtocol.deps.json
Normal file
@@ -0,0 +1,264 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"Fantasy.Tools.NetworkProtocol/1.0.0": {
|
||||
"dependencies": {
|
||||
"CommandLineParser": "2.9.1",
|
||||
"Microsoft.Extensions.Configuration.Json": "9.0.6",
|
||||
"Newtonsoft.Json": "13.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"Fantasy.Tools.NetworkProtocol.dll": {}
|
||||
}
|
||||
},
|
||||
"CommandLineParser/2.9.1": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/CommandLine.dll": {
|
||||
"assemblyVersion": "2.9.1.0",
|
||||
"fileVersion": "2.9.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "9.0.6",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.FileProviders.Physical": "9.0.6",
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.FileExtensions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration": "9.0.6",
|
||||
"Microsoft.Extensions.Configuration.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "9.0.6",
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.6",
|
||||
"System.Text.Json": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.Json.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Physical/9.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.FileProviders.Abstractions": "9.0.6",
|
||||
"Microsoft.Extensions.FileSystemGlobbing": "9.0.6",
|
||||
"Microsoft.Extensions.Primitives": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.FileProviders.Physical.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.FileSystemGlobbing.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Primitives.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.3.27908"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Pipelines/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.IO.Pipelines.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Text.Encodings.Web/9.0.6": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.Text.Encodings.Web.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll": {
|
||||
"rid": "browser",
|
||||
"assetType": "runtime",
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Text.Json/9.0.6": {
|
||||
"dependencies": {
|
||||
"System.IO.Pipelines": "9.0.6",
|
||||
"System.Text.Encodings.Web": "9.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/System.Text.Json.dll": {
|
||||
"assemblyVersion": "9.0.0.0",
|
||||
"fileVersion": "9.0.625.26613"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Fantasy.Tools.NetworkProtocol/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"CommandLineParser/2.9.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==",
|
||||
"path": "commandlineparser/2.9.1",
|
||||
"hashPath": "commandlineparser.2.9.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-VWB5jdkxHsRiuoniTqwOL32R4OWyp5If/bAucLjRJczRVNcwb8iCXKLjn3Inv8fv+jHMVMnvQLg7xhSys+y5PA==",
|
||||
"path": "microsoft.extensions.configuration/9.0.6",
|
||||
"hashPath": "microsoft.extensions.configuration.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Abstractions/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3GgMIi2jP8g1fBW93Z9b9Unamc0SIsgyhiCmC91gq4loTixK9vQMuxxUsfJ1kRGwn+/FqLKwOHqmn0oYWn3Fvw==",
|
||||
"path": "microsoft.extensions.configuration.abstractions/9.0.6",
|
||||
"hashPath": "microsoft.extensions.configuration.abstractions.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-pCEueasI5JhJ24KYzMFxtG40zyLnWpcQYawpARh9FNq9XbWozuWgexmdkPa8p8YoVNlpi3ecKfcjfoRMkKAufw==",
|
||||
"path": "microsoft.extensions.configuration.fileextensions/9.0.6",
|
||||
"hashPath": "microsoft.extensions.configuration.fileextensions.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-N0dgOYQ9tDzJouL9Tyx2dgMCcHV2pBaY8yVtorbDqYYwiDRS2zd1TbhTA2FMHqXF3SMjBoO+gONZcDoA79gdSA==",
|
||||
"path": "microsoft.extensions.configuration.json/9.0.6",
|
||||
"hashPath": "microsoft.extensions.configuration.json.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Abstractions/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-q9FPkSGVA9ipI255p3PBAvWNXas5Tzjyp/DwYSwT+46mIFw9fWZahsF6vHpoxLt5/vtANotH2sAm7HunuFIx9g==",
|
||||
"path": "microsoft.extensions.fileproviders.abstractions/9.0.6",
|
||||
"hashPath": "microsoft.extensions.fileproviders.abstractions.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileProviders.Physical/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-l+dFA0NRl90vSIiJNy5d7V0kpTEOWHTqbgoWYzlTwF5uiM5sWJ953haaELKE05jkyJdnemVTnqjrlgo4wo7oyg==",
|
||||
"path": "microsoft.extensions.fileproviders.physical/9.0.6",
|
||||
"hashPath": "microsoft.extensions.fileproviders.physical.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.FileSystemGlobbing/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-1HJCAbwukNEoYbHgHbKHmenU0V/0huw8+i7Qtf5rLUG1E+3kEwRJQxpwD3wbTEagIgPSQisNgJTvmUX9yYVc6g==",
|
||||
"path": "microsoft.extensions.filesystemglobbing/9.0.6",
|
||||
"hashPath": "microsoft.extensions.filesystemglobbing.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-BHniU24QV67qp1pJknqYSofAPYGmijGI8D+ci9yfw33iuFdyOeB9lWTg78ThyYLyQwZw3s0vZ36VMb0MqbUuLw==",
|
||||
"path": "microsoft.extensions.primitives/9.0.6",
|
||||
"hashPath": "microsoft.extensions.primitives.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"Newtonsoft.Json/13.0.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
|
||||
"path": "newtonsoft.json/13.0.3",
|
||||
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
|
||||
},
|
||||
"System.IO.Pipelines/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-0nlr0reXrRmkZNKifKqh2DgGhQgfkT7Qa3gQxIn/JI7/y3WDiTz67M+Sq3vFhUqcG8O5zVrpqHvIHeGPGUBsEw==",
|
||||
"path": "system.io.pipelines/9.0.6",
|
||||
"hashPath": "system.io.pipelines.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"System.Text.Encodings.Web/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-uWRgViw2yJAUyGxrzDLCc6fkzE2dZIoXxs8V6YjCujKsJuP0pnpYSlbm2/7tKd0SjBnMtwfDQhLenk3bXonVOA==",
|
||||
"path": "system.text.encodings.web/9.0.6",
|
||||
"hashPath": "system.text.encodings.web.9.0.6.nupkg.sha512"
|
||||
},
|
||||
"System.Text.Json/9.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-h+ZtYTyTnTh5Ju6mHCKb3FPGx4ylJZgm9W7Y2psUnkhQRPMOIxX+TCN0ZgaR/+Yea+93XHWAaMzYTar1/EHIPg==",
|
||||
"path": "system.text.json/9.0.6",
|
||||
"hashPath": "system.text.json.9.0.6.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Tools/NetworkProtocol2/Fantasy.Tools.NetworkProtocol.dll
Normal file
BIN
Tools/NetworkProtocol2/Fantasy.Tools.NetworkProtocol.dll
Normal file
Binary file not shown.
BIN
Tools/NetworkProtocol2/Fantasy.Tools.NetworkProtocol.pdb
Normal file
BIN
Tools/NetworkProtocol2/Fantasy.Tools.NetworkProtocol.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Tools/NetworkProtocol2/Microsoft.Extensions.Configuration.dll
Normal file
BIN
Tools/NetworkProtocol2/Microsoft.Extensions.Configuration.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Tools/NetworkProtocol2/Microsoft.Extensions.Primitives.dll
Normal file
BIN
Tools/NetworkProtocol2/Microsoft.Extensions.Primitives.dll
Normal file
Binary file not shown.
BIN
Tools/NetworkProtocol2/Newtonsoft.Json.dll
Normal file
BIN
Tools/NetworkProtocol2/Newtonsoft.Json.dll
Normal file
Binary file not shown.
23
Tools/NetworkProtocol2/Run.bat
Normal file
23
Tools/NetworkProtocol2/Run.bat
Normal file
@@ -0,0 +1,23 @@
|
||||
@echo off
|
||||
|
||||
echo Please select an option:
|
||||
echo 1. Client
|
||||
echo 2. Server
|
||||
echo 3. All
|
||||
|
||||
set /p choice=Please select an option:
|
||||
|
||||
if "%choice%"=="1" (
|
||||
echo Client
|
||||
dotnet Fantasy.Tools.NetworkProtocol.dll --p 1
|
||||
) else if "%choice%"=="2" (
|
||||
echo Server
|
||||
dotnet Fantasy.Tools.NetworkProtocol.dll --p 2
|
||||
) else if "%choice%"=="3" (
|
||||
echo All
|
||||
dotnet Fantasy.Tools.NetworkProtocol.dll --p 3
|
||||
) else (
|
||||
echo Invalid option
|
||||
)
|
||||
|
||||
PAUSE
|
||||
24
Tools/NetworkProtocol2/Run.sh
Normal file
24
Tools/NetworkProtocol2/Run.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "1. Client"
|
||||
echo "2. Server"
|
||||
echo "3. All"
|
||||
|
||||
read -n 1 -p "Please select an option:" choice
|
||||
echo ""
|
||||
echo ""
|
||||
script_dir=$(cd $(dirname $0) && pwd)
|
||||
case $choice in
|
||||
1)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 1 --f $script_dir
|
||||
;;
|
||||
2)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 2 --f $script_dir
|
||||
;;
|
||||
3)
|
||||
dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 3 --f $script_dir
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option"
|
||||
;;
|
||||
esac
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user