1
0
forked from akanyan/mu3-mods

feat!: rename and reorganize

This commit is contained in:
2024-12-22 16:16:52 +00:00
parent 7acd754397
commit 895ae9e76d
99 changed files with 110 additions and 87 deletions

View File

@ -0,0 +1,32 @@
using MU3.Data;
using MU3.User;
using MU3.Util;
using System.Collections.Generic;
using System.Linq;
namespace MU3.Client;
class patch_PacketGetUserMemoryChapter: Packet {
private Dictionary<int, User.UserMemoryChapter> userMemoryChapter_;
public override State proc() {
switch(procImpl()) {
case State.Done: {
GetUserMemoryChapterResponse response_ = (query_ as GetUserMemoryChapter).response_;
foreach(MemoryChapterData memoryChapterData in SingletonStateMachine<DataManager, DataManager.EState>.instance.allMemoryChapterData) {
UserMemoryChapter userMemoryChapter = Enumerable.FirstOrDefault(response_.userMemoryChapterList, (UserMemoryChapter c) => c.chapterId == memoryChapterData.id);
if(userMemoryChapter != null) {
User.UserMemoryChapter userMemoryChapter2 = new User.UserMemoryChapter();
userMemoryChapter2.copyFrom(userMemoryChapter);
userMemoryChapter_[userMemoryChapter2.ChapterId] = userMemoryChapter2;
} else {
User.UserMemoryChapter userMemoryChapter3 = new User.UserMemoryChapter(memoryChapterData.id);
userMemoryChapter_[userMemoryChapter3.ChapterId] = userMemoryChapter3;
}
}
Singleton<UserManager>.instance.UserMemoryChapter = userMemoryChapter_;
break;
}
}
return state_;
}
}