[Help] Character Information Not Loading Correctly (Reputation, Faction, Fairy, etc.)

02/05/2025 03:33 Supreme12am#1
Hey everyone,

I’m facing a major issue in Nostale where certain packets are not loading correctly. Sometimes, I can’t see the reputation of a character, their fairy, or other important information. Additionally, when I click on a character and the st packet is sent, the faction is simply not displayed.

I don’t understand why this is happening, and I’d really appreciate any help!

Here’s the relevant part of my code:

Quote:
public void GetNamedCharacterInformation(NcifPacket ncifPacket)
{
switch (ncifPacket.Type)
{
// Player characters
case 1:
var targetSession = ServerManager.Instance.GetSessionByCharacterId(nci fPacket.TargetId);
if (targetSession?.Character != null)
{
Character target = targetSession.Character;

int hpPercentage = (int)((float)target.Hp / target.HPLoad() * 100);
int mpPercentage = (int)((float)target.Mp / target.MPLoad() * 100);

// Setting the correct Faction ID
int factionId = target.Faction switch
{
FactionType.Angel => 1,
FactionType.Demon => 2,
_ => 3 // Default: Neutral
};

// Debugging logs
Console.WriteLine($"Faction-ID for {target.Name}: {factionId}");
Console.WriteLine($"Reputation for {target.Name}: {target.Reputation.ToString("F2", CultureInfo.InvariantCulture)}");

// Sending updated data to the client
Session.SendPacket($"ncif 1 {target.CharacterId}");
Session.SendPacket($"st 1 {target.CharacterId} {target.Level} {target.HeroLevel} {hpPercentage} {mpPercentage} {target.Hp} {target.Mp} {target.HPLoad()} {target.MPLoad()} {factionId} {target.Reputation.ToString("F2", CultureInfo.InvariantCulture)}");
}
break;
}
}

What’s the Issue?

- Some packets (Reputation, Fairy, Faction) are not being received correctly.
- The faction is missing when the st packet is opened.
- I’m not sure what’s causing this issue.

If anyone has experience with this and can help, please leave your Discord so we can discuss further. Of course, I’m willing to pay for the help!

Thanks in advance!
02/05/2025 10:06 XV50#2
It would be useful to see what packets you receive/send using a Packetlogger. Maybe values are twisted. Use a Packetlogger and share details.

Greetings

Edit: Just a little performance-boost: since FactionType is enum, rather use casting instead of switch expression. Switch has higher overhead and since the packet is sent/received often, it'll be good in terms of performance.
02/05/2025 10:25 Coders Lounge#3
Any error processing logs. Add me on discord so i can look deeper. I might help.

Discord: pixeldevmain
02/05/2025 10:25 Derboto#4
Quote:
Originally Posted by Coders Lounge View Post
Any error processing logs. Add me on discord so i can look deeper. I might help.

Discord: pixeldevmain
you can scam deeper
02/05/2025 10:31 Coders Lounge#5
Quote:
Originally Posted by Derboto View Post
you can scam deeper
Are you on crack? Lol
02/05/2025 10:33 Seakter#6
@[Only registered and activated users can see links. Click Here To Register...] he can speak broke english that he is the only one can understand it:lul: dont waste your time to coders wannabe
02/05/2025 10:33 Derboto#7
Quote:
Originally Posted by Coders Lounge View Post
Are you on crack? Lol
stfu scammer
02/05/2025 10:36 Coders Lounge#8
You see the result of taking cracks? ������
02/05/2025 12:36 Derboto#9
Quote:
Originally Posted by Coders Lounge View Post
You see the result of taking cracks? ������
u banned scammer
02/07/2025 15:33 Supreme12am#10
The problem is still there i found out that it has to be something with the $"in packet ...

This is the Packet from my Source :

Quote:
in 1 Darkcrusi - 155 48 132 3 0 0 3 13 1 8689.8644.4448.4460.8687.4715.8680.8682.8699.-1.8587 100 100 0 -1 4 3 0 51 0 0 108 108 9 Overpriced 29 0 0 0 0 99 10 0|0|0 0 0 100 90 0

And this is the Packet from Offical Server :

Quote:
in 1 LittlyGuys - 1484794 77 111 2 0 0 3 7 2 221.4954.4966.4963.227.4131.4441.4439.8255.4443.86 96 100 100 0 -1 4 3 0 42 0 0 88 87 186.918 [R]enaisSance 25 0 0 0 0 95 11 0|0|0 0 0 100 47 9472

