提交修改

This commit is contained in:
Bob.Song
2026-03-19 16:14:33 +08:00
parent c2ec7226c0
commit 34070d0769
90 changed files with 3016 additions and 1765 deletions

View File

@@ -19,6 +19,8 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Game\Condition\" />
<Folder Include="Game\FishFarm\" />
<Folder Include="Game\Map\Weather\" />
<Folder Include="Generate\ConfigTable\" />
<Folder Include="Generate\NetworkProtocol\" />

View File

@@ -0,0 +1,42 @@
namespace NB.Game;
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class ItemUseAttribute : Attribute
{
public ItemUseEffect Type { get; }
public ItemUseAttribute(ItemUseEffect type)
{
Type = type;
}
}
public enum ItemUseEffect
{
None = 0,
Equip = 1, // 装备到身上
UnEquip = 2, // 从身上卸下
AddAttr = 3, // 增加属性
CutAttr = 4, // 减少属性
}
public interface IItemUse
{
/// <summary>
/// 正常的情况下应该是使用Unit,因为这个代表的是某一个单位。
/// 由于课程中没有这个Unit所以暂时用Account来代替。
/// </summary>
/// <param name="player"></param>
/// <param name="config"></param>
/// <param name="count"></param>
/// <returns></returns>
uint CanUse(Player player, cfg.Item config, ref int count);
/// <summary>
/// 使用物品的逻辑。
/// </summary>
/// <param name="player"></param>
/// <param name="config"></param>
/// <param name="count"></param>
void Use(Player player, cfg.Item config, ref int count);
}

View File

@@ -9,7 +9,7 @@ public enum ItemBasicType
Currency = 1,
Item = 2,
Rod = 3,
Reel =4,
Reel = 4,
Bobber = 5,
Line = 6,
Bait = 7,
@@ -60,4 +60,4 @@ public class Item : Entity
/// 正则使用中
/// </summary>
[BsonIgnore] public bool InUse;
}
}

View File

@@ -0,0 +1,196 @@
using Fantasy;
using Fantasy.Assembly;
using Fantasy.Async;
using Fantasy.DataStructure.Collection;
using Fantasy.Entitas;
namespace NB.Game;
public class ItemUseComponent : Entity, IAssemblyLifecycle
{
private readonly Dictionary<int, IItemUse> _handlers = new Dictionary<int, IItemUse>();
private readonly OneToManyList<long, int> _assemblyHandlers = new OneToManyList<long, int>();
public override void Dispose()
{
base.Dispose();
_handlers.Clear();
_assemblyHandlers.Clear();
}
public async FTask Initialize()
{
// 注册到生命周期中
await AssemblyLifecycle.Add(this);
}
#region Assembly
public async FTask OnLoad(AssemblyManifest assemblyManifest)
{
var tcs = FTask.Create(false);
Scene.ThreadSynchronizationContext.Post(() =>
{
InnerLoad(assemblyManifest);
tcs.SetResult();
});
await tcs;
}
public async FTask OnUnload(AssemblyManifest assemblyManifest)
{
var tcs = FTask.Create(false);
Scene.ThreadSynchronizationContext.Post(() =>
{
InnerUnLoad(assemblyManifest);
tcs.SetResult();
});
await tcs;
}
private void InnerLoad(AssemblyManifest assemblyManifest)
{
var assembly = assemblyManifest.Assembly;
var assemblyIdentity = assemblyManifest.AssemblyManifestId;
foreach (var type in assembly.GetTypes())
{
if (!typeof(IItemUse).IsAssignableFrom(type))
{
continue;
}
if (type.IsInterface || type.IsAbstract)
{
continue;
}
var customAttributes = type.GetCustomAttributes(typeof(ItemUseAttribute), false);
if (customAttributes.Length == 0)
{
Log.Warning(
$"type {type.FullName} Implemented the interface of IItemUse, requiring the implementation of ItemUseAttribute");
continue;
}
var instance = (IItemUse)Activator.CreateInstance(type)!;
foreach (ItemUseAttribute customAttribute in customAttributes)
{
var customAttributeType = (int)customAttribute.Type;
_handlers.Add(customAttributeType, instance);
_assemblyHandlers.Add(assemblyIdentity, customAttributeType);
}
}
}
private void InnerUnLoad(AssemblyManifest assemblyManifest)
{
var assemblyIdentity = assemblyManifest.AssemblyManifestId;
if (!_assemblyHandlers.TryGetValue(assemblyIdentity, out var assemblyHandlers))
{
return;
}
foreach (var assemblyHandler in assemblyHandlers)
{
_handlers.Remove(assemblyHandler);
}
_assemblyHandlers.Remove(assemblyIdentity);
}
#endregion
public uint CanUse(Player account, cfg.Item config, ref int count)
{
var itemUseEffect = (ItemUseEffect)config.Effect;
if (itemUseEffect == ItemUseEffect.None)
{
Log.Error($"config.Effect is zero!");
return 1;
}
return CanUse(account, config, itemUseEffect, ref count);
}
public void Use(Player account, cfg.Item config, ref int count)
{
var itemUseEffect = (ItemUseEffect)config.Effect;
if (itemUseEffect == ItemUseEffect.None)
{
Log.Error($"config.Effect is zero!");
return;
}
if (!_handlers.TryGetValue((int)itemUseEffect, out var handler))
{
return;
}
handler.Use(account, config, ref count);
}
public uint UseHandler(Player account, cfg.Item config, ref int count)
{
var itemUseEffect = (ItemUseEffect)config.Effect;
if (itemUseEffect == ItemUseEffect.None)
{
Log.Error($"config.Effect is zero!");
return 1;
}
if (!_handlers.TryGetValue((int)itemUseEffect, out var handler))
{
return 0;
}
var canUse = handler.CanUse(account, config, ref count);
if (canUse != 0)
{
return canUse;
}
handler.Use(account, config, ref count);
return 0;
}
public uint CanUse(Player account, cfg.Item config, ItemUseEffect itemUseEffect, ref int count)
{
if (!_handlers.TryGetValue((int)itemUseEffect, out var handler))
{
return 0;
}
return handler.CanUse(account, config, ref count);
}
public void Use(Player account, cfg.Item config, ItemUseEffect itemUseEffect, ref int count)
{
if (!_handlers.TryGetValue((int)itemUseEffect, out var handler))
{
return;
}
handler.Use(account, config, ref count);
}
public uint UseHandler(Player account, cfg.Item config, ItemUseEffect itemUseEffect, ref int count)
{
if (!_handlers.TryGetValue((int)itemUseEffect, out var handler))
{
return 0;
}
var canUse = handler.CanUse(account, config, ref count);
if (canUse != 0)
{
return canUse;
}
handler.Use(account, config, ref count);
return 0;
}
}

