提交背包获取协议
This commit is contained in:
@@ -73,7 +73,7 @@ message ItemBindInfo
|
||||
///物品信息
|
||||
message ItemInfo
|
||||
{
|
||||
int32 ConfigId = 1; //配置id
|
||||
uint32 ConfigId = 1; //配置id
|
||||
int64 Id = 2; //物品id
|
||||
int32 Count = 3; //数量
|
||||
int64 ExpirationTime = 4; //失效时间
|
||||
@@ -84,7 +84,7 @@ message ItemInfo
|
||||
///fish信息
|
||||
message FishInfo
|
||||
{
|
||||
int32 ConfigId = 1; //配置id
|
||||
uint32 ConfigId = 1; //配置id
|
||||
int64 Id = 2; //物品id
|
||||
int32 Weight =3; //重量
|
||||
int64 GetTime = 4; //获得时间
|
||||
@@ -103,7 +103,7 @@ message ActivityInfo
|
||||
///技能情况
|
||||
message SkillInfo
|
||||
{
|
||||
int32 ConfigId = 1; //技能配置id
|
||||
uint32 ConfigId = 1; //技能配置id
|
||||
int32 Level = 2; //技能等级
|
||||
int32 Exp = 3; //技能经验
|
||||
}
|
||||
@@ -252,7 +252,7 @@ namespace Fantasy
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public int ConfigId { get; set; }
|
||||
public uint ConfigId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long Id { get; set; }
|
||||
[ProtoMember(3)]
|
||||
@@ -286,7 +286,7 @@ namespace Fantasy
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public int ConfigId { get; set; }
|
||||
public uint ConfigId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long Id { get; set; }
|
||||
[ProtoMember(3)]
|
||||
@@ -342,7 +342,7 @@ namespace Fantasy
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public int ConfigId { get; set; }
|
||||
public uint ConfigId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public int Level { get; set; }
|
||||
[ProtoMember(3)]
|
||||
|
||||
@@ -142,6 +142,64 @@ namespace Fantasy
|
||||
public List<long> Removes = new List<long>();
|
||||
}
|
||||
/// <summary>
|
||||
/// /////////// ******** 钓组 *******/////////////
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// 请求安装或取下配件
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Game_RigChangeRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Game_RigChangeRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Game_RigChangeRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
RodId = default;
|
||||
RigId = default;
|
||||
IsAdd = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Game_RigChangeRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Game2C_RigChangeResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2Game_RigChangeRequest; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.GameRoute;
|
||||
[ProtoMember(1)]
|
||||
public long RodId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long RigId { get; set; }
|
||||
[ProtoMember(3)]
|
||||
public bool IsAdd { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求安装配件响应
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Game2C_RigChangeResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Game2C_RigChangeResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Game2C_RigChangeResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Rigs = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Game2C_RigChangeResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Game2C_RigChangeResponse; }
|
||||
[ProtoMember(1)]
|
||||
public ItemBindInfo Rigs { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// /////////// ******** 鱼护 *******/////////////
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
|
||||
@@ -7,15 +7,17 @@ namespace Fantasy
|
||||
public const uint C2Game_UseItemRequest = 2281711378;
|
||||
public const uint Game2C_UseItemResponse = 2415929106;
|
||||
public const uint Game2C_ItemChange = 2147493649;
|
||||
public const uint C2Game_GetFishsRequest = 2281711379;
|
||||
public const uint Game2C_GetFishsResponse = 2415929107;
|
||||
public const uint C2Game_RigChangeRequest = 2281711379;
|
||||
public const uint Game2C_RigChangeResponse = 2415929107;
|
||||
public const uint C2Game_GetFishsRequest = 2281711380;
|
||||
public const uint Game2C_GetFishsResponse = 2415929108;
|
||||
public const uint Game2C_FishChange = 2147493650;
|
||||
public const uint C2Game_SellFishRequest = 2281711380;
|
||||
public const uint Game2C_SellFishResponse = 2415929108;
|
||||
public const uint C2Game_BuyRequest = 2281711381;
|
||||
public const uint Game2C_BuyResponse = 2415929109;
|
||||
public const uint C2Map_CreateRoomRequest = 2281711382;
|
||||
public const uint Map2C_CreateRoomResponse = 2415929110;
|
||||
public const uint C2Game_SellFishRequest = 2281711381;
|
||||
public const uint Game2C_SellFishResponse = 2415929109;
|
||||
public const uint C2Game_BuyRequest = 2281711382;
|
||||
public const uint Game2C_BuyResponse = 2415929110;
|
||||
public const uint C2Map_CreateRoomRequest = 2281711383;
|
||||
public const uint Map2C_CreateRoomResponse = 2415929111;
|
||||
public const uint C2G_ExitRoomRequest = 268445457;
|
||||
public const uint G2C_ExitRoomResponse = 402663185;
|
||||
public const uint C2G_EnterMapRequest = 268445458;
|
||||
@@ -26,8 +28,8 @@ namespace Fantasy
|
||||
public const uint C2G_LoginRequest = 268445460;
|
||||
public const uint G2C_LoginResponse = 402663188;
|
||||
public const uint G2C_RepeatLogin = 134227729;
|
||||
public const uint C2Game_GetRoleInfoRequest = 2281711383;
|
||||
public const uint Game2C_GetRoleInfoResponse = 2415929111;
|
||||
public const uint C2Game_GetRoleInfoRequest = 2281711384;
|
||||
public const uint Game2C_GetRoleInfoResponse = 2415929112;
|
||||
public const uint Map2C_RoleEnterRoomNotify = 2147493652;
|
||||
public const uint Map2C_RoleExitRoomNotify = 2147493653;
|
||||
public const uint C2Map_RolePropertyChange = 2147493654;
|
||||
@@ -38,37 +40,37 @@ namespace Fantasy
|
||||
public const uint C2Map_Look = 2147493659;
|
||||
public const uint Map2C_MoveNotify = 2147493660;
|
||||
public const uint Map2C_LookeNotify = 2147493661;
|
||||
public const uint C2S_GetConversationsRequest = 2281711384;
|
||||
public const uint S2C_GetConversationsResponse = 2415929112;
|
||||
public const uint C2S_SendMailRequest = 2281711385;
|
||||
public const uint S2C_SendMailResponse = 2415929113;
|
||||
public const uint C2S_DeleteMailRequest = 2281711386;
|
||||
public const uint S2C_DeleteMailResponse = 2415929114;
|
||||
public const uint C2S_GetConversationsRequest = 2281711385;
|
||||
public const uint S2C_GetConversationsResponse = 2415929113;
|
||||
public const uint C2S_SendMailRequest = 2281711386;
|
||||
public const uint S2C_SendMailResponse = 2415929114;
|
||||
public const uint C2S_DeleteMailRequest = 2281711387;
|
||||
public const uint S2C_DeleteMailResponse = 2415929115;
|
||||
public const uint S2C_HaveMail = 2147493662;
|
||||
public const uint S2C_MailState = 2147493663;
|
||||
public const uint C2S_CreateChannelRequest = 2281711387;
|
||||
public const uint S2C_CreateChannelResponse = 2415929115;
|
||||
public const uint C2S_JoinChannelRequest = 2281711388;
|
||||
public const uint S2C_JoinChannelResponse = 2415929116;
|
||||
public const uint C2S_SendMessageRequest = 2281711389;
|
||||
public const uint S2C_SendMessageResponse = 2415929117;
|
||||
public const uint C2S_CreateChannelRequest = 2281711388;
|
||||
public const uint S2C_CreateChannelResponse = 2415929116;
|
||||
public const uint C2S_JoinChannelRequest = 2281711389;
|
||||
public const uint S2C_JoinChannelResponse = 2415929117;
|
||||
public const uint C2S_SendMessageRequest = 2281711390;
|
||||
public const uint S2C_SendMessageResponse = 2415929118;
|
||||
public const uint S2C_Message = 2147493664;
|
||||
public const uint C2S_CreateClubRequest = 2281711390;
|
||||
public const uint S2C_CreateClubResponse = 2415929118;
|
||||
public const uint C2S_GetClubInfoRequest = 2281711391;
|
||||
public const uint S2C_GetClubInfoResponse = 2415929119;
|
||||
public const uint C2S_GetMemberListRequest = 2281711392;
|
||||
public const uint S2C_GetMemberListResponse = 2415929120;
|
||||
public const uint C2S_GetClubListRequest = 2281711393;
|
||||
public const uint S2C_GetClubListResponse = 2415929121;
|
||||
public const uint C2S_JoinClubRequest = 2281711394;
|
||||
public const uint S2C_JoinClubResponse = 2415929122;
|
||||
public const uint C2S_LeaveClubRequest = 2281711395;
|
||||
public const uint S2C_LeaveClubResponse = 2415929123;
|
||||
public const uint C2S_DissolveClubRequest = 2281711396;
|
||||
public const uint S2C_DissolveClubResponse = 2415929124;
|
||||
public const uint C2S_DisposeJoinRequest = 2281711397;
|
||||
public const uint S2C_DisposeJoinResponse = 2415929125;
|
||||
public const uint C2S_CreateClubRequest = 2281711391;
|
||||
public const uint S2C_CreateClubResponse = 2415929119;
|
||||
public const uint C2S_GetClubInfoRequest = 2281711392;
|
||||
public const uint S2C_GetClubInfoResponse = 2415929120;
|
||||
public const uint C2S_GetMemberListRequest = 2281711393;
|
||||
public const uint S2C_GetMemberListResponse = 2415929121;
|
||||
public const uint C2S_GetClubListRequest = 2281711394;
|
||||
public const uint S2C_GetClubListResponse = 2415929122;
|
||||
public const uint C2S_JoinClubRequest = 2281711395;
|
||||
public const uint S2C_JoinClubResponse = 2415929123;
|
||||
public const uint C2S_LeaveClubRequest = 2281711396;
|
||||
public const uint S2C_LeaveClubResponse = 2415929124;
|
||||
public const uint C2S_DissolveClubRequest = 2281711397;
|
||||
public const uint S2C_DissolveClubResponse = 2415929125;
|
||||
public const uint C2S_DisposeJoinRequest = 2281711398;
|
||||
public const uint S2C_DisposeJoinResponse = 2415929126;
|
||||
public const uint S2C_ClubChange = 2147493665;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ public class C2Game_GetItemsRequestHandler : RouteRPC<Player, C2Game_GetItemsReq
|
||||
protected override async FTask Run(Player entity, C2Game_GetItemsRequest request, Game2C_GetItemsResponse response,
|
||||
Action reply)
|
||||
{
|
||||
|
||||
var itemContainer = entity.GetComponent<PlayerItemContainerComponent>();
|
||||
response.Items = itemContainer.GetItemInfos();
|
||||
response.Rigs = itemContainer.GetRigInfos();
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public static class ItemSystem
|
||||
return new ItemInfo()
|
||||
{
|
||||
Id = self.Id,
|
||||
ConfigId = self.Count,
|
||||
ConfigId = self.ConfigId,
|
||||
Count = self.Count,
|
||||
ExpirationTime = self.ExpirationTime,
|
||||
GetTime = self.GetTime,
|
||||
|
||||
@@ -136,7 +136,7 @@ public static class PlayerItemContainerComponentSystem
|
||||
|
||||
public static List<ItemInfo> GetItemInfos(this PlayerItemContainerComponent self)
|
||||
{
|
||||
List<ItemInfo> ret = new List<ItemInfo>();
|
||||
List<ItemInfo> ret = new List<ItemInfo>(self.Items.Count);
|
||||
foreach (var (_, item) in self.Items)
|
||||
{
|
||||
ret.Add(item.ToItemInfo());
|
||||
@@ -145,20 +145,34 @@ public static class PlayerItemContainerComponentSystem
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List<GearInfo> GetGearInfos(this PlayerItemContainerComponent self)
|
||||
// public static List<GearInfo> GetGearInfos(this PlayerItemContainerComponent self)
|
||||
// {
|
||||
// List<GearInfo> ret = new List<GearInfo>(self.FishingRig.Count);
|
||||
//
|
||||
// foreach (var (rod, rigs) in self.FishingRig)
|
||||
// {
|
||||
// GearInfo gearInfo = new GearInfo();
|
||||
// gearInfo.Rod = rod;
|
||||
// gearInfo.Rigs.AddRange(rigs);
|
||||
// ret.Add(gearInfo);
|
||||
// }
|
||||
//
|
||||
// return ret;
|
||||
// }
|
||||
|
||||
public static List<ItemBindInfo> GetRigInfos(this PlayerItemContainerComponent self)
|
||||
{
|
||||
List<GearInfo> ret = new List<GearInfo>();
|
||||
|
||||
List<ItemBindInfo> ret = new List<ItemBindInfo>(self.FishingRig.Count);
|
||||
foreach (var (rod, rigs) in self.FishingRig)
|
||||
{
|
||||
GearInfo gearInfo = new GearInfo();
|
||||
gearInfo.Rod = rod;
|
||||
gearInfo.Rigs.AddRange(rigs);
|
||||
ret.Add(gearInfo);
|
||||
ItemBindInfo gearInfo = new ItemBindInfo();
|
||||
gearInfo.Item = rod;
|
||||
gearInfo.BindItems.AddRange(rigs);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"profiles": {
|
||||
"Main": {
|
||||
"commandName": "Project",
|
||||
// "workingDirectory": "$(OutputPath)",
|
||||
"workingDirectory": "$(OutputPath)",
|
||||
"environmentVariables": {},
|
||||
"commandLineArgs": "--m Develop"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user