mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 06:23:58 +00:00
Compare commits
4 Commits
v2.8
...
5aa5ef92d0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5aa5ef92d0 | ||
|
|
c34ad5eb1e | ||
|
|
8a597e24b6 | ||
|
|
9763f1f8d9 |
18
Common/Data/Excel/HouseFurniturePosData.cs
Normal file
18
Common/Data/Excel/HouseFurniturePosData.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace MikuSB.Data.Excel;
|
||||
|
||||
[ResourceEntity("house/FurniturePos.json")]
|
||||
public class HouseFurniturePosExcel : ExcelResource
|
||||
{
|
||||
public uint AreaId { get; set; }
|
||||
public uint GroupId { get; set; }
|
||||
|
||||
public override uint GetId()
|
||||
{
|
||||
return (AreaId << 48) | (GroupId << 32);
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.HouseFurniturePosData.TryAdd(GetId(), this);
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ public static class GameData
|
||||
public static Dictionary<uint, WeaponPartsExcel> WeaponPartsData { get; private set; } = [];
|
||||
public static Dictionary<uint, GuideExcel> GuideData { get; private set; } = [];
|
||||
public static Dictionary<uint, DormGiftExcel> DormGiftData { get; private set; } = [];
|
||||
public static Dictionary<uint, HouseFurniturePosExcel> HouseFurniturePosData { get; private set; } = [];
|
||||
}
|
||||
|
||||
public static class GameResourceTemplateId
|
||||
|
||||
@@ -327,20 +327,49 @@ public class PlayerInstance(PlayerGameData data)
|
||||
|
||||
private static IEnumerable<(uint Gid, uint Sid, uint Value)> BuildGirlFurnitureAttrs()
|
||||
{
|
||||
// Unlock some furniture slots for every girl
|
||||
// Each furniture attr int stores 10 slots using 3 bits per slot
|
||||
// Value below means slot 0..9 = 1
|
||||
const uint furnitureUnlockedValue = 153391689;
|
||||
var groupFurnitureByArea = new Dictionary<uint, uint>();
|
||||
foreach (var pos in GameData.HouseFurniturePosData.Values)
|
||||
{
|
||||
var areaId = pos.AreaId;
|
||||
var groupId = pos.GroupId;
|
||||
uint selectedIndex = 1;
|
||||
var shift = (groupId - 1) * 3;
|
||||
if (!groupFurnitureByArea.TryGetValue(areaId, out var packed)) packed = 0;
|
||||
packed |= (selectedIndex << (int)shift);
|
||||
groupFurnitureByArea[areaId] = packed;
|
||||
}
|
||||
|
||||
for (uint girlId = 0; girlId <= 50; girlId++)
|
||||
{
|
||||
// FurnitureStart..FurnitureEnd = 10..19
|
||||
var baseSid = girlId * 50;
|
||||
for (uint offset = 10; offset <= 19; offset++)
|
||||
{
|
||||
uint sid = (girlId * 50) + offset;
|
||||
yield return (101, sid, furnitureUnlockedValue);
|
||||
}
|
||||
yield return (101, baseSid + offset, furnitureUnlockedValue);
|
||||
|
||||
if (groupFurnitureByArea.TryGetValue(girlId, out var groupValue))
|
||||
yield return (101, baseSid + 20, groupValue);
|
||||
}
|
||||
|
||||
// Massage room furniture
|
||||
// 10010..10019
|
||||
for (uint sid = 10010; sid <= 10019; sid++)
|
||||
yield return (101, sid, furnitureUnlockedValue);
|
||||
|
||||
// Massage room group state
|
||||
yield return (101, 10020, 1);
|
||||
|
||||
// Hot spring furniture
|
||||
// 15001..15010
|
||||
for (uint sid = 15001; sid <= 15010; sid++)
|
||||
yield return (101, sid, furnitureUnlockedValue);
|
||||
|
||||
// Beach furniture
|
||||
// 17101..17110
|
||||
for (uint sid = 17101; sid <= 17110; sid++)
|
||||
yield return (101, sid, furnitureUnlockedValue);
|
||||
|
||||
for (uint sid = 30000; sid < 31000; sid++)
|
||||
yield return (101, sid, furnitureUnlockedValue);
|
||||
}
|
||||
|
||||
private static IEnumerable<(uint Gid, uint Sid, uint Value)> BuildLobbyBootstrapAttrs()
|
||||
|
||||
@@ -270,12 +270,17 @@ public class RouteController : ControllerBase
|
||||
var finalEmail = email ?? form_email ?? await GetJsonBodyValue("email");
|
||||
if (!string.IsNullOrWhiteSpace(finalEmail))
|
||||
{
|
||||
var accountByEmail = AccountData.GetAccountByEmail(finalEmail);
|
||||
if (accountByEmail == null)
|
||||
return BuildLoginFailedResponse("Account not found.");
|
||||
var username = finalEmail.Split('@')[0];
|
||||
var accountData = AccountData.GetAccountByUserName(username);
|
||||
if (accountData == null)
|
||||
{
|
||||
if (!ConfigManager.Config.ServerOption.AutoCreateUser) return BuildLoginFailedResponse("Account not found.");
|
||||
AccountData.CreateAccount(username, 0, "123456");
|
||||
accountData = AccountData.GetAccountByUserName(username)!;
|
||||
}
|
||||
|
||||
var finalUidValue = accountByEmail.Uid.ToString();
|
||||
var finalTokenValue = accountByEmail.GenerateComboToken();
|
||||
var finalUidValue = accountData.Uid.ToString();
|
||||
var finalTokenValue = accountData.GenerateComboToken();
|
||||
|
||||
object emailLoginRsp = new
|
||||
{
|
||||
@@ -286,14 +291,14 @@ public class RouteController : ControllerBase
|
||||
isFirstLogin = false,
|
||||
isNeedKoreaSciAuth = false,
|
||||
ksOpenId = $"ks_{finalUidValue}",
|
||||
nickname = accountByEmail.Username,
|
||||
nickname = accountData.Username,
|
||||
passportId = finalUidValue,
|
||||
playerFillAgeUrl = "",
|
||||
status = 0,
|
||||
thirdPartyUid = "",
|
||||
token = finalTokenValue,
|
||||
type = "guest",
|
||||
uid = accountByEmail.Uid
|
||||
uid = accountData.Uid
|
||||
},
|
||||
msg = "操作成功"
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
v=2.8
|
||||
v=2.9
|
||||
Reference in New Issue
Block a user