View File

@@ -0,0 +1,36 @@
using Fantasy;
using Fantasy.DataStructure.Collection;
using Fantasy.Entitas;
namespace NB;
/// <summary>
/// 邮件物流中转中心,用来存放所有离线的邮件。
/// 玩家可以在上线的第一时间去这里领取属于自己的邮件。
/// </summary>
public class MailBoxManageComponent : Entity
{
// 定时清楚过期邮件的时间
public const int MailCheckTIme = 10000;
// 存放所有邮箱都会在这里,包括发送给个人的和所有人的邮件。
public readonly Dictionary<long, MailBox> MailBoxes = new Dictionary<long, MailBox>();
// 个人领取邮件列表
public readonly OneToManyList<long, MailBox> MailsByAccount = new OneToManyList<long, MailBox>();
// 按照邮件箱类型存储
public readonly OneToManyList<int, MailBox> MailsByMailBoxType = new OneToManyList<int, MailBox>();
// 按照时间排序的邮件箱
public readonly SortedOneToManyList<long, long> Timers = new SortedOneToManyList<long, long>();
// 临时的存放过期时间的队列
public readonly Queue<long> TimeOutQueue = new Queue<long>();
// 时间任务的Id
public long TimerId;
// 最小的时间
public long MinTime;
}

View File

@@ -0,0 +1,27 @@
using System.Collections.Generic;
using Fantasy.DataStructure.Collection;
using Fantasy.Entitas;
using Fantasy.Helper;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace NB;
/// <summary>
/// 这个代表一个用户身上所有邮件的组件
/// </summary>
public sealed class MailComponent : Entity
{
// 最大的邮件数量
public const int MaxMailCount = 50;
// 邮件的过期时间,这个是过期7天时间。
public const int MailExpireTime = 1000 * 60 * 60 * 24 * 7;
// 玩家的邮件
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
public Dictionary<long, Mail> Mails = new Dictionary<long, Mail>();
// 按照时间进行排序
[BsonIgnore] public readonly SortedOneToManyList<long, long> Timer = new SortedOneToManyList<long, long>();
}

View File