I still dont get what is diffrent and what is new .. how do i change my code which is like this to get it work again :

Quote:
if (Session.Character.Authority == AuthorityType.GameSage)
{
return $"in 1 {(Authority > AuthorityType.User && !Undercover ? "[GS]" + Name : Name)} - {CharacterId} {PositionX} {PositionY} {Direction} {(Undercover ? (byte)AuthorityType.User : (byte)Authority)} {(byte)Gender} {(byte)HairStyle} {color} {(byte)Class} {GenerateEqListForPacket()} {Math.Ceiling(Hp / HPLoad() * 100)} {Math.Ceiling(Mp / MPLoad() * 100)} {(IsSitting ? 1 : 0)} {(Group?.GroupType == GroupType.Group ? (Group?.GroupId ?? -1) : -1)} {(fairy != null && !Undercover ? 4 : 0)} {fairy?.Item.Element ?? 0} 0 {fairy?.Item.Morph ?? 0} {InEffect} {(UseSp || IsVehicled || IsMorphed ? Morph : 0)} {GenerateEqRareUpgradeForPacket()} {(!Undercover ? (foe ? -1 : Family?.FamilyId ?? -1) : -1)} {(!Undercover ? (foe ? name : Family?.Name ?? "-") : "-")} {(GetDignityIco() == 1 ? GetReputationIco() : -GetDignityIco())} {(Invisible ? 1 : 0)} {(UseSp ? MorphUpgrade : 0)} {faction} {(UseSp ? MorphUpgrade2 : 0)} {Level} {Family?.FamilyLevel ?? 0} 0|0|0 {ArenaWinner} {Compliment} {Size} {HeroLevel} {ViewTitle}";
}
return $"in 1 {(Authority > AuthorityType.User && !Undercover ? Name : Name)} - {CharacterId} {PositionX} {PositionY} {Direction} {(Undercover ? (byte)AuthorityType.User : (byte)Authority)} {(byte)Gender} {(byte)HairStyle} {color} {(byte)Class} {GenerateEqListForPacket()} {Math.Ceiling(Hp / HPLoad() * 100)} {Math.Ceiling(Mp / MPLoad() * 100)} {(IsSitting ? 1 : 0)} {(Group?.GroupType == GroupType.Group ? (Group?.GroupId ?? -1) : -1)} {(fairy != null && !Undercover ? 4 : 0)} {fairy?.Item.Element ?? 0} 0 {fairy?.Item.Morph ?? 0} {InEffect} {(UseSp || IsVehicled || IsMorphed ? Morph : 0)} {GenerateEqRareUpgradeForPacket()} {(!Undercover ? (foe ? -1 : Family?.FamilyId ?? -1) : -1)} {(!Undercover ? (foe ? name : Family?.Name ?? "-") : "-")} {(GetDignityIco() == 1 ? GetReputationIco() : -GetDignityIco())} {(Invisible ? 1 : 0)} {(UseSp ? MorphUpgrade : 0)} {faction} {(UseSp ? MorphUpgrade2 : 0)} {Level} {Family?.FamilyLevel ?? 0} 0|0|0 {ArenaWinner} {Compliment} {Size} {HeroLevel} {ViewTitle}";
02/08/2025 15:10 Limoo#11
Quote:
Originally Posted by Supreme12am View Post
The problem is still there i found out that it has to be something with the $"in packet ...

This is the Packet from my Source :




And this is the Packet from Offical Server :




I still dont get what is diffrent and what is new .. how do i change my code which is like this to get it work again :
Official packet has an extra 96

in 1 Darkcrusi - 155 48 132 3 0 0 3 13 1 8689.8644.4448.4460.8687.4715.8680.8682.8699.-1.8587 100 100 0 -1 4 3 0 51 0 0 108 108 9 Overpriced 29 0 0 0 0 99 10 0|0|0 0 0 100 90 0
in 1 LittlyGuys - 1484794 77 111 2 0 0 3 7 2 221.4954.4966.4963.227.4131.4441.4439.8255.4443.86 96 100 100 0 -1 4 3 0 42 0 0 88 87 186.918 [R]enaisSance 25 0 0 0 0 95 11 0|0|0 0 0 100 47 9472
02/09/2025 15:58 Supreme12am#12
Oh ok do you know what this could mean ?