mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-03 04:36:03 +08:00
fix a historical bug
This commit is contained in:
24
Common/Data/Excel/ChatBubbleConfigExcel.cs
Normal file
24
Common/Data/Excel/ChatBubbleConfigExcel.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel
|
||||
{
|
||||
[ResourceEntity("ChatBubbleConfig.json")]
|
||||
public class ChatBubbleConfigExcel : ExcelResource
|
||||
{
|
||||
public int ID { get; set; }
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.ChatBubbleConfigData[ID] = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,7 @@ namespace EggLink.DanhengServer.Data
|
||||
public static Dictionary<int, QuestDataExcel> QuestDataData { get; private set; } = [];
|
||||
public static Dictionary<int, PlayerLevelConfigExcel> PlayerLevelConfigData { get; private set; } = [];
|
||||
public static Dictionary<int, BackGroundMusicExcel> BackGroundMusicData { get; private set; } = [];
|
||||
public static Dictionary<int, ChatBubbleConfigExcel> ChatBubbleConfigData { get; private set; } = [];
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace EggLink.DanhengServer.Database.Player
|
||||
public int CurBasicType { get; set; } = 8001;
|
||||
public int HeadIcon { get; set; } = 208001;
|
||||
public int PhoneTheme { get; set; } = 221000;
|
||||
public int ChatBubble { get; set; } = 222000;
|
||||
public int ChatBubble { get; set; } = 220000;
|
||||
public int CurrentBgm { get; set; } = 210007;
|
||||
public Gender CurrentGender { get; set; } = Gender.Man;
|
||||
public int Level { get; set; } = 1;
|
||||
@@ -69,6 +69,11 @@ namespace EggLink.DanhengServer.Database.Player
|
||||
|
||||
public PlayerSimpleInfo ToSimpleProto(FriendOnlineStatus status)
|
||||
{
|
||||
if (!GameData.ChatBubbleConfigData.ContainsKey(ChatBubble)) // to avoid npe
|
||||
{
|
||||
ChatBubble = 220000;
|
||||
}
|
||||
|
||||
var AvatarInfo = DatabaseHelper.Instance!.GetInstance<AvatarData>(Uid)!;
|
||||
|
||||
foreach (var avatar in AvatarInfo.Avatars)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Game.Player;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -12,6 +13,11 @@ namespace EggLink.DanhengServer.Server.Packet.Send.Player
|
||||
{
|
||||
public PacketGetPhoneDataScRsp(PlayerInstance player) : base(CmdIds.GetPhoneDataScRsp)
|
||||
{
|
||||
if (!GameData.ChatBubbleConfigData.ContainsKey(player.Data.ChatBubble)) // to avoid npe
|
||||
{
|
||||
player.Data.ChatBubble = 220000;
|
||||
}
|
||||
|
||||
var proto = new GetPhoneDataScRsp
|
||||
{
|
||||
CurChatBubble = (uint)player.Data.ChatBubble,
|
||||
|
||||
Reference in New Issue
Block a user