@@ -0,0 +1,26 @@
using System.Collections.Generic;
using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes;
using NB.Game;
namespace NB;
/// <summary>
/// 代表游戏中的一封邮件实体
/// </summary>
public sealed class Mail : Entity
{
// 这个代表里游戏中的一封邮件
// 标题、内容、金钱、物品
public long OwnerId; // 邮件拥有者的Id(AccountId、UnitId、RoleId)
public string Title; // 邮件的标题
public string Content; // 邮件的内容
public long CreateTime; // 邮件的创建时间
public long ExpireTime; // 邮件的过期时间(决定这个实体的生命周期)
public int Money; // 邮件的中钱
public MailState MailState; // 邮件的状态
public MailType MailType; // 邮件的类型
public List<Item> Items = new List<Item>(); // 邮件中的物品
// [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
// public Dictionary<long,Item> Items = new Dictionary<long,Item>();
}

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using Fantasy.Entitas;
using NB;
namespace Fantasy;
/// <summary>
/// 邮件箱
/// </summary>
public sealed class MailBox : Entity
{
// 快递
// 快递包装、用盒子。然后这个盒子上有一个标签、收件人、发件人、快递的公司。
// 这个盒子了。可以装任何不同种类的东西。
// 一对一、我发一个快递,给张三和李四。
// 但是邮件可能会有这个的功能,比如给某一个范围的人发送同一份邮件,比如补偿、或者奖励。
public Mail Mail; // 邮件
public long CreateTime; // 箱子的创建时间
public long ExpireTime; // 箱子的过期时间
public MailBoxType MailBoxType; // 箱子的类型
public HashSet<long> AccountId = new HashSet<long>(); // 收件人
public HashSet<long> Received = new HashSet<long>(); // 领取过的人
public long SendAccountId; // 发件人/发送人
}

View File

@@ -0,0 +1,58 @@
// using System.Collections.Generic;
// using Fantasy.Entitas;
// using MongoDB.Bson.Serialization.Attributes;
//
// namespace NB.Chat;
//
// public class MailConversation : Entity
// {
// /// <summary>
// /// 第一id
// /// </summary>
// [BsonElement("id1")] public long FirstId;
//
// /// <summary>
// /// 第二id
// /// </summary>
// [BsonElement("id2")] public long SecondId;
//
// /// <summary>
// /// 会话
// /// </summary>
// [BsonElement("list")] public List<Mail> Mails = new List<Mail>();
//
// /// <summary>
// /// 第一个阅读时间
// /// </summary>
// [BsonElement("ft")] public long FirstReadTime;
//
// /// <summary>
// /// 第二阅读时间
// /// </summary>
// [BsonElement("st")] public long SecondReadTime;
//
// /// <summary>
// /// 最后更新时间
// /// </summary>
// [BsonElement("ut")] public long UpdateTime;
//
// /// <summary>
// /// 删除人标志
// /// </summary>
// [BsonElement("rid")] public HashSet<long> RemoveId = new HashSet<long>();
//
// /// <summary>
// /// 会话keyid-id按大小排序
// /// </summary>
// [BsonIgnore] public string Key = string.Empty;
//
// /// <summary>
// /// 最后保存时间
// /// </summary>
// [BsonIgnore] public long NeedSaveTime = 0;
//
// /// <summary>
// /// 需要保存
// /// </summary>
// [BsonIgnore] public bool NeedSave;
// }

View File

@@ -0,0 +1,35 @@
namespace NB;
public enum MailType
{
None = 0,
System = 1, // 系统邮件
Rewards = 2, // 奖励邮件(擂台、有奖问答)
User = 3, // 个人邮件(玩家给玩家之间发送)
}
public enum MailState
{
None = 0,
Unread = 1, // 未读
HaveRead = 2, // 已读
NotClaimed = 3, // 未领取
Received = 4, // 已领取
}
public enum MailBoxType
{
None = 0,
Specify = 1, // 指定目标
Online = 2, // 给在线所有人发送邮件
All = 3, // 所有人
AllToDate = 4, // 根据玩家注册的时间发送邮件
}
public enum MailRemoveActionType
{
None = 0,
Remove = 1, // 手动移除
ExpireTimeRemove = 2, // 过期时间移除
Overtop = 3, // 超过邮件上限移除
}

View File

@@ -62,6 +62,11 @@ public sealed class Player : Entity
/// </summary>
[BsonElement("vExTime")] public long VipExpirationTime;
/// <summary>
/// 创建时间
/// </summary>
public long CreateTime;
[BsonIgnore] public long SessionRunTimeId;

View File

