mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-13 05:14:46 +01:00
fix: valk tutorial stage
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using KianaBH.GameServer.Server.Packet.Send.Activity;
|
||||
using KianaBH.Proto;
|
||||
|
||||
namespace KianaBH.GameServer.Server.Packet.Recv.Activity;
|
||||
|
||||
[Opcode(CmdIds.GeneralActivityGetScoreRewardInfoReq)]
|
||||
public class HandlerGeneralActivityGetScoreRewardInfoReq : Handler
|
||||
{
|
||||
public override async Task OnHandle(Connection connection, byte[] header, byte[] data)
|
||||
{
|
||||
var req = GeneralActivityGetScoreRewardInfoReq.Parser.ParseFrom(data);
|
||||
await connection.SendPacket(new PacketGeneralActivityGetScoreRewardInfoRsp(req.ActivityIdList));
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ using Google.Protobuf.Collections;
|
||||
using KianaBH.Data;
|
||||
using KianaBH.KcpSharp;
|
||||
using KianaBH.Proto;
|
||||
using KianaBH.Util.Extensions;
|
||||
|
||||
namespace KianaBH.GameServer.Server.Packet.Send.Activity;
|
||||
|
||||
@@ -19,30 +20,19 @@ public class PacketGeneralActivityGetMainInfoRsp : BasePacket
|
||||
GeneralBasicInfo = new GeneralActivityBasicInfo
|
||||
{
|
||||
ActivityId = activityId,
|
||||
ScheduleId = series?.Series ?? 0,
|
||||
SeriesActivityId ={ activityId }
|
||||
//ScheduleId = series?.Series ?? 0,
|
||||
//SeriesActivityId ={ activityId }
|
||||
}
|
||||
};
|
||||
|
||||
GameData.GeneralActivityStageGroupData
|
||||
.TryGetValue((int)activityId, out var activityStage);
|
||||
|
||||
if (activityStage != null)
|
||||
activity.ActivityStage = new GeneralActivityStage
|
||||
{
|
||||
activity.ActivityStage = new GeneralActivityStage
|
||||
{
|
||||
StageGroupScheduleList =
|
||||
{
|
||||
activityStage.Select(x => new GeneralActivityStageGroupScheduleInfo
|
||||
{
|
||||
BeginTime = 1593223200,
|
||||
EndTime = 1913140799,
|
||||
StageGroupId = x.StageGroupId
|
||||
})
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
EnterTimes = 1,
|
||||
ExchangeTimes = 1,
|
||||
};
|
||||
|
||||
|
||||
|
||||
return activity;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Security.Cryptography;
|
||||
using KianaBH.Data;
|
||||
using KianaBH.KcpSharp;
|
||||
using KianaBH.Proto;
|
||||
@@ -36,6 +37,13 @@ public class PacketGeneralActivityGetScheduleRsp : BasePacket
|
||||
EndTime = time,
|
||||
});
|
||||
}
|
||||
proto.ScheduleList.Add(new GeneralActivityScheduleInfo
|
||||
{
|
||||
ActivityId = 50000006,
|
||||
SettleTime = time,
|
||||
EndTime = time,
|
||||
EndDayTime = time
|
||||
});
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using Google.Protobuf.Collections;
|
||||
using KianaBH.KcpSharp;
|
||||
using KianaBH.Proto;
|
||||
|
||||
namespace KianaBH.GameServer.Server.Packet.Send.Activity;
|
||||
|
||||
public class PacketGeneralActivityGetScoreRewardInfoRsp : BasePacket
|
||||
{
|
||||
public PacketGeneralActivityGetScoreRewardInfoRsp(RepeatedField<uint> ActivityIdList) : base(CmdIds.GeneralActivityGetScoreRewardInfoRsp)
|
||||
{
|
||||
var proto = new GeneralActivityGetScoreRewardInfoRsp
|
||||
{
|
||||
ScoreInfoList =
|
||||
{
|
||||
ActivityIdList?.Select(id => new GeneralActivityScoreRewardInfo
|
||||
{
|
||||
ActivityId = id,
|
||||
CurScore = 0
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
}
|
||||
@@ -9,55 +9,21 @@ public class PacketGetStageDataRsp : BasePacket
|
||||
{
|
||||
public PacketGetStageDataRsp(RepeatedField<uint> StageIdList) : base(CmdIds.GetStageDataRsp)
|
||||
{
|
||||
var isAll = StageIdList.Count == 1 && StageIdList[0] == 0;
|
||||
|
||||
var stageData = GameData.StageDataMain;
|
||||
|
||||
var stageList = isAll
|
||||
? stageData.Values.Select(stage => new Proto.Stage
|
||||
{
|
||||
Id = stage.LevelId,
|
||||
Progress = 1,
|
||||
ChallengeIndexList =
|
||||
{
|
||||
stage.ChallengeList.Count == 3
|
||||
? new uint[] { 0, 1, 2 }
|
||||
: new uint[] { 0 }
|
||||
},
|
||||
IsDone = true,
|
||||
MaxRank = 1
|
||||
})
|
||||
: stageData.Values
|
||||
.Where(stage => StageIdList.Contains(stage.LevelId))
|
||||
.Select(stage => new Proto.Stage
|
||||
{
|
||||
Id = stage.LevelId,
|
||||
Progress = 1,
|
||||
ChallengeIndexList =
|
||||
{
|
||||
stage.ChallengeList.Count == 3
|
||||
? new uint[] { 0, 1, 2 }
|
||||
: new uint[] { 0 }
|
||||
},
|
||||
IsDone = true,
|
||||
MaxRank = 1
|
||||
});
|
||||
|
||||
var proto = new GetStageDataRsp
|
||||
{
|
||||
IsAll = isAll,
|
||||
FinishedChapterList = { Enumerable.Range(1, 43).Select(i => (uint)i) },
|
||||
EventDataList =
|
||||
IsAll = true,
|
||||
StageList =
|
||||
{
|
||||
new StageEventData
|
||||
stageData.Values.Select(stage => new Proto.Stage
|
||||
{
|
||||
BeginTime = 1729108800,
|
||||
EndTime = 1990911600,
|
||||
ChapterId = 200,
|
||||
UnlockLevel = 30
|
||||
}
|
||||
},
|
||||
StageList = { }
|
||||
Id = stage.LevelId,
|
||||
Progress = stage.MaxProgress,
|
||||
EnterTimes = 0,
|
||||
ChallengeIndexList = { stage.ChallengeList.Count == 3 ? new uint[] { 0, 1, 2 } : new uint[0] },
|
||||
IsDone = true,
|
||||
}).ToList(),
|
||||
}
|
||||
};
|
||||
|
||||
SetData(proto);
|
||||
|
||||
Reference in New Issue
Block a user