提交示例代码

This commit is contained in:
Bob.Song
2026-03-05 11:39:06 +08:00
commit 25958f58c3
2534 changed files with 209593 additions and 0 deletions

Binary file not shown.

View File

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

View File

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

View File

@@ -0,0 +1,10 @@
Bag
(
0
Equip
(
0
Trade
(
0

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 18b3ca5dd9ac140c0bfe37bbca653788
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,4 @@
$<10><> 装备上每秒恢复5点血
Gš ?装备上每次攻击增加6点攻击力最高增加了30点
&Ú 装备上增加100点法力值

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4fe08ccd5e9d64c0d86fdc05d5b37764
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
( (0008<><38> 88 8š 88
88
( (0008<><38> 88
8š 88
88
( (0008<><38> 88
8š 88
88

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f404ab74e1c414ce4b48a75124ab783b
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,13 @@
$<10><>= *
<08><> 
š 
Ú 
$„= *
<08><> 
š 
Ú 
$Ä= *
<08><> 
š 
Ú 

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a5ef48e9d971c4681bec1114de65961c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,4 @@

LoingError 登陆失败
&LoginRoleError角色登陆失败

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8c42beeb8a8954fac915d537c0e83e18
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,13 @@
\
æ<EFBFBD>¢å¤<EFBFBD>è<EFBFBD>¯å‰A!使用å<C2A8>Žï¼Œä¼šæ<C5A1><C3A6>å<EFBFBD>‡ä½“åŠ200ç¹ *Item_0108
@HPX`j10000j200
\
æ<EFBFBD>¢å¤<EFBFBD>è<EFBFBD>¯å‰B!使用å<C2A8>Žï¼Œä¼šæ<C5A1><C3A6>å<EFBFBD>‡ä½“åŠ400ç¹ *Item_0108
@HPX`j10001j400
}
æ<EFBFBD>¢å¤<EFBFBD>è<EFBFBD>¯å‰C6使用å<C2A8>Žï¼Œä¼šæ<C5A1><C3A6>å<EFBFBD>‡ä½“åŠ400ç¹ï¼Œæ<C592><C3A6>å<EFBFBD>‡æ³•åŠå€¼300 *Item_0108
@HPX`j10000j400j10001j300
PÁ„= 幻想大剑这个是ä»ç»<C3A7> *Item_018@HPX`j10000j200pdx
P„= 幻想头盔这个是ä»ç»<C3A7> *Item_028@HPX`j10000j200pdx
PÄ= 幻想衣æœ<C3A6>这个是ä»ç»<C3A7> *Item_038@HPX`j10000j200pdx

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 821d3ae21243f4cad86e04de1e07e327
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,5 @@
Unit01Unit01 
Unit02Unit02 
Unit03Unit03 
Unit04Unit04 

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 96bfccf115fa348f2a92c90013f84ca8
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,4 @@
(地精投资公å<C2AC>¸è<C2B8>Œå˜Unit03 (
+希尔瓦娜斯·风行者Unit02 0œN
 牛头人Unit01 8

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: eaf70b217678e4f4facf5905d990583f
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 82fa49f0c44ed4b95a5b2b5ce2efabb1
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,267 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 705507994}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &705507993
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 705507995}
- component: {fileID: 705507994}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &705507994
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 1
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &705507995
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &963194225
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 963194228}
- component: {fileID: 963194227}
- component: {fileID: 963194226}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &963194226
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
--- !u!20 &963194227
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &963194228
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9fc0d4010bbf28b4594072e72b8655ab
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@@ -0,0 +1,28 @@
using System.IO;
using Fantasy.ConfigTable;
using UnityEditor;
using UnityEngine;
namespace Fantasy
{
public class AssetsBundleManager : IConfigTableAssetBundle
{
public string Combine(string assetBundleDirectoryPath, string dataConfig)
{
return Path.Combine(assetBundleDirectoryPath, $"{dataConfig}.bytes");
}
public byte[] LoadConfigTable(string assetBundlePath)
{
#if UNITY_EDITOR || UNITY_EDITOR_64
if (File.Exists(assetBundlePath))
{
return AssetDatabase.LoadAssetAtPath<TextAsset>(assetBundlePath).bytes;
}
UnityEngine.Debug.LogError($"assetBundlePath:{assetBundlePath} not exist");
return null;
#else
#endif
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 87e30a9fb6ff422780ee0c1592fe053e
timeCreated: 1742869780

View File

@@ -0,0 +1,107 @@
using System.Collections;
using System.Collections.Generic;
using Fantasy;
using Fantasy.Async;
using Fantasy.ConfigTable;
using Fantasy.Network;
using UnityEngine;
using UnityEngine.UI;
using ErrorCode = UnityEditor.PackageManager.ErrorCode;
public class Entry : MonoBehaviour
{
private Scene _scene;
private Session _session;
public Button GameInitCompleteButton;
public Button StartCreateItemButton;
public Button UseItemButton;
public InputField UseItemId;
void Start()
{
StartAsync().Coroutine();
}
private async FTask StartAsync()
{
// 第一个参数,主要是为了兼容不容包管理器的路径
// Yoo、Addressable
// 路径 + 包名字 = 完整的路径
// Assets/Bundles/Config + Config.bytes = Assets/Bundles/Config/Config.bytes
ConfigTableHelper.Initialize("Assets/Bundles/Config", new AssetsBundleManager());
// 初始化框架
await Fantasy.Platform.Unity.Entry.Initialize(GetType().Assembly);
// 创建一个Scene这个Scene代表一个客户端的场景客户端的所有逻辑都可以写这里
// 如果有自己的框架也可以就单纯拿这个Scene做网络通讯也没问题。
_scene = await Scene.Create(SceneRuntimeType.MainThread);
// 用当前的Scene创建一个新的网络连接
_session = _scene.Connect(
"127.0.0.1:20000",
NetworkProtocolType.KCP,
OnConnectComplete,
OnConnectFail,
OnConnectDisconnect,
false, 5000);
var response = (G2C_LoginResponse)await _session.Call(new C2G_LoginRequest()
{
UserName = "Fantasy6666",PassWord = "666"
});
if (response.ErrorCode != 0)
{
Log.Error($"登陆失败,错误码 = {response.ErrorCode}");
return;
}
Log.Debug("收到G2C_TestResponse UserName:\"Fantasy\"");
GameInitCompleteButton.onClick.AddListener(() => OnGameInitCompleteButton().Coroutine());
StartCreateItemButton.onClick.AddListener(OnStartCreateItemButton);
UseItemButton.onClick.AddListener(() => OnUseItemButton().Coroutine());
}
private async FTask OnUseItemButton()
{
var itemId = long.Parse(UseItemId.text);
var response = await _session.Call(new C2G_UseItemRequest()
{
ItemId = itemId, Count = 1, ContainerType = 1
});
if (response.ErrorCode != 0)
{
Log.Error($"无法使用物品 ErrorCode:{response.ErrorCode}");
}
}
private async FTask OnGameInitCompleteButton()
{
var response = await _session.Call(new C2G_GameInitCompleteRequest()
{
PushContainer = true
});
if (response.ErrorCode != 0)
{
Log.Error($"无法跟服务器建立连接 ErrorCode:{response.ErrorCode}");
}
}
private void OnStartCreateItemButton()
{
_session.Send(new C2G_StartCreateItem());
}
private void OnConnectComplete()
{
Log.Debug("OnConnectComplete");
_session.AddComponent<SessionHeartbeatComponent>().Start(ConstValue.Heartbeat);
}
private void OnConnectFail()
{
Log.Debug("OnConnectFail");
}
private void OnConnectDisconnect()
{
Log.Debug("OnConnectDisconnect");
}
}

View File

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

View File

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

View File

@@ -0,0 +1,23 @@
using Fantasy.Async;
using Fantasy.Network;
using Fantasy.Network.Interface;
namespace Fantasy.Handler
{
public sealed class G2C_PushAllContainerInfoHandler : Message<G2C_PushAllContainerInfo>
{
protected override async FTask Run(Session session, G2C_PushAllContainerInfo message)
{
Log.Debug($"接收到服务器推送的容器消息 Containers : {message.Containers.Count}");
foreach (var messageContainer in message.Containers)
{
Log.Debug($"容器Id:{messageContainer.ConfigId} 容器格子数量:{messageContainer.Items.Count}");
foreach (var messageContainerItem in messageContainer.Items)
{
Log.Debug($"Id:{messageContainerItem.ItemId} ConfigId:{messageContainerItem.ConfigId} Count:{messageContainerItem.Count}");
}
}
await FTask.CompletedTask;
}
}
}

View File

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

View File

@@ -0,0 +1,19 @@
using Fantasy.Async;
using Fantasy.Network;
using Fantasy.Network.Interface;
namespace Fantasy
{
public sealed class G2C_UpdateItemsHandler : Message<G2C_UpdateItems>
{
protected override async FTask Run(Session session, G2C_UpdateItems message)
{
Log.Debug($"收到容器中物品更新的消息 ItemReason:{message.ItemReason} Items:{message.Items.Count}");
foreach (var messageItem in message.Items)
{
Log.Debug($" ContainerType:{messageItem.Container} Id:{messageItem.ItemId} ConfigId:{messageItem.ConfigId} Count:{messageItem.Count}");
}
await FTask.CompletedTask;
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,10 @@
namespace Fantasy
{
public partial class ErrorCode
{
public static string GetText(uint errorCode)
{
return ErrorCodeData.Instance.Get(errorCode).Text;
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4d9f327360a24d41b52855d149c87578
timeCreated: 1742971118

View File

@@ -0,0 +1,11 @@
namespace Fantasy
{
public partial class LevelConfig
{
public bool IsGroup1;
public override void EndInit()
{
IsGroup1 = Group == 1;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9dd377279fae44f4850cacc93b7010ed
timeCreated: 1742971691

View File

@@ -0,0 +1,26 @@
using System.Collections.Generic;
using Fantasy.DataStructure.Collection;
namespace Fantasy
{
public partial class LevelConfigData
{
private readonly OneToManyList<uint, LevelConfig> _levelConfigsByGroup = new OneToManyList<uint, LevelConfig>();
public override void EndInit()
{
foreach (var levelConfig in List)
{
_levelConfigsByGroup.Add(levelConfig.Group, levelConfig);
}
}
public List<LevelConfig> GetLevelConfigByGroup(uint group)
{
return _levelConfigsByGroup[group];
}
public bool TryGetLevelConfigByGroup(uint group, out List<LevelConfig> levelConfig)
{
return _levelConfigsByGroup.TryGetValue(group, out levelConfig);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bc1dd9007e40493cb31de31aabdf1a8c
timeCreated: 1742971129

View File

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

View File

@@ -0,0 +1,105 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Fantasy.ConfigTable;
using Fantasy.Serialize;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CS0169
#pragma warning disable CS8618
#pragma warning disable CS8625
#pragma warning disable CS8603
namespace Fantasy
{
[ProtoContract]
public sealed partial class ContainerConfigData : ASerialize, IConfigTable, IProto
{
[ProtoMember(1)]
public List<ContainerConfig> List { get; set; } = new List<ContainerConfig>();
#if FANTASY_NET
[ProtoIgnore]
private readonly ConcurrentDictionary<uint, ContainerConfig> _configs = new ConcurrentDictionary<uint, ContainerConfig>();
#else
[ProtoIgnore]
private readonly Dictionary<uint, ContainerConfig> _configs = new Dictionary<uint, ContainerConfig>();
#endif
private static ContainerConfigData _instance = null;
public static ContainerConfigData Instance
{
get { return _instance ??= ConfigTableHelper.Load<ContainerConfigData>(); }
private set => _instance = value;
}
public ContainerConfig Get(uint id, bool check = true)
{
if (_configs.ContainsKey(id))
{
return _configs[id];
}
if (check)
{
throw new Exception($"ContainerConfig not find {id} Id");
}
return null;
}
public bool TryGet(uint id, out ContainerConfig config)
{
config = null;
if (!_configs.ContainsKey(id))
{
return false;
}
config = _configs[id];
return true;
}
public override void AfterDeserialization()
{
foreach (var config in List)
{
#if FANTASY_NET
_configs.TryAdd(config.Id, config);
#else
_configs.Add(config.Id, config);
#endif
config.AfterDeserialization();
}
EndInit();
}
public override void Dispose()
{
Instance = null;
}
}
[ProtoContract]
public sealed partial class ContainerConfig : ASerialize, IProto
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public string Name { get; set; } // 名字
[ProtoMember(3)]
public int Type { get; set; } // 容器类型
[ProtoMember(4)]
public int CellCountMax { get; set; } // 容器最大的格子数
[ProtoMember(5)]
public int CellCount { get; set; } // 初始解锁格子
[ProtoMember(6)]
public bool CanSort { get; set; } // 是否可以整理
[ProtoMember(7)]
public int SortCD { get; set; } // 是否可以整理
}
}

View File

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

View File

@@ -0,0 +1,97 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Fantasy.ConfigTable;
using Fantasy.Serialize;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CS0169
#pragma warning disable CS8618
#pragma warning disable CS8625
#pragma warning disable CS8603
namespace Fantasy
{
[ProtoContract]
public sealed partial class EquipAffixConfigData : ASerialize, IConfigTable, IProto
{
[ProtoMember(1)]
public List<EquipAffixConfig> List { get; set; } = new List<EquipAffixConfig>();
#if FANTASY_NET
[ProtoIgnore]
private readonly ConcurrentDictionary<uint, EquipAffixConfig> _configs = new ConcurrentDictionary<uint, EquipAffixConfig>();
#else
[ProtoIgnore]
private readonly Dictionary<uint, EquipAffixConfig> _configs = new Dictionary<uint, EquipAffixConfig>();
#endif
private static EquipAffixConfigData _instance = null;
public static EquipAffixConfigData Instance
{
get { return _instance ??= ConfigTableHelper.Load<EquipAffixConfigData>(); }
private set => _instance = value;
}
public EquipAffixConfig Get(uint id, bool check = true)
{
if (_configs.ContainsKey(id))
{
return _configs[id];
}
if (check)
{
throw new Exception($"EquipAffixConfig not find {id} Id");
}
return null;
}
public bool TryGet(uint id, out EquipAffixConfig config)
{
config = null;
if (!_configs.ContainsKey(id))
{
return false;
}
config = _configs[id];
return true;
}
public override void AfterDeserialization()
{
foreach (var config in List)
{
#if FANTASY_NET
_configs.TryAdd(config.Id, config);
#else
_configs.Add(config.Id, config);
#endif
config.AfterDeserialization();
}
EndInit();
}
public override void Dispose()
{
Instance = null;
}
}
[ProtoContract]
public sealed partial class EquipAffixConfig : ASerialize, IProto
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public uint BuffConfigId { get; set; } // 触发的Buff
[ProtoMember(3)]
public string Descride { get; set; } // 介绍
}
}

View File

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

View File

@@ -0,0 +1,105 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Fantasy.ConfigTable;
using Fantasy.Serialize;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CS0169
#pragma warning disable CS8618
#pragma warning disable CS8625
#pragma warning disable CS8603
namespace Fantasy
{
[ProtoContract]
public sealed partial class EquipEntryConfigData : ASerialize, IConfigTable, IProto
{
[ProtoMember(1)]
public List<EquipEntryConfig> List { get; set; } = new List<EquipEntryConfig>();
#if FANTASY_NET
[ProtoIgnore]
private readonly ConcurrentDictionary<uint, EquipEntryConfig> _configs = new ConcurrentDictionary<uint, EquipEntryConfig>();
#else
[ProtoIgnore]
private readonly Dictionary<uint, EquipEntryConfig> _configs = new Dictionary<uint, EquipEntryConfig>();
#endif
private static EquipEntryConfigData _instance = null;
public static EquipEntryConfigData Instance
{
get { return _instance ??= ConfigTableHelper.Load<EquipEntryConfigData>(); }
private set => _instance = value;
}
public EquipEntryConfig Get(uint id, bool check = true)
{
if (_configs.ContainsKey(id))
{
return _configs[id];
}
if (check)
{
throw new Exception($"EquipEntryConfig not find {id} Id");
}
return null;
}
public bool TryGet(uint id, out EquipEntryConfig config)
{
config = null;
if (!_configs.ContainsKey(id))
{
return false;
}
config = _configs[id];
return true;
}
public override void AfterDeserialization()
{
foreach (var config in List)
{
#if FANTASY_NET
_configs.TryAdd(config.Id, config);
#else
_configs.Add(config.Id, config);
#endif
config.AfterDeserialization();
}
EndInit();
}
public override void Dispose()
{
Instance = null;
}
}
[ProtoContract]
public sealed partial class EquipEntryConfig : ASerialize, IProto
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public int Min { get; set; } // 词条最小数
[ProtoMember(3)]
public int Max { get; set; } // 词条最大数
[ProtoMember(4)]
public int AffixMin { get; set; } // 词缀最小数
[ProtoMember(5)]
public int AffixMax { get; set; } // 词缀最大数
[ProtoMember(6)]
public uint[] Affix { get; set; } = Array.Empty<uint>(); // 词缀列表
[ProtoMember(7)]
public int[] Attrs { get; set; } = Array.Empty<int>(); // 属性数组
}
}

View File

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

View File

@@ -0,0 +1,101 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Fantasy.ConfigTable;
using Fantasy.Serialize;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CS0169
#pragma warning disable CS8618
#pragma warning disable CS8625
#pragma warning disable CS8603
namespace Fantasy
{
[ProtoContract]
public sealed partial class EquipValueConfigData : ASerialize, IConfigTable, IProto
{
[ProtoMember(1)]
public List<EquipValueConfig> List { get; set; } = new List<EquipValueConfig>();
#if FANTASY_NET
[ProtoIgnore]
private readonly ConcurrentDictionary<uint, EquipValueConfig> _configs = new ConcurrentDictionary<uint, EquipValueConfig>();
#else
[ProtoIgnore]
private readonly Dictionary<uint, EquipValueConfig> _configs = new Dictionary<uint, EquipValueConfig>();
#endif
private static EquipValueConfigData _instance = null;
public static EquipValueConfigData Instance
{
get { return _instance ??= ConfigTableHelper.Load<EquipValueConfigData>(); }
private set => _instance = value;
}
public EquipValueConfig Get(uint id, bool check = true)
{
if (_configs.ContainsKey(id))
{
return _configs[id];
}
if (check)
{
throw new Exception($"EquipValueConfig not find {id} Id");
}
return null;
}
public bool TryGet(uint id, out EquipValueConfig config)
{
config = null;
if (!_configs.ContainsKey(id))
{
return false;
}
config = _configs[id];
return true;
}
public override void AfterDeserialization()
{
foreach (var config in List)
{
#if FANTASY_NET
_configs.TryAdd(config.Id, config);
#else
_configs.Add(config.Id, config);
#endif
config.AfterDeserialization();
}
EndInit();
}
public override void Dispose()
{
Instance = null;
}
}
[ProtoContract]
public sealed partial class EquipValueConfig : ASerialize, IProto
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public uint ItemConfigId { get; set; } // ItemConfigId
[ProtoMember(3)]
public uint EquipEntryConfigId { get; set; } // EquipEntryConfigId
[ProtoMember(4)]
public int Quality { get; set; } // 品质
[ProtoMember(5)]
public IntDictionaryConfig MainAttrs { get; set; } // 法术强度
}
}

View File

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

View File

@@ -0,0 +1,97 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Fantasy.ConfigTable;
using Fantasy.Serialize;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CS0169
#pragma warning disable CS8618
#pragma warning disable CS8625
#pragma warning disable CS8603
namespace Fantasy
{
[ProtoContract]
public sealed partial class ErrorCodeData : ASerialize, IConfigTable, IProto
{
[ProtoMember(1)]
public List<ErrorCode> List { get; set; } = new List<ErrorCode>();
#if FANTASY_NET
[ProtoIgnore]
private readonly ConcurrentDictionary<uint, ErrorCode> _configs = new ConcurrentDictionary<uint, ErrorCode>();
#else
[ProtoIgnore]
private readonly Dictionary<uint, ErrorCode> _configs = new Dictionary<uint, ErrorCode>();
#endif
private static ErrorCodeData _instance = null;
public static ErrorCodeData Instance
{
get { return _instance ??= ConfigTableHelper.Load<ErrorCodeData>(); }
private set => _instance = value;
}
public ErrorCode Get(uint id, bool check = true)
{
if (_configs.ContainsKey(id))
{
return _configs[id];
}
if (check)
{
throw new Exception($"ErrorCode not find {id} Id");
}
return null;
}
public bool TryGet(uint id, out ErrorCode config)
{
config = null;
if (!_configs.ContainsKey(id))
{
return false;
}
config = _configs[id];
return true;
}
public override void AfterDeserialization()
{
foreach (var config in List)
{
#if FANTASY_NET
_configs.TryAdd(config.Id, config);
#else
_configs.Add(config.Id, config);
#endif
config.AfterDeserialization();
}
EndInit();
}
public override void Dispose()
{
Instance = null;
}
}
[ProtoContract]
public sealed partial class ErrorCode : ASerialize, IProto
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public string Name { get; set; } // 名称
[ProtoMember(3)]
public string Text { get; set; } // 文本内容
}
}

View File

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

View File

@@ -0,0 +1,123 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Fantasy.ConfigTable;
using Fantasy.Serialize;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CS0169
#pragma warning disable CS8618
#pragma warning disable CS8625
#pragma warning disable CS8603
namespace Fantasy
{
[ProtoContract]
public sealed partial class ItemConfigData : ASerialize, IConfigTable, IProto
{
[ProtoMember(1)]
public List<ItemConfig> List { get; set; } = new List<ItemConfig>();
#if FANTASY_NET
[ProtoIgnore]
private readonly ConcurrentDictionary<uint, ItemConfig> _configs = new ConcurrentDictionary<uint, ItemConfig>();
#else
[ProtoIgnore]
private readonly Dictionary<uint, ItemConfig> _configs = new Dictionary<uint, ItemConfig>();
#endif
private static ItemConfigData _instance = null;
public static ItemConfigData Instance
{
get { return _instance ??= ConfigTableHelper.Load<ItemConfigData>(); }
private set => _instance = value;
}
public ItemConfig Get(uint id, bool check = true)
{
if (_configs.ContainsKey(id))
{
return _configs[id];
}
if (check)
{
throw new Exception($"ItemConfig not find {id} Id");
}
return null;
}
public bool TryGet(uint id, out ItemConfig config)
{
config = null;
if (!_configs.ContainsKey(id))
{
return false;
}
config = _configs[id];
return true;
}
public override void AfterDeserialization()
{
foreach (var config in List)
{
#if FANTASY_NET
_configs.TryAdd(config.Id, config);
#else
_configs.Add(config.Id, config);
#endif
config.AfterDeserialization();
}
EndInit();
}
public override void Dispose()
{
Instance = null;
}
}
[ProtoContract]
public sealed partial class ItemConfig : ASerialize, IProto
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public string Name { get; set; } // 名称
[ProtoMember(3)]
public string Descride { get; set; } // 描述
[ProtoMember(4)]
public int Weight { get; set; } // 排序权重
[ProtoMember(5)]
public string Model2D { get; set; } // 对应模型
[ProtoMember(6)]
public bool Superposed { get; set; } // 是否可以叠加
[ProtoMember(7)]
public uint SuperposedMax { get; set; } // 叠加
[ProtoMember(8)]
public uint Type { get; set; } // 类型
[ProtoMember(9)]
public bool IsDeal { get; set; } // 是否可以交易
[ProtoMember(10)]
public bool IsSell { get; set; } // 是否可以出售
[ProtoMember(11)]
public int[] Sell { get; set; } = Array.Empty<int>(); // 出售价格
[ProtoMember(12)]
public int Effect { get; set; } // 使用效果
[ProtoMember(13)]
public string[] Params { get; set; } = Array.Empty<string>(); // 效果参数
[ProtoMember(14)]
public int Durable { get; set; } // 耐久度
[ProtoMember(15)]
public int Quality { get; set; } // 品质
[ProtoMember(16)]
public int Position { get; set; } // 装备位置
}
}

View File

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

View File

@@ -0,0 +1,99 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Fantasy.ConfigTable;
using Fantasy.Serialize;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CS0169
#pragma warning disable CS8618
#pragma warning disable CS8625
#pragma warning disable CS8603
namespace Fantasy
{
[ProtoContract]
public sealed partial class LevelConfigData : ASerialize, IConfigTable, IProto
{
[ProtoMember(1)]
public List<LevelConfig> List { get; set; } = new List<LevelConfig>();
#if FANTASY_NET
[ProtoIgnore]
private readonly ConcurrentDictionary<uint, LevelConfig> _configs = new ConcurrentDictionary<uint, LevelConfig>();
#else
[ProtoIgnore]
private readonly Dictionary<uint, LevelConfig> _configs = new Dictionary<uint, LevelConfig>();
#endif
private static LevelConfigData _instance = null;
public static LevelConfigData Instance
{
get { return _instance ??= ConfigTableHelper.Load<LevelConfigData>(); }
private set => _instance = value;
}
public LevelConfig Get(uint id, bool check = true)
{
if (_configs.ContainsKey(id))
{
return _configs[id];
}
if (check)
{
throw new Exception($"LevelConfig not find {id} Id");
}
return null;
}
public bool TryGet(uint id, out LevelConfig config)
{
config = null;
if (!_configs.ContainsKey(id))
{
return false;
}
config = _configs[id];
return true;
}
public override void AfterDeserialization()
{
foreach (var config in List)
{
#if FANTASY_NET
_configs.TryAdd(config.Id, config);
#else
_configs.Add(config.Id, config);
#endif
config.AfterDeserialization();
}
EndInit();
}
public override void Dispose()
{
Instance = null;
}
}
[ProtoContract]
public sealed partial class LevelConfig : ASerialize, IProto
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public string Name { get; set; } // 名称
[ProtoMember(3)]
public string Model { get; set; } // 数据库类型
[ProtoMember(4)]
public uint Group { get; set; } // 分组
}
}

View File

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

View File

@@ -0,0 +1,105 @@
using System;
using ProtoBuf;
using Fantasy;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Concurrent;
using Fantasy.ConfigTable;
using Fantasy.Serialize;
// ReSharper disable CollectionNeverUpdated.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CS0169
#pragma warning disable CS8618
#pragma warning disable CS8625
#pragma warning disable CS8603
namespace Fantasy
{
[ProtoContract]
public sealed partial class UnitConfigData : ASerialize, IConfigTable, IProto
{
[ProtoMember(1)]
public List<UnitConfig> List { get; set; } = new List<UnitConfig>();
#if FANTASY_NET
[ProtoIgnore]
private readonly ConcurrentDictionary<uint, UnitConfig> _configs = new ConcurrentDictionary<uint, UnitConfig>();
#else
[ProtoIgnore]
private readonly Dictionary<uint, UnitConfig> _configs = new Dictionary<uint, UnitConfig>();
#endif
private static UnitConfigData _instance = null;
public static UnitConfigData Instance
{
get { return _instance ??= ConfigTableHelper.Load<UnitConfigData>(); }
private set => _instance = value;
}
public UnitConfig Get(uint id, bool check = true)
{
if (_configs.ContainsKey(id))
{
return _configs[id];
}
if (check)
{
throw new Exception($"UnitConfig not find {id} Id");
}
return null;
}
public bool TryGet(uint id, out UnitConfig config)
{
config = null;
if (!_configs.ContainsKey(id))
{
return false;
}
config = _configs[id];
return true;
}
public override void AfterDeserialization()
{
foreach (var config in List)
{
#if FANTASY_NET
_configs.TryAdd(config.Id, config);
#else
_configs.Add(config.Id, config);
#endif
config.AfterDeserialization();
}
EndInit();
}
public override void Dispose()
{
Instance = null;
}
}
[ProtoContract]
public sealed partial class UnitConfig : ASerialize, IProto
{
[ProtoMember(1)]
public uint Id { get; set; } // Id
[ProtoMember(2)]
public string Name { get; set; } // 名称
[ProtoMember(3)]
public string Model { get; set; } // 数据库类型
[ProtoMember(4)]
public uint Type { get; set; } // 类型
[ProtoMember(5)]
public uint MonsterPRange { get; set; } // 怪物追击范围
[ProtoMember(6)]
public uint TalkConfigId { get; set; } // NPC对话列表Id
[ProtoMember(7)]
public uint Camp { get; set; } // 玩家阵营
}
}

View File

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

View File

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

View File

@@ -0,0 +1,27 @@
namespace Fantasy
{
// 生成器自动生成,请不要手动编辑,修改请在#ConstValue.xsl里。
public partial class ConstValue
{
/// <summary>
/// 游戏版本
/// </summary>
public const string Version = "v202501";
/// <summary>
/// 可以创建角色的最大数量
/// </summary>
public const int CreateRoleMax = 5;
/// <summary>
/// 客户端使用的网络类型
/// </summary>
public const string Network = "KCP";
/// <summary>
/// 客户端发送心跳的时间(毫秒单位)
/// </summary>
public const int Heartbeat = 2000;
/// <summary>
/// 服务器最大容纳玩家人数
/// </summary>
public const int PlayerCount = 5000;
}
}

View File

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

View File

@@ -0,0 +1,16 @@
using System;
namespace Fantasy
{
// 生成器自动生成,请不要手动编辑,修改请在ContainerConfig.xsl里。
[Flags]
public enum ContainerType : byte
{
None = 0,
Bag = 1,// 背包
Equip = 2,// 装备栏
Trade = 4,// 交易
Cell = Equip | Trade,// 按格子存储的容器
Normal = Bag,// 正常的容器
}
}

View File

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

View File

@@ -0,0 +1,15 @@
namespace Fantasy
{
// 生成器自动生成,请不要手动编辑,修改请在ErrorCode.xsl里。
public partial class ErrorCode
{
/// <summary>
/// 登陆失败
/// </summary>
public const uint LoingError = 1;
/// <summary>
/// 角色登陆失败
/// </summary>
public const uint LoginRoleError = 2;
}
}

View File

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

View File

@@ -0,0 +1,12 @@
namespace Fantasy
{
// 生成器自动生成,请不要手动编辑,修改请在#ItemType.xsl里。
public enum ItemType
{
None = 0,
Drug = 1,// 药品
Equip = 2,// 装备
Prop = 3,// 道具
Garbage = 4,// 垃圾
}
}

View File

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

View File

@@ -0,0 +1,12 @@
namespace Fantasy
{
// 生成器自动生成,请不要手动编辑,修改请在#ItemUseEffect.xsl里。
public enum ItemUseEffect
{
None = 0,
Equip = 1,// 装备到身上
UnEquip = 2,// 从身上卸下
AddAttr = 3,// 增加属性
CutAttr = 4,// 减少属性
}
}

View File

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

View File

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

View File

@@ -0,0 +1,341 @@
using ProtoBuf;
using System.Collections.Generic;
using Fantasy;
using Fantasy.Network.Interface;
using Fantasy.Serialize;
#pragma warning disable CS8618
namespace Fantasy
{
/// <summary>
/// 客户端登陆到服务器
/// </summary>
[ProtoContract]
public partial class C2G_LoginRequest : AMessage, IRequest, IProto
{
public static C2G_LoginRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2G_LoginRequest>();
}
public override void Dispose()
{
UserName = default;
PassWord = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2G_LoginRequest>(this);
#endif
}
[ProtoIgnore]
public G2C_LoginResponse ResponseType { get; set; }
public uint OpCode() { return OuterOpcode.C2G_LoginRequest; }
[ProtoMember(1)]
public string UserName { get; set; }
[ProtoMember(2)]
public string PassWord { get; set; }
}
/// <summary>
/// 服务器返回登陆状态给客户端
/// </summary>
[ProtoContract]
public partial class G2C_LoginResponse : AMessage, IResponse, IProto
{
public static G2C_LoginResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<G2C_LoginResponse>();
}
public override void Dispose()
{
ErrorCode = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<G2C_LoginResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.G2C_LoginResponse; }
[ProtoMember(1)]
public uint ErrorCode { get; set; }
}
/// <summary>
/// 客户端请求服务器使用物品
/// </summary>
[ProtoContract]
public partial class C2G_UseItemRequest : AMessage, IRequest, IProto
{
public static C2G_UseItemRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2G_UseItemRequest>();
}
public override void Dispose()
{
ItemId = default;
Count = default;
ContainerType = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2G_UseItemRequest>(this);
#endif
}
[ProtoIgnore]
public G2C_UseItemResponse ResponseType { get; set; }
public uint OpCode() { return OuterOpcode.C2G_UseItemRequest; }
[ProtoMember(1)]
public long ItemId { get; set; }
[ProtoMember(2)]
public int Count { get; set; }
[ProtoMember(3)]
public int ContainerType { get; set; }
}
[ProtoContract]
public partial class G2C_UseItemResponse : AMessage, IResponse, IProto
{
public static G2C_UseItemResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<G2C_UseItemResponse>();
}
public override void Dispose()
{
ErrorCode = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<G2C_UseItemResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.G2C_UseItemResponse; }
[ProtoMember(1)]
public uint ErrorCode { get; set; }
}
/// <summary>
/// 装备基础信息类
/// </summary>
[ProtoContract]
public partial class EquipInfo : AMessage, IProto
{
public static EquipInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<EquipInfo>();
}
public override void Dispose()
{
Durable = default;
DurableMax = default;
MainKeys.Clear();
EquipAttrKeys.Clear();
EquipAttrValues.Clear();
EquipAttrSValues.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<EquipInfo>(this);
#endif
}
[ProtoMember(1)]
public int Durable { get; set; }
[ProtoMember(2)]
public int DurableMax { get; set; }
[ProtoMember(3)]
public List<int> MainKeys = new List<int>();
[ProtoMember(4)]
public List<int> EquipAttrKeys = new List<int>();
[ProtoMember(5)]
public List<int> EquipAttrValues = new List<int>();
[ProtoMember(6)]
public List<int> EquipAttrSValues = new List<int>();
///<summary>
/// 比如强化等级,副属性,词缀等。都可以在这里添加
///</summary>
}
/// <summary>
/// 物品基础信息类
/// </summary>
[ProtoContract]
public partial class ItemInfo : AMessage, IProto
{
public static ItemInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<ItemInfo>();
}
public override void Dispose()
{
ItemId = default;
Container = default;
ConfigId = default;
CellId = default;
Count = default;
IsBind = default;
EquipInfo = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<ItemInfo>(this);
#endif
}
[ProtoMember(1)]
public long ItemId { get; set; }
[ProtoMember(2)]
public int Container { get; set; }
[ProtoMember(3)]
public int ConfigId { get; set; }
[ProtoMember(4)]
public long CellId { get; set; }
[ProtoMember(5)]
public int Count { get; set; }
[ProtoMember(6)]
public bool IsBind { get; set; }
[ProtoMember(7)]
public EquipInfo EquipInfo { get; set; }
///<summary>
/// 后面可能会有装备词条 也会在这里定义的,现在没有所以就是先不管了
///</summary>
}
/// <summary>
/// 容器信息类
/// </summary>
[ProtoContract]
public partial class ContainerInfo : AMessage, IProto
{
public static ContainerInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<ContainerInfo>();
}
public override void Dispose()
{
CurrentCellCount = default;
ConfigId = default;
Items.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<ContainerInfo>(this);
#endif
}
[ProtoMember(1)]
public int CurrentCellCount { get; set; }
[ProtoMember(2)]
public int ConfigId { get; set; }
[ProtoMember(3)]
public List<ItemInfo> Items = new List<ItemInfo>();
}
/// <summary>
/// 物品变更协议(服务器推送给客户端)
/// </summary>
[ProtoContract]
public partial class G2C_UpdateItems : AMessage, IMessage, IProto
{
public static G2C_UpdateItems Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<G2C_UpdateItems>();
}
public override void Dispose()
{
ItemReason = default;
Items.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<G2C_UpdateItems>(this);
#endif
}
public uint OpCode() { return OuterOpcode.G2C_UpdateItems; }
[ProtoMember(1)]
public int ItemReason { get; set; }
[ProtoMember(2)]
public List<ItemInfo> Items = new List<ItemInfo>();
}
/// <summary>
/// 通知服务器客户端初始化完成
/// </summary>
[ProtoContract]
public partial class C2G_GameInitCompleteRequest : AMessage, IRequest, IProto
{
public static C2G_GameInitCompleteRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2G_GameInitCompleteRequest>();
}
public override void Dispose()
{
PushContainer = default;
PushUnitInfo = default;
Aoi = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2G_GameInitCompleteRequest>(this);
#endif
}
[ProtoIgnore]
public G2C_GameInitCompleteResponse ResponseType { get; set; }
public uint OpCode() { return OuterOpcode.C2G_GameInitCompleteRequest; }
[ProtoMember(1)]
public bool PushContainer { get; set; }
[ProtoMember(2)]
public bool PushUnitInfo { get; set; }
[ProtoMember(3)]
public bool Aoi { get; set; }
}
[ProtoContract]
public partial class G2C_GameInitCompleteResponse : AMessage, IResponse, IProto
{
public static G2C_GameInitCompleteResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<G2C_GameInitCompleteResponse>();
}
public override void Dispose()
{
ErrorCode = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<G2C_GameInitCompleteResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.G2C_GameInitCompleteResponse; }
[ProtoMember(1)]
public uint ErrorCode { get; set; }
}
/// <summary>
/// 推送所有容器数据给客户端
/// </summary>
[ProtoContract]
public partial class G2C_PushAllContainerInfo : AMessage, IMessage, IProto
{
public static G2C_PushAllContainerInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<G2C_PushAllContainerInfo>();
}
public override void Dispose()
{
Containers.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<G2C_PushAllContainerInfo>(this);
#endif
}
public uint OpCode() { return OuterOpcode.G2C_PushAllContainerInfo; }
[ProtoMember(1)]
public List<ContainerInfo> Containers = new List<ContainerInfo>();
}
/// <summary>
/// 推送单个的容器数据给客户端
/// </summary>
[ProtoContract]
public partial class G2C_PushContainerInfo : AMessage, IMessage, IProto
{
public static G2C_PushContainerInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<G2C_PushContainerInfo>();
}
public override void Dispose()
{
Container = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<G2C_PushContainerInfo>(this);
#endif
}
public uint OpCode() { return OuterOpcode.G2C_PushContainerInfo; }
[ProtoMember(1)]
public ContainerInfo Container { get; set; }
}
/// <summary>
/// 通知服务器创建一个物品到背包容器中。
/// </summary>
[ProtoContract]
public partial class C2G_StartCreateItem : AMessage, IMessage, IProto
{
public static C2G_StartCreateItem Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2G_StartCreateItem>();
}
public override void Dispose()
{
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2G_StartCreateItem>(this);
#endif
}
public uint OpCode() { return OuterOpcode.C2G_StartCreateItem; }
}
}

View File

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

View File

@@ -0,0 +1,16 @@
namespace Fantasy
{
public static partial class OuterOpcode
{
public const uint C2G_LoginRequest = 268445457;
public const uint G2C_LoginResponse = 402663185;
public const uint C2G_UseItemRequest = 268445458;
public const uint G2C_UseItemResponse = 402663186;
public const uint G2C_UpdateItems = 134227729;
public const uint C2G_GameInitCompleteRequest = 268445459;
public const uint G2C_GameInitCompleteResponse = 402663187;
public const uint G2C_PushAllContainerInfo = 134227730;
public const uint G2C_PushContainerInfo = 134227731;
public const uint C2G_StartCreateItem = 134227732;
}
}

View File

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

View File

@@ -0,0 +1,9 @@
namespace Fantasy
{
// Route协议定义(需要定义1000以上、因为1000以内的框架预留)
public static class RouteType
{
public const int GateRoute = 1001; // Gate
public const int ChatRoute = 1002; // Chat
}
}

View File

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