@@ -1,35 +0,0 @@
using System.Collections.Generic;
using Fantasy.DataStructure.Collection;
using Fantasy.Entitas;
using Fantasy.Helper;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.Options;
namespace NB.Chat;
/// <summary>
/// 玩家邮件组件
/// </summary>
public class MailComponent : Entity
{
/// <summary>
/// 最大邮件数据
/// </summary>
public const int MaxMailCount = 50;
/// <summary>
/// 邮件最大保留时间
/// </summary>
public const long MaxExpireTime = TimeHelper.OneDay * 365;
/// <summary>
/// 邮件列表
/// </summary>
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
public Dictionary<long, Mail> Mails = new Dictionary<long, Mail>();
/// <summary>
/// 按照时间进行排序
/// </summary>
[BsonIgnore] public readonly SortedOneToManyListPool<long, long> Timer = new SortedOneToManyListPool<long, long>();
}

View File

@@ -1,20 +0,0 @@
using System.Collections.Generic;
using Fantasy.Entitas;
namespace NB.Chat;
/// <summary>
/// 邮件管理组件
/// </summary>
public class MailManageComponent : Entity
{
/// <summary>
/// 会话列表
/// </summary>
public Dictionary<string, MailConversation> Conversations = new Dictionary<string, MailConversation>();
/// <summary>
/// 缓存了的列表
/// </summary>
public HashSet<long> CacheRoleIds = new HashSet<long>();
}

View File

@@ -1,49 +0,0 @@
using System.Collections.Generic;
using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes;
using NB.Game;
namespace NB.Chat;
public sealed class Mail : Entity
{
/// <summary>
/// 邮件发送者
/// </summary>
[BsonElement("send")] public long Sender;
/// <summary>
/// 邮件拥有者
/// </summary>
[BsonElement("owner")] public long OwnerId;
/// <summary>
/// 邮件状态
/// </summary>
[BsonElement("state")] public MailState State = MailState.None;
/// <summary>
/// 邮件状态
/// </summary>
[BsonElement("type")] public MailType MailType = MailType.None;
/// <summary>
/// 邮件内容
/// </summary>
[BsonElement("con")] public string Content;
/// <summary>
/// 创建时间
/// </summary>
[BsonElement("ct")] public long CreateTime;
/// <summary>
/// 过期时间
/// </summary>
[BsonElement("et")] public long ExpireTime;
/// <summary>
/// 邮件的附件内容
/// </summary>
[BsonElement("item")] public List<AwardItem> Items = new List<AwardItem>();
}

View File

@@ -1,45 +0,0 @@
using System.Collections.Generic;
using Fantasy.Entitas;
namespace NB.Chat;
/// <summary>
/// 邮件箱,系统群发用
/// </summary>
public class MailBox : Entity
{
/// <summary>
/// 邮件
/// </summary>
public Mail Mail;
/// <summary>
/// 创建时间
/// </summary>
public long CreateTime;
/// <summary>
/// 失效时间
/// </summary>
public long ExpireTime;
/// <summary>
/// 邮箱类型
/// </summary>
public MailBoxType BoxType;
/// <summary>
/// 发送人
/// </summary>
public long SendAccountId = 0;
/// <summary>
/// 收件人
/// </summary>
public HashSet<long> AccountId = new HashSet<long>();
/// <summary>
/// 领取过的人
/// </summary>
public HashSet<long> Received = new HashSet<long>();
}

View File

@@ -1,58 +0,0 @@
using System.Collections.Generic;
using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes;
namespace NB.Chat;
public class MailConversation : Entity
{
/// <summary>
/// 第一id
/// </summary>
[BsonElement("id1")] public long FirstId;
/// <summary>
/// 第二id
/// </summary>
[BsonElement("id2")] public long SecondId;
/// <summary>
/// 会话
/// </summary>
[BsonElement("list")] public List<Mail> Mails = new List<Mail>();
/// <summary>
/// 第一个阅读时间
/// </summary>
[BsonElement("ft")] public long FirstReadTime;
/// <summary>
/// 第二阅读时间
/// </summary>
[BsonElement("st")] public long SecondReadTime;
/// <summary>
/// 最后更新时间
/// </summary>
[BsonElement("ut")] public long UpdateTime;
/// <summary>
/// 删除人标志
/// </summary>
[BsonElement("rid")] public HashSet<long> RemoveId = new HashSet<long>();
/// <summary>
/// 会话keyid-id按大小排序
/// </summary>
[BsonIgnore] public string Key = string.Empty;
/// <summary>
/// 最后保存时间
/// </summary>
[BsonIgnore] public long NeedSaveTime = 0;
/// <summary>
/// 需要保存
/// </summary>
[BsonIgnore] public bool NeedSave;
}

View File

@@ -1,54 +0,0 @@
namespace NB.Chat;
public enum MailType
{
None = 0,
System = 1, //系统邮件
Rewards = 2, //奖励邮件
User = 3, //个人邮件
}
public enum MailState
{
None = 0,
/// <summary>
/// 未读
/// </summary>
Unread = 1,
/// <summary>
/// 已读
/// </summary>
HaveRead = 2,
/// <summary>
/// 未领取
/// </summary>
NotClaimed = 3,
/// <summary>
/// 已领取
/// </summary>
Received = 4,
/// <summary>
/// 已删除
/// </summary>
Deleted = 5,
}
public enum MailBoxType
{
None = 0,
/// <summary>
/// 指定目标
/// </summary>
Specify = 1,
/// <summary>
/// 全部人
/// </summary>
All = 2
}

View File

@@ -1,33 +0,0 @@
// using Fantasy;
// using Fantasy.Entitas;
//
// namespace NB.Chat;
//
// public sealed class SocialUnit : Entity
// {
// public long GateRouteId;
//
// public RoleSimpleInfo Role;
//
// /// <summary>
// /// 当前所在地图
// /// </summary>
// public long MapId;
//
//
// public readonly Dictionary<long, ChatChannelComponent> Channels = new();
// public readonly Dictionary<int, long> SendTime = new Dictionary<int, long>();
//
//
// public override void Dispose()
// {
// if (IsDisposed)
// {
// return;
// }
//
// GateRouteId = 0;
// Role = null;
// base.Dispose();
// }
// }

View File

@@ -1,17 +0,0 @@
// using System.Collections.Generic;
// using Fantasy;
// using Fantasy.DataStructure.Collection;
// using Fantasy.Entitas;
//
// namespace NB.Chat;
//
// public class SocialUnitManageComponent : Entity
// {
// public readonly Dictionary<long, SocialUnit> Units = new();
//
// // public List<MailBox>
// // /// <summary>
// // /// 不在线消息缓存
// // /// </summary>
// // public readonly OneToManyList<long, ChatMessageInfo> NotSendMessage = new();
// }

View File

@@ -25,6 +25,7 @@ public sealed partial class Fish : Luban.BeanBase
MinWeight = (int)_obj.GetValue("min_weight");
MaxWeight = (int)_obj.GetValue("max_weight");
Accept = (int)_obj.GetValue("accept");
Water = (int)_obj.GetValue("water");
}
public static Fish DeserializeFish(JToken _buf)
@@ -52,6 +53,10 @@ public sealed partial class Fish : Luban.BeanBase
/// 接受的鱼饵配置组
/// </summary>
public readonly int Accept;
/// <summary>
/// 需要的水
/// </summary>
public readonly int Water;
public const int __ID__ = 2189944;
@@ -69,6 +74,7 @@ public sealed partial class Fish : Luban.BeanBase
+ "minWeight:" + MinWeight + ","
+ "maxWeight:" + MaxWeight + ","
+ "accept:" + Accept + ","
+ "water:" + Water + ","
+ "}";
}
}

View File

@@ -28,6 +28,7 @@ public sealed partial class Item : Luban.BeanBase
Length = (int)_obj.GetValue("length");
Max = (int)_obj.GetValue("max");
AutoUse = (int)_obj.GetValue("auto_use");
Effect = (int)_obj.GetValue("effect");
{ var __json0 = _obj.GetValue("result1"); Result1 = new System.Collections.Generic.List<int>((__json0 as JArray).Count); foreach(JToken __e0 in __json0) { int __v0; __v0 = (int)__e0; Result1.Add(__v0); } }
{ var __json0 = _obj.GetValue("result2"); Result2 = new System.Collections.Generic.List<string>((__json0 as JArray).Count); foreach(JToken __e0 in __json0) { string __v0; __v0 = (string)__e0; Result2.Add(__v0); } }
}
@@ -70,6 +71,10 @@ public sealed partial class Item : Luban.BeanBase
/// </summary>
public readonly int AutoUse;
/// <summary>
/// 使用效果
/// </summary>
public readonly int Effect;
/// <summary>
/// 使用参数1
/// </summary>
public readonly System.Collections.Generic.List<int> Result1;
@@ -97,6 +102,7 @@ public sealed partial class Item : Luban.BeanBase
+ "length:" + Length + ","
+ "max:" + Max + ","
+ "autoUse:" + AutoUse + ","
+ "effect:" + Effect + ","
+ "result1:" + Luban.StringUtil.CollectionToString(Result1) + ","
+ "result2:" + Luban.StringUtil.CollectionToString(Result2) + ","
+ "}";

View File

@@ -0,0 +1,64 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using Luban;
using Newtonsoft.Json.Linq;
namespace cfg
{
public sealed partial class Leader : Luban.BeanBase
{
public Leader(JToken _buf)
{
JObject _obj = _buf as JObject;
Id = (int)_obj.GetValue("id");
Strength = (int)_obj.GetValue("strength");
Size = (int)_obj.GetValue("size");
}
public static Leader DeserializeLeader(JToken _buf)
{
return new Leader(_buf);
}
/// <summary>
/// Id
/// </summary>
public readonly int Id;
/// <summary>
/// 强度
/// </summary>
public readonly int Strength;
/// <summary>
/// 尺寸
/// </summary>
public readonly int Size;
public const int __ID__ = -2022887127;
public override int GetTypeId() => __ID__;
public void ResolveRef(Tables tables)
{
}
public override string ToString()
{
return "{ "
+ "id:" + Id + ","
+ "strength:" + Strength + ","
+ "size:" + Size + ","
+ "}";
}
}
}

View File

@@ -50,6 +50,10 @@ public partial class Tables
/// </summary>
public TbItem TbItem {get; }
/// <summary>
/// 引线
/// </summary>
public TbLeader TbLeader {get; }
/// <summary>
/// 鱼线
/// </summary>
public TbLine TbLine {get; }
@@ -82,6 +86,7 @@ public partial class Tables
TbHook = new TbHook(loader("tbhook"));
TbInitItemConfig = new TbInitItemConfig(loader("tbinititemconfig"));
TbItem = new TbItem(loader("tbitem"));
TbLeader = new TbLeader(loader("tbleader"));
TbLine = new TbLine(loader("tbline"));
TbLure = new TbLure(loader("tblure"));
TbReel = new TbReel(loader("tbreel"));
@@ -101,6 +106,7 @@ public partial class Tables
TbHook.ResolveRef(this);
TbInitItemConfig.ResolveRef(this);
TbItem.ResolveRef(this);
TbLeader.ResolveRef(this);
TbLine.ResolveRef(this);
TbLure.ResolveRef(this);
TbReel.ResolveRef(this);

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using Newtonsoft.Json.Linq;
using Luban;
namespace cfg
{
/// <summary>
/// 引线
/// </summary>
public partial class TbLeader
{
private readonly System.Collections.Generic.Dictionary<int, Leader> _dataMap;
private readonly System.Collections.Generic.List<Leader> _dataList;
public TbLeader(JArray _buf)
{
_dataMap = new System.Collections.Generic.Dictionary<int, Leader>(_buf.Count);
_dataList = new System.Collections.Generic.List<Leader>(_buf.Count);
foreach(JObject _ele in _buf)
{
Leader _v;
_v = global::cfg.Leader.DeserializeLeader(_ele);
_dataList.Add(_v);
_dataMap.Add(_v.Id, _v);
}
}
public System.Collections.Generic.Dictionary<int, Leader> DataMap => _dataMap;
public System.Collections.Generic.List<Leader> DataList => _dataList;
public Leader GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : default;
public Leader Get(int key) => _dataMap[key];
public Leader this[int key] => _dataMap[key];
public void ResolveRef(Tables tables)
{
foreach(var _v in _dataList)
{
_v.ResolveRef(tables);
}
}
}
}

View File

@@ -678,4 +678,89 @@ namespace Fantasy
[ProtoMember(1)]
public ChatInfoTree ChatInfoTree { get; set; }
}
/// <summary>
/// 其他服务器发送邮件
/// </summary>
////////// ******** 邮件 *******/////////////
public partial class Other2Mail_SendMailRequest : AMessage, IAddressRequest
{
public static Other2Mail_SendMailRequest Create(bool autoReturn = true)
{
var other2Mail_SendMailRequest = MessageObjectPool<Other2Mail_SendMailRequest>.Rent();
other2Mail_SendMailRequest.AutoReturn = autoReturn;
if (!autoReturn)
{
other2Mail_SendMailRequest.SetIsPool(false);
}
return other2Mail_SendMailRequest;
}
public void Return()
{
if (!AutoReturn)
{
SetIsPool(true);
AutoReturn = true;
}
else if (!IsPool())
{
return;
}
Dispose();
}
public void Dispose()
{
if (!IsPool()) return;
MailBox = default;
MessageObjectPool<Other2Mail_SendMailRequest>.Return(this);
}
public uint OpCode() { return InnerOpcode.Other2Mail_SendMailRequest; }
[BsonIgnore]
public Mail2Other_SendMailResponse ResponseType { get; set; }
public MailBox MailBox { get; set; }
}
[Serializable]
[ProtoContract]
public partial class Mail2Other_SendMailResponse : AMessage, IAddressResponse
{
public static Mail2Other_SendMailResponse Create(bool autoReturn = true)
{
var mail2Other_SendMailResponse = MessageObjectPool<Mail2Other_SendMailResponse>.Rent();
mail2Other_SendMailResponse.AutoReturn = autoReturn;
if (!autoReturn)
{
mail2Other_SendMailResponse.SetIsPool(false);
}
return mail2Other_SendMailResponse;
}
public void Return()
{
if (!AutoReturn)
{
SetIsPool(true);
AutoReturn = true;
}
else if (!IsPool())
{
return;
}
Dispose();
}
public void Dispose()
{
if (!IsPool()) return;
ErrorCode = 0;
MessageObjectPool<Mail2Other_SendMailResponse>.Return(this);
}
public uint OpCode() { return InnerOpcode.Mail2Other_SendMailResponse; }
[ProtoMember(1)]
public uint ErrorCode { get; set; }
}
}

View File

@@ -20,5 +20,7 @@ namespace Fantasy
public const uint Map2G_ExiRoomResponse = 1207969557;
public const uint Chat2G_ChatMessage = 939534099;
public const uint Other2Chat_ChatMessage = 939534100;
public const uint Other2Mail_SendMailRequest = 1082140438;
public const uint Mail2Other_SendMailResponse = 1207969558;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -27,63 +27,69 @@ namespace Fantasy
public const uint Game2C_RewardNotify = 2147493651;
public const uint C2Game_GMRequest = 2281711385;
public const uint Game2C_GMResponse = 2415929113;
public const uint C2Game_CreateRoomRequest = 2281711386;
public const uint Game2C_CreateRoomResponse = 2415929114;
public const uint C2Mail_TestRequest = 2281711386;
public const uint Mail2C_TestResponse = 2415929114;
public const uint Mail2C_HaveMail = 2147493652;
public const uint Mail2C_MailState = 2147493653;
public const uint C2Mail_GetHaveMailRequest = 2281711387;
public const uint Mail2C_GetHaveMailResposne = 2415929115;
public const uint C2Mail_OpenMailRequest = 2281711388;
public const uint Mail2C_OpenMailResposne = 2415929116;
public const uint C2Mail_ReceiveMailRequest = 2281711389;
public const uint Mail2C_ReceiveMailResponse = 2415929117;
public const uint C2Mail_RemoveMailRequest = 2281711390;
public const uint Mail2C_RemoveMailResponse = 2415929118;
public const uint C2Mail_SendMailRequest = 2281711391;
public const uint Mail2C_SendMailResponse = 2415929119;
public const uint C2Game_CreateRoomRequest = 2281711392;
public const uint Game2C_CreateRoomResponse = 2415929120;
public const uint C2G_ExitRoomRequest = 268445457;
public const uint G2C_ExitRoomResponse = 402663185;
public const uint C2G_EnterMapRequest = 268445458;
public const uint G2C_EnterMapResponse = 402663186;
public const uint Game2C_ChangeMap = 2147493652;
public const uint Game2C_ChangeMap = 2147493654;
public const uint C2A_LoginRequest = 268445459;
public const uint A2C_LoginResponse = 402663187;
public const uint C2G_LoginRequest = 268445460;
public const uint G2C_LoginResponse = 402663188;
public const uint G2C_RepeatLogin = 134227729;
public const uint C2Game_GetRoleInfoRequest = 2281711387;
public const uint Game2C_GetRoleInfoResponse = 2415929115;
public const uint Game2C_RoleEnterRoomNotify = 2147493653;
public const uint Game2C_RoleExitRoomNotify = 2147493654;
public const uint C2Game_TakeItemRequest = 2281711388;
public const uint Game2C_TakeItemResponse = 2415929116;
public const uint C2Game_RolePropertyChange = 2147493655;
public const uint Game2C_RoleStateNotify = 2147493656;
public const uint Game2C_RoleGearChangeNotify = 2147493657;
public const uint Game2C_RolePropertyChangeNotify = 2147493658;
public const uint C2Game_Move = 2147493659;
public const uint C2Game_Look = 2147493660;
public const uint Game2C_MoveNotify = 2147493661;
public const uint Game2C_LookeNotify = 2147493662;
public const uint C2Game_GetConversationsRequest = 2281711389;
public const uint Game2C_GetConversationsResponse = 2415929117;
public const uint C2Game_SendMailRequest = 2281711390;
public const uint Game2C_SendMailResponse = 2415929118;
public const uint C2Game_DeleteMailRequest = 2281711391;
public const uint Game2C_DeleteMailResponse = 2415929119;
public const uint Game2C_HaveMail = 2147493663;
public const uint Game2C_MailState = 2147493664;
public const uint C2Game_SendMessageRequest = 2281711392;
public const uint Game2C_SendMessageResponse = 2415929120;
public const uint C2Game_GetRoleInfoRequest = 2281711393;
public const uint Game2C_GetRoleInfoResponse = 2415929121;
public const uint Game2C_RoleEnterRoomNotify = 2147493655;
public const uint Game2C_RoleExitRoomNotify = 2147493656;
public const uint C2Game_TakeItemRequest = 2281711394;
public const uint Game2C_TakeItemResponse = 2415929122;
public const uint C2Game_RolePropertyChange = 2147493657;
public const uint Game2C_RoleStateNotify = 2147493658;
public const uint Game2C_RoleGearChangeNotify = 2147493659;
public const uint Game2C_RolePropertyChangeNotify = 2147493660;
public const uint C2Game_Move = 2147493661;
public const uint C2Game_Look = 2147493662;
public const uint Game2C_MoveNotify = 2147493663;
public const uint Game2C_LookeNotify = 2147493664;
public const uint C2Game_SendMessageRequest = 2281711395;
public const uint Game2C_SendMessageResponse = 2415929123;
public const uint Game2C_Message = 2147493665;
public const uint C2Game_CreateChannelRequest = 2281711393;
public const uint Game2C_CreateChannelResponse = 2415929121;
public const uint C2Game_JoinChannelRequest = 2281711394;
public const uint Game2C_JoinChannelResponse = 2415929122;
public const uint C2Game_CreateClubRequest = 2281711395;
public const uint Game2C_CreateClubResponse = 2415929123;
public const uint C2Game_GetClubInfoRequest = 2281711396;
public const uint Game2C_GetClubInfoResponse = 2415929124;
public const uint C2Game_GetMemberListRequest = 2281711397;
public const uint Game2C_GetMemberListResponse = 2415929125;
public const uint C2Game_GetClubListRequest = 2281711398;
public const uint Game2C_GetClubListResponse = 2415929126;
public const uint C2Game_JoinClubRequest = 2281711399;
public const uint Game2C_JoinClubResponse = 2415929127;
public const uint C2Game_LeaveClubRequest = 2281711400;
public const uint Game2C_LeaveClubResponse = 2415929128;
public const uint C2Game_DissolveClubRequest = 2281711401;
public const uint Game2C_DissolveClubResponse = 2415929129;
public const uint C2Game_DisposeJoinRequest = 2281711402;
public const uint Game2C_DisposeJoinResponse = 2415929130;
public const uint C2Game_CreateChannelRequest = 2281711396;
public const uint Game2C_CreateChannelResponse = 2415929124;
public const uint C2Game_JoinChannelRequest = 2281711397;
public const uint Game2C_JoinChannelResponse = 2415929125;
public const uint C2Game_CreateClubRequest = 2281711398;
public const uint Game2C_CreateClubResponse = 2415929126;
public const uint C2Game_GetClubInfoRequest = 2281711399;
public const uint Game2C_GetClubInfoResponse = 2415929127;
public const uint C2Game_GetMemberListRequest = 2281711400;
public const uint Game2C_GetMemberListResponse = 2415929128;
public const uint C2Game_GetClubListRequest = 2281711401;
public const uint Game2C_GetClubListResponse = 2415929129;
public const uint C2Game_JoinClubRequest = 2281711402;
public const uint Game2C_JoinClubResponse = 2415929130;
public const uint C2Game_LeaveClubRequest = 2281711403;
public const uint Game2C_LeaveClubResponse = 2415929131;
public const uint C2Game_DissolveClubRequest = 2281711404;
public const uint Game2C_DissolveClubResponse = 2415929132;
public const uint C2Game_DisposeJoinRequest = 2281711405;
public const uint Game2C_DisposeJoinResponse = 2415929133;
public const uint Game2C_ClubChange = 2147493666;
}
}