Hazem
2026-11-19, 04:06 PM
عفواً لايمكن عرض الروابط في الإرشيف
عفواً لايمكن عرض الروابط في الإرشيف
حل مشكلة اسم الجي ام اللي مش بياخد الوسم [GM] - سورس قهر موبايل النسخة التانية
السلام عليكم
لو اديت حساب رتبة GM أو PM أو Helper، الصلاحيات بتشتغل عادي والأوامر بتتنفذ، بس اسم الشخصية بيفضل زي ما هو من غير [GM] قدامه، لا فوق الشخصية ولا في الشات.
السبب
الرتبة في السورس بتتاخد من عمود State في جدول accounts:
3 يعني GM
5 يعني Helper
255 يعني PM
وده اتعمل كده عشان الأمان، لأن زمان في سورس الكمبيوتر الصلاحية كانت بتتعرف من الاسم نفسه، يعني لو اسمك فيه [GM] تبقى جي ام، وده كان ينفع يتزور.
فلما الصلاحية بقت من الحساب، محدش بقى بيحط الوسم في الاسم خالص، والاسم بيفضل عادي.
الحل
عملنا حاجة صغيرة بتحط الوسم قدام الاسم وقت العرض بس، على حسب رتبة الحساب.
الاسم المتسجل في الداتا بيفضل زي ما هو، يعني لو شلت الرتبة الوسم بيروح لوحده من أول دخول.
الوسم بيظهر فوق الشخصية، وفي صورة الشخصية فوق على الشمال، وكمان في الشات جنب الرسالة.
ولو حد كتب [GM]Name في الهمس، الرسالة بتوصل للشخص عادي.
الملفات في فولدر Server اللي مع الموضوع، انسخها فوق السورس:
Data/mobile_staff_tags.txt
# QahrMobile: the tag shown before a staff character's name (Mobile/StaffTag/StaffTag.cs).
# The rank is the account's accounts.State, read at login: 3 = GameMaster, 5 = GameHelper, 255 = ProjectManager.
# The tag is display only: the saved name does not change, so a rank given or removed shows at the next login.
# A whisper sent to the tagged name reaches the player. Delete a line to show that rank without a tag.
# <state> <tag> * tags are server choice
3 [GM]
5 [HD]
255 [PM]
ده ملف الوسوم، تقدر تغير الوسم لكل رتبة منه أو تمسح سطر لو مش عايز وسم للرتبة دي.
src/Qahr.Mobile.Game/Mobile/StaffTag/StaffTag.cs ملف جديد.
using System;
using System.Collections.Generic;
using Qahr.Mobile.Phone;
namespace Qahr.Mobile.StaffTag
{
/// <summary>QahrMobile: shows "[GM]" / "[HD]" / "[PM]" before a staff character's name. The rank comes from
/// accounts.State (GameClient.AccountState, 3 / 5 / 255) since the security fix, while the PC source expected the tag
/// to be typed into the name itself, so a GM made from the account kept a plain name. Display only, the saved name
/// is unchanged. Data\mobile_staff_tags.txt. Hooks: Player.GetArray (spawn), MsgClientInfo (own hero),
/// MsgMessage.Handler (whisper to a tagged name).</summary>
public static class StaffTag
{
const byte StateGameHelper = 5, StateProjectManager = 255;
static readonly DataFile<Dictionary<byte, string>> File =
new DataFile<Dictionary<byte, string>>("mobile_staff_tags.txt", "StaffTag", Parse);
static Dictionary<byte, string> Parse(string[] lines)
{
var tags = new Dictionary<byte, string>();
foreach (var line in DataFile.Clean(lines))
{
var w = DataFile.Words(line);
byte state;
if (w.Length < 2 || !byte.TryParse(w[0], out state))
{
MyConsole.WriteLine("[StaffTag] mobile_staff_tags.txt: bad line skipped: " + line, ConsoleColor.Red);
continue;
}
tags[state] = w[1];
}
return tags;
}
/// <summary>The name to show for this player: the staff tag + the name, or the name alone.</summary>
public static string Display(Role.Player p)
{
string name = p.Name ?? "";
string tag = TagOf(p.Owner);
return tag == null || name.StartsWith(tag, StringComparison.Ordinal) ? name : tag + name;
}
/// <summary>The saved name behind a shown name (a whisper typed to "[GM]Name" reaches "Name").</summary>
public static string Strip(string shown)
{
if (string.IsNullOrEmpty(shown)) return shown;
foreach (var tag in File.Value.Values)
if (shown.Length > tag.Length && shown.StartsWith(tag, StringComparison.Ordinal))
return shown.Substring(tag.Length);
return shown;
}
static string TagOf(Client.GameClient c)
{
if (c == null || c.Player == null) return null;
byte state = c.AccountState;
if (c.ProjectManager) state = StateProjectManager;
else if (c.HelpDesk && !c.IsStaffAccount) state = StateGameHelper;
string tag;
return File.Value.TryGetValue(state, out tag) ? tag : null;
}
}
}
src/Qahr.Mobile.Game/Gameplay/Players/Player.GetArray.cs متغير فيه سطر واحد (الاسم اللي فوق الشخصية).
// ================================================== ==========================
// Player.GetArray - GetArray, MysteryFruit, GetShareBattlePowers, TableID, PokerTableID, PokerSeat, VotePoints, Guild...
// Part of the partial class Player (split by Server/DevTools/CsSplit, code moved unchanged).
// ================================================== ==========================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;
using Qahr.Mobile.Game.MsgServer;
using Qahr.Mobile.Game.MsgNpc;
using Qahr.Mobile.Role.Instance;
using System.Windows.Forms;
using ProtoBuf;
using System.IO;
using Qahr.Mobile.Game.MsgTournaments;
using Qahr.Mobile.Game.MsgMonster;
using Qahr.Mobile.Database;
using Qahr.Mobile.Game.MsgFloorItem;
namespace Qahr.Mobile.Role
{
public unsafe partial class Player
{
public unsafe ServerSockets.Packet GetArray(ServerSockets.Packet stream, bool WindowsView)
{
byte prestigeRank = (byte)Database.PrestigeRanking.GetMyRank(Database. PrestigeRanking.GetIndex(Class), UID);
stream.InitWriter();
var proto = new SpawnPacketProto()
{
UID = UID,
Mesh = Mesh,
Head = HeadId,
Garment = GarmentId,
LeftWeapon = LeftWeaponId,
LeftWeaponSoul = LeftWeapsonSoul,
RightWeapon = RightWeaponId,
RightWeaponSoul = RightWeapsonSoul,
LeftWeaponAccessory = LeftWeaponAccessoryId,
RightWeaponAccessory = RightWeaponAccessoryId,
Steed = SteedId,
MountArmor = MountArmorId,
AppearanceType = (ushort)AparenceType,
GuildRank = (uint)GuildRank,
GuildID = GuildID,
Wing = WingTitleHaloHide ? 0 : WingId,
WingPlus = WingPlus,
WingProgress = WingProgress,
Bottle = Bottle,
Hitpoints = (uint)HitPoints,
X = X,
Y = Y,
HairStyle = Hair,
Facing = (byte)Angle,
Action = (ushort)Action,
Reborn = Reborn,
SecondRebornClass = SecoundeClass,
FirstRebornClass = FirstClass,
Level = Level,
WindowSpawn = (byte)(WindowsView ? 1 : 0),
Away = Away > 0,
ExtraBattlePower = ExtraBattlePower,
FlowerIcon = FairyForm,//This for FairyForm, if you're not transform in fairy default value is -1
NobilityRank = (byte)NobilityRank,
Armor = ArmorId,
ArmorSoul = ArmorSoul,
HeadSoul = HeadSoul,
SteedColor = SteedColor,
SteedPlus = SteedPlus,
ClanUID = ClanUID,
ClanRank = ClanRank,
Title = SomeHide ? 0 : (uint)MyTitle,
ActiveSubClasses = (byte)ActiveSublass,
SubClass = SubClassHasPoints,
JiangHuActive = JiangHuActive > 0,
JiangHuTalent = JiangHuTalent,
MaxLife = Owner.Status.MaxHitpoints,
RealUID = RealUID,
UnionID = InUnion ? MyUnion.UID : 0,
UnionType = InUnion ? (uint)MyUnion.IsKingdom : 0,
BattlePower = BattlePower,
QuizPoints = QuizPoints,
Class = Class,
GuildBattlePower = GuildBattlePower,
InvisibleArena = (byte)(Owner.IsWatching() ? 1 : 0),
MyWing = WingTitleHaloHide ? 0 : SpecialWingID,
MyTitle = WingTitleHaloHide ? 0 : SpecialTitleID,
MyTitleScore = SpecialTitleScore,
CountryCode = CountryID,
PrestigeRank = (byte)(prestigeRank >= 1 && prestigeRank <= 3 ? prestigeRank : 0),
InnerStrengthScore = InnerPower.TotalScore,
MainFlag = (byte)MainFlag,
Enlighten = Enilghten,
Official_Harem_Guards = InUnion ? (uint)ExploitsRank : 0,
Name = System.Text.Encoding.UTF8.GetBytes(global::Qahr.Mo bile.StaffTag.StaffTag.Display(this)),// QahrMobile: [GM]/[HD]/[PM] by account rank, Mobile/StaffTag/StaffTag.cs
FamilyName = System.Text.Encoding.UTF8.GetBytes(""),
SyndicateName = System.Text.Encoding.UTF8.GetBytes(MyGuild != null ? MyGuild.GuildName : ""),
LeagueName = System.Text.Encoding.UTF8.GetBytes(!InUnion ? "" : MyUnion.Name),
MateName = System.Text.Encoding.UTF8.GetBytes(ClanName ?? ""),
OwnerPetName = System.Text.Encoding.UTF8.GetBytes(""),
Name134 = System.Text.Encoding.UTF8.GetBytes("")
};
Qahr.Mobile.Phone.ItemVisuals.Dress(proto);// QahrMobile: item visuals (look/soul/steed colour others see), Mobile/ItemVisuals/ItemVisuals.cs
MsgGameItem relic;
if (Owner.Equipment.TryGetEquip(Flags.ConquerItem.Rel ics, out relic))
{
var RelicFlag = relic.RelicAttributes.Where(i => i > 0 && i.Epic);
if (RelicFlag.Count() >= 5)
{
proto.Relic = (byte)(50 + relic.RelicAttributes.Where(i => i > 0 && i.Epic).Count());
}
else if (RelicFlag.Count() == 1)
proto.Relic = (byte)(43 + relic.RelicAttributes.Where(i => i > 0 && i.Epic).Count());
else if (RelicFlag.Count() >= 2)
proto.Relic = (byte)(39 + relic.RelicAttributes.Where(i => i > 0 && i.Epic).Count());
else
proto.Relic = (byte)(42 + relic.RelicAttributes.Where(i => i > 0 && i.Epic).Count());
}
proto.SageMode1 = NiniaP0;
if (Owner.Player.CollectionID != 0)
proto.PistilAroma = Owner.Player.CollectionID;
if (Owner.Player.PandaID != 0)
proto.PandaPonpon = Owner.Player.PandaID;
proto.HaloTitle = WingTitleHaloHide ? 0 : Owner.Player.SpecialHaloID;
proto.StatusFlags = new ulong[BitVector.bits.Length];
proto.Medal = Medal;
for (int x = 0; x < BitVector.bits.Length; x++)
proto.StatusFlags[x] = BitVector.bits[x];
proto.HundredWeapons = new long[5];
var visibleHundredWeapons = Owner.HundredWeapons.Objects.Values.Where(i => i.AppearancePosition > 0).OrderBy(i => i.AppearancePosition).ToArray();
for (int i = 0; i < Math.Min(proto.HundredWeapons.Length, visibleHundredWeapons.Length); i++)
{
var binaryFormat = Convert.ToString((int)visibleHundredWeapons[i].WeaponSubtype, 2) + Convert.ToString(visibleHundredWeapons[i].Score, 2);
while (binaryFormat.Length < 25)
binaryFormat = binaryFormat + "0";
proto.HundredWeapons[i] = Convert.ToUInt32(binaryFormat, 2);
}
proto.MountArmorColor = MountArmorColor;
proto.FrameID = Owner.Player.FrameID;
proto.todayFlowerType = TodayFlowerType;
proto.FlowerRank = (ulong)FlowerRank;
proto.MachineInfo = Owner.Player.TableBetDice;
if (AtributesStatus.IsWarrior(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[1] = (uint)obj.ItemID * 10 + obj.dwParam;
proto.HundredWeapons[2] = obj.Progress;
}
}
if (AtributesStatus.IsArcher(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[1] = (uint)obj.ItemID;
proto.HundredWeapons[2] = obj.Progress;
}
}
if (AtributesStatus.IsMonk(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[1] = (uint)obj.ItemID;
proto.HundredWeapons[2] = obj.Progress;
}
}
if (AtributesStatus.IsTaoist(this.Class))
{
Archives.Item t = this.Owner.MyArchives.isOpen();
if (t != null)
{
proto.HundredWeapons = new long[4];
proto.HundredWeapons[0] = (uint)(t.ItemID);
proto.HundredWeapons[1] = t.Progress;
if (this.TaoHeavenState > 0)
proto.HundredWeapons[2] = this.Owner.HeavenVector;
else
proto.HundredWeapons[2] = 31;
}
}
if (AtributesStatus.IsPirate(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[0] = (uint)(obj.ItemID);
proto.HundredWeapons[2] = obj.Progress;
}
}
if (AtributesStatus.IsLee(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[0] = (uint)(obj.ItemID);
proto.HundredWeapons[1] = obj.Progress;
proto.HundredWeapons[3] = (long)Owner.MyArchives.Effect;
}
}
proto.FootPrintID = SpecialFootprintID;
proto.ActionCool = SpecialHaloAction;
proto.FootPrintScore = SpecialFootprintScore;
proto.ActionCoolScore = SpecialHaloActionScore;
stream.ProtoBufferSerialize(proto);
stream.Finalize(Game.GamePackets.MsgPlayer);
return stream;
}
public byte MysteryFruit = 0;
public uint GetShareBattlePowers(uint target_battlepower)
{
return (uint)Database.TutorInfo.ShareBattle(this.Owner, (int)target_battlepower);
}
public uint TableID { get; set; }
public uint PokerTableID { get; set; }
public byte PokerSeat { get; set; }
public byte VotePoints = 0;
public byte GuildBoss;
public uint NobilityCps = 0;
public Qahr.Mobile.Game.MsgServer.MsgSpell FocusClientSpell;
public Qahr.Mobile.Game.MsgServer.MsgSpell WeepStorm;
public bool doFocus = false;
}
}
src/Qahr.Mobile.Game/Net/Packets/MsgLogin/MsgClientInfo.cs متغير فيه سطر واحد (اسمك في الصورة بتاعتك).
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProtoBuf;
namespace Qahr.Mobile.Game.MsgServer
{
public unsafe static partial class MsgBuilder
{
}
public class MsgClientInfo
{
[ProtoContract]
public class ProtoStructure
{
[ProtoMember(1, IsRequired = true)]
public uint UID;
[ProtoMember(2, IsRequired = true)]
public uint AparenceType;
[ProtoMember(3, IsRequired = true)]
public uint Mesh;
[ProtoMember(4, IsRequired = true)]
public uint Hair;
[ProtoMember(5, IsRequired = true)]
public ulong Money;
[ProtoMember(6, IsRequired = true)]
public uint ConquerPoints;
[ProtoMember(7, IsRequired = true)]
public long Experience;
[ProtoMember(8, IsRequired = true)]
public ushort IDServer;
[ProtoMember(9, IsRequired = true)]
public long SetLocationType;
[ProtoMember(10, IsRequired = true)]
public long SpecialTitleID;
[ProtoMember(11, IsRequired = true)]
public long VirtutePoints;
[ProtoMember(12, IsRequired = true)]
public long HeavenBlessing;
[ProtoMember(13, IsRequired = true)]
public uint Strength;
[ProtoMember(14, IsRequired = true)]
public uint Agility;
[ProtoMember(15, IsRequired = true)]
public uint Vitality;
[ProtoMember(16, IsRequired = true)]
public uint Spirit;
[ProtoMember(17, IsRequired = true)]
public uint Atributes;
[ProtoMember(18, IsRequired = true)]
public uint HitPoints; // [ProtoFix 2026-10-14] client CMsgUserInfoPB #18 is uint32 (was int)
[ProtoMember(19, IsRequired = true)]
public uint Mana;
[ProtoMember(20, IsRequired = true)]
public uint PKPoints;
[ProtoMember(21, IsRequired = true)]
public ushort Level;
[ProtoMember(22, IsRequired = true)]
public uint Class;
[ProtoMember(23, IsRequired = true)]
public uint FirstClass;
[ProtoMember(24, IsRequired = true)]
public uint SecoundeClass;
[ProtoMember(25, IsRequired = true)]
public ulong NobilityRank;
[ProtoMember(26, IsRequired = true)]
public byte Reborn;
[ProtoMember(27, IsRequired = true)]
public long autoallot;
[ProtoMember(28, IsRequired = true)]
public uint QuizPoints;
[ProtoMember(29, IsRequired = true)]
public ulong MainFlag;
[ProtoMember(30, IsRequired = true)]
public long Enilghten;
[ProtoMember(31, IsRequired = true)]
public long EnlightenReceive;
[ProtoMember(32, IsRequired = true)]
public long Mentorachieve;
[ProtoMember(33, IsRequired = true)]
public long MentorDay;
[ProtoMember(34, IsRequired = true)]
public uint VipLevel;
[ProtoMember(35, IsRequired = true)]
public ushort MyTitle;
[ProtoMember(36, IsRequired = true)]
public uint BoundConquerPoints; // [ProtoFix 2026-10-14] client CMsgUserInfoPB #36 is uint32 (was int)
[ProtoMember(37, IsRequired = true)]
public ulong ActiveSublass;
[ProtoMember(38, IsRequired = true)]
public ulong SubClass;
[ProtoMember(39, IsRequired = true)]
public long RacePoints;
[ProtoMember(40, IsRequired = true)]
public long CountryID;
[ProtoMember(41, IsRequired = true)]
public long LeagueContributionLev;
[ProtoMember(42, IsRequired = true)]
public long SoldIdentity;
[ProtoMember(43, IsRequired = true)]
public long ProfExperience;
[ProtoMember(44, IsRequired = true)]
public long RegisterDay;
[ProtoMember(45, IsRequired = true)]
public long FaceFrame;
[ProtoMember(46, IsRequired = true)]
public string Names;
[ProtoMember(47, IsRequired = true)]
public string Spouse;
[ProtoMember(48, IsRequired = true)]
public long MaxFloor;
[ProtoMember(49, IsRequired = true)]
public long AccountFlag;
[ProtoMember(50, IsRequired = true)]
public string Description;
[ProtoMember(51, IsRequired = true)]
public ushort FrameID;
[ProtoMember(52, IsRequired = true)]
public ushort idFBLookFace;
}
}
public unsafe static partial class MsgBuilder
{
public static unsafe ServerSockets.Packet ClientInfo(this ServerSockets.Packet stream, Role.Player client, int inittransfer = 0)
{
stream.InitWriter();
var proto = new MsgClientInfo.ProtoStructure()
{
UID = client.UID,
AparenceType = client.AparenceType,
Mesh = client.Mesh,
Hair = client.Hair,
Money = client.Money,
ConquerPoints = (uint)client.ConquerPoints,
IDServer = (ushort)Database.GroupServerList.MyServerInfo.ID,
SetLocationType = client.SetLocationType,
SpecialTitleID = client.SpecialTitleID,
VirtutePoints = client.VirtutePoints,
HeavenBlessing = client.HeavenBlessing,
Strength = client.Strength,
Agility = client.Agility,
Vitality = client.Vitality,
Spirit = client.Spirit,
Atributes = client.Atributes,
HitPoints = (uint)System.Math.Max(0, client.HitPoints), // [ProtoFix 2026-10-14] clamp: a negative int would go out as a 10-byte varint
Mana = client.Mana,
PKPoints = client.PKPoints,
Level = client.Level,
Class = client.Class,
FirstClass = client.FirstClass,
SecoundeClass = client.SecoundeClass,
NobilityRank = (ulong)client.NobilityRank,
Reborn = client.Reborn,
autoallot= inittransfer,
QuizPoints = client.QuizPoints,
MainFlag = (ulong)client.MainFlag,
Enilghten = client.Enilghten,
EnlightenReceive = client.EnlightenReceive,
VipLevel = client.VipLevel,
MyTitle = client.MyTitle,
BoundConquerPoints = (uint)System.Math.Max(0, client.BoundConquerPoints), // [ProtoFix 2026-10-14] clamp negative
SubClass = (ulong)client.SubClass.GetHashPoint(),
ActiveSublass = (ulong)client.ActiveSublass,
RacePoints = client.RacePoints,
CountryID = client.CountryID,
LeagueContributionLev = 0,
SoldIdentity = 28433125,
//ProfExperience = 2400,
RegisterDay = 4638,
FaceFrame = client.Face,
Names = global::Qahr.Mobile.StaffTag.StaffTag.Display(clie nt),// QahrMobile: [GM]/[HD]/[PM] by account rank, Mobile/StaffTag/StaffTag.cs
Spouse = client.Spouse,
MaxFloor = 0,
AccountFlag = 0,
Description = client.Description,
FrameID= client.FrameID,
};
stream.ProtoBufferSerialize(proto);
stream.Finalize(GamePackets.MsgUserInfo);
return stream;
}
public static void GetHeroInfo(this ServerSockets.Packet stream, Client.GameClient Owner, out MsgClientInfo.ProtoStructure pQuery, out Role.Player user)
{
pQuery = new MsgClientInfo.ProtoStructure();
pQuery = stream.ProtoBufferDeserialize<MsgClientInfo.ProtoStructure>(pQuery);
user = new Role.Player(Owner);
user.InitTransfer = (uint)pQuery.autoallot;
user.RealUID = pQuery.UID;
user.AparenceType = pQuery.AparenceType;
user.Body = (ushort)(pQuery.Mesh % 10000);
user.Face = (ushort)(pQuery.Mesh / 10000);
user.Hair = pQuery.Hair;
user.Money = pQuery.Money;
user.ConquerPoints = (uint)pQuery.ConquerPoints;
user.Experience = (ulong)pQuery.Experience;
user.ServerID = pQuery.IDServer;
user.SetLocationType = (ushort)pQuery.SetLocationType;
user.SpecialTitleID = 0;
user.SpecialWingID = 0;
user.VirtutePoints = (uint)pQuery.VirtutePoints;
user.HeavenBlessing = stream.ReadInt32();
user.Strength = (ushort)pQuery.Strength;
user.Agility = (ushort)pQuery.Agility;
user.Vitality = (ushort)pQuery.Vitality;
user.Spirit = (ushort)pQuery.Spirit;
user.Atributes = (ushort)pQuery.Atributes;
user.HitPoints = (int)System.Math.Min(pQuery.HitPoints, (uint)int.MaxValue); // [ProtoFix 2026-10-14] uint -> int without wrap
user.Mana = (ushort)pQuery.Mana;
user.PKPoints = (ushort)pQuery.PKPoints;
user.Level = pQuery.Level;
user.Class = pQuery.Class;
user.FirstClass = pQuery.FirstClass;
user.SecoundeClass = pQuery.SecoundeClass;
user.NobilityRank = (Role.Instance.Nobility.NobilityRank)pQuery.Nobili tyRank;
user.Reborn = pQuery.Reborn;
user.QuizPoints = pQuery.QuizPoints;
user.MainFlag = (Qahr.Mobile.Role.Player.MainFlagType)pQuery.MainF lag;
user.Enilghten = (ushort)pQuery.Enilghten;
user.EnlightenReceive = (ushort)pQuery.EnlightenReceive;
user.VipLevel = (byte)pQuery.VipLevel;
user.MyTitle = (byte)pQuery.MyTitle;
user.BoundConquerPoints = (int)System.Math.Min(pQuery.BoundConquerPoints, (uint)int.MaxValue); // [ProtoFix 2026-10-14] uint -> int without wrap
user.CountryID = (ushort)pQuery.CountryID;
user.Face = (ushort)pQuery.FaceFrame;
user.Name = pQuery.Names;
user.Spouse = pQuery.Spouse;
user.Description = pQuery.Description;
}
public static unsafe ServerSockets.Packet LoaderHeroInfo(this ServerSockets.Packet stream, Role.Player client, byte inittransfer = 0)
{
stream.InitWriter();
stream.Write(client.UID);
stream.Write(client.Mesh);
stream.Write((ushort)Database.GroupServerList.MySe rverInfo.ID);
stream.Write((byte)client.Level);
stream.Write((byte)client.NobilityRank);
stream.Write((byte)client.VipLevel);
stream.Write((uint)client.Class);
stream.Write((ushort)0);
stream.Write(client.Name);
stream.Finalize(GamePackets.MsgUserInfo * 10);
return stream;
}
}
}
src/Qahr.Mobile.Game/Net/Packets/MsgServer/MsgMessage.Handler.cs متغير فيه سطرين (اسمك في الشات، والهمس للاسم اللي فيه الوسم).
// ================================================== ==========================
// MsgMessage.Handler - MsgHandler
// Part of the partial class MsgMessage (split by Server/DevTools/CsSplit, code moved unchanged).
// ================================================== ==========================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Qahr.Mobile.Game.MsgFloorItem;
using Qahr.Mobile.Game.MsgNpc;
using System.IO;
using ProtoBuf;
using Qahr.Mobile.Game.MsgTournaments;
using Qahr.Mobile.Role.Instance;
using Qahr.Mobile.Role;
using System.Xml.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Threading;
namespace Qahr.Mobile.Game.MsgServer
{
public partial class MsgMessage
{
[PacketAttribute(GamePackets.MsgTalk)]
public unsafe static void MsgHandler(Client.GameClient client, ServerSockets.Packet packet)
{
string str3;
int num3;
MsgMessage msg = new MsgMessage();
msg.Deserialize(packet);
// اسم المرسِل لازم يكون اسم اللاعب الحقيقي (كان ينفع يتزوّر SYSTEM أو اسم GM)
msg._From = global::Qahr.Mobile.StaffTag.StaffTag.Display(clie nt.Player);// QahrMobile: the sender's [GM]/[HD]/[PM] tag, Mobile/StaffTag/StaffTag.cs
if (client.Player.IsStillBanned)
{
if (client.Player.PermenantBannedChat)
{
client.SendSysMesage("Sorry, you still banned from chatting Permenatly.", ChatMode.System, MsgColor.white);
}
else
{
client.SendSysMesage("Sorry, you still banned from chatting till " + client.Player.BannedChatStamp.ToString(), ChatMode.System, MsgColor.white);
}
return;
}
if (ChatCommands(client, msg))
return;
if (msg.__Message.StartsWith("@"))
return;
try
{
string[] lines = msg.__Message.Split(new string[] { "[" }, StringSplitOptions.RemoveEmptyEntries);
for (int x = 0; x < lines.Length; x++)
{
string str = lines[x];
if (str.Contains("Item "))
{
string[] line = str.Split(' ');
if (line != null && line.Length > 2)
{
uint UID = 0;
if (uint.TryParse(line[2], out UID))
{
MsgGameItem msg_item;
if (client.TryGetItem(UID, out msg_item))
{
Pool.ChatItems.Add(msg_item.UID, msg_item);
}
}
}
}
}
}
catch (Exception e)
{
MyConsole.WriteException(e);
}
if (!client.IsGm)
{
if ((msg.__Message.Contains("عفواً لايمكن عرض الروابط في الإرشيف") || msg.__Message.Contains("عفواً لايمكن عرض الروابط في الإرشيف")) || msg.__Message.Contains(".com"))
{
string[] strArray3 = msg.__Message.Split(new string[] { " " }, StringSplitOptions.None);
num3 = 0;
while (num3 < strArray3.Length)
{
string oldValue = strArray3[num3];
if ((((oldValue.EndsWith(".com") || oldValue.EndsWith(".net")) || oldValue.StartsWith("عفواً لايمكن عرض الروابط في الإرشيف")) || oldValue.Contains(".com")) && !((oldValue.Contains("Lucky") || oldValue.Contains("mediafire")) || oldValue.Contains("gulfup")))
{
msg.__Message = msg.__Message.Replace(oldValue, "*****.com");
}
num3++;
}
client.CreateBoxDialog("You Can't Put Sites Here .");
}
}
msg.Mesh = client.Player.Mesh;
switch (msg.ChatType)
{
case ChatMode.CrosTheServer:
{
if (client.Inventory.Contain(3002218, 1))
{
packet.Seek(packet.Size - 8);
packet.Finalize(Game.GamePackets.MsgTalk);
if (client.Player.InUnion)
MsgInterServer.StaticConnexion.Send(packet);
else
MsgInterServer.StaticConnexion.Send(packet);
client.Inventory.Remove(3002218, 1, packet);
}
break;
}
case ChatMode.Ally:
{
if (client.Player.MyGuild != null)
{
foreach (var guild in client.Player.MyGuild.Ally.Values)
guild.SendPacket(msg.GetArray(packet));
}
break;
}
case ChatMode.HawkMessage:
{
if (client.IsVendor)
{
client.MyVendor.HalkMeesaje = msg;
client.Player.View.SendView(msg.GetArray(packet), true);
}
break;
}
case ChatMode.Team:
{
if (client.Team != null)
client.Team.SendTeam(msg.GetArray(packet), client.Player.UID);
break;
}
case MsgMessage.ChatMode.Talk:
{
client.Player.View.SendView(msg.GetArray(packet), false);
break;
}
case MsgMessage.ChatMode.World:
{
if (DateTime.Now > client.Player.LastWorldMessaj.AddSeconds(15))
{
client.Player.LastWorldMessaj = DateTime.Now;
foreach (var kv in Pool.GamePoll) // [perf] live lock-free enumeration (no .Values snapshot)
{
var user = kv.Value;
if (user.Player.UID != client.Player.UID)
{
if (user.Player.InUnion)
user.Send(msg.GetArray(packet, (uint)Role.Instance.Union.Member.GetRank(user.Play er.UnionMemeber.Rank)));
else
user.Send(msg.GetArray(packet));
}
}
}
break;
}
case ChatMode.Whisper:
{
bool send = false;
foreach (var kv in Pool.GamePoll) // [perf] live lock-free enumeration (no .Values snapshot)
{
var user = kv.Value;
if (user.Player.Name == msg._To || user.Player.Name == global::Qahr.Mobile.StaffTag.StaffTag.Strip(msg._T o))// QahrMobile: whisper to a "[GM]Name" shown name, Mobile/StaffTag/StaffTag.cs
{
msg.Mesh = client.Player.Mesh;
msg.UID = client.Player.UID;
user.Send(msg.GetArray(packet));
send = true;
break;
}
}
if (!send)
{
client.SendSysMesage("The player is not online.", ChatMode.System, MsgColor.white);
}
break;
}
case ChatMode.Guild:
{
if (client.Player.MyGuild != null)
client.Player.MyGuild.SendPacket(msg.GetArray(pack et));
break;
}
case ChatMode.Friend:
{
System.Collections.Concurrent.ConcurrentDictionary<uint, Role.Instance.Associate.Member> friends;
if (client.Player.Associate.Associat.TryGetValue(Role .Instance.Associate.Friends, out friends))
{
foreach (var user in Pool.GamePoll.Values)
{
if (friends.ContainsKey(user.Player.UID))
user.Send(msg.GetArray(packet));
}
}
break;
}
case ChatMode.Clan:
{
if (client.Player.MyClan != null)
client.Player.MyClan.Send(msg.GetArray(packet));
break;
}
}
}
}
}
بعدها اعمل Build وشغل السيرفر.
الوسوم اللي جاية في الملف:
3 [GM]
5 [HD]
255 [PM]
لو عايز الهيلبر يبقى [Helper] مثلا غير السطر التاني في الملف، ومش محتاج ريستارت للملف ده.
ملحوظة: الرتبة بتتقري وقت الدخول، فلو اديت حد رتبة وهو جوه اللعبة لازم يخرج ويدخل عشان الوسم يظهر.
الصور بعد الحل:
الأولى [GM]GuildTest فوق الشخصية وفي صورة الشخصية.
التانية الرسالة في الشات باسم [GM]GuildTest.
عفواً لايمكن عرض الروابط في الإرشيف
حل مشكلة اسم الجي ام اللي مش بياخد الوسم [GM] - سورس قهر موبايل النسخة التانية
السلام عليكم
لو اديت حساب رتبة GM أو PM أو Helper، الصلاحيات بتشتغل عادي والأوامر بتتنفذ، بس اسم الشخصية بيفضل زي ما هو من غير [GM] قدامه، لا فوق الشخصية ولا في الشات.
السبب
الرتبة في السورس بتتاخد من عمود State في جدول accounts:
3 يعني GM
5 يعني Helper
255 يعني PM
وده اتعمل كده عشان الأمان، لأن زمان في سورس الكمبيوتر الصلاحية كانت بتتعرف من الاسم نفسه، يعني لو اسمك فيه [GM] تبقى جي ام، وده كان ينفع يتزور.
فلما الصلاحية بقت من الحساب، محدش بقى بيحط الوسم في الاسم خالص، والاسم بيفضل عادي.
الحل
عملنا حاجة صغيرة بتحط الوسم قدام الاسم وقت العرض بس، على حسب رتبة الحساب.
الاسم المتسجل في الداتا بيفضل زي ما هو، يعني لو شلت الرتبة الوسم بيروح لوحده من أول دخول.
الوسم بيظهر فوق الشخصية، وفي صورة الشخصية فوق على الشمال، وكمان في الشات جنب الرسالة.
ولو حد كتب [GM]Name في الهمس، الرسالة بتوصل للشخص عادي.
الملفات في فولدر Server اللي مع الموضوع، انسخها فوق السورس:
Data/mobile_staff_tags.txt
# QahrMobile: the tag shown before a staff character's name (Mobile/StaffTag/StaffTag.cs).
# The rank is the account's accounts.State, read at login: 3 = GameMaster, 5 = GameHelper, 255 = ProjectManager.
# The tag is display only: the saved name does not change, so a rank given or removed shows at the next login.
# A whisper sent to the tagged name reaches the player. Delete a line to show that rank without a tag.
# <state> <tag> * tags are server choice
3 [GM]
5 [HD]
255 [PM]
ده ملف الوسوم، تقدر تغير الوسم لكل رتبة منه أو تمسح سطر لو مش عايز وسم للرتبة دي.
src/Qahr.Mobile.Game/Mobile/StaffTag/StaffTag.cs ملف جديد.
using System;
using System.Collections.Generic;
using Qahr.Mobile.Phone;
namespace Qahr.Mobile.StaffTag
{
/// <summary>QahrMobile: shows "[GM]" / "[HD]" / "[PM]" before a staff character's name. The rank comes from
/// accounts.State (GameClient.AccountState, 3 / 5 / 255) since the security fix, while the PC source expected the tag
/// to be typed into the name itself, so a GM made from the account kept a plain name. Display only, the saved name
/// is unchanged. Data\mobile_staff_tags.txt. Hooks: Player.GetArray (spawn), MsgClientInfo (own hero),
/// MsgMessage.Handler (whisper to a tagged name).</summary>
public static class StaffTag
{
const byte StateGameHelper = 5, StateProjectManager = 255;
static readonly DataFile<Dictionary<byte, string>> File =
new DataFile<Dictionary<byte, string>>("mobile_staff_tags.txt", "StaffTag", Parse);
static Dictionary<byte, string> Parse(string[] lines)
{
var tags = new Dictionary<byte, string>();
foreach (var line in DataFile.Clean(lines))
{
var w = DataFile.Words(line);
byte state;
if (w.Length < 2 || !byte.TryParse(w[0], out state))
{
MyConsole.WriteLine("[StaffTag] mobile_staff_tags.txt: bad line skipped: " + line, ConsoleColor.Red);
continue;
}
tags[state] = w[1];
}
return tags;
}
/// <summary>The name to show for this player: the staff tag + the name, or the name alone.</summary>
public static string Display(Role.Player p)
{
string name = p.Name ?? "";
string tag = TagOf(p.Owner);
return tag == null || name.StartsWith(tag, StringComparison.Ordinal) ? name : tag + name;
}
/// <summary>The saved name behind a shown name (a whisper typed to "[GM]Name" reaches "Name").</summary>
public static string Strip(string shown)
{
if (string.IsNullOrEmpty(shown)) return shown;
foreach (var tag in File.Value.Values)
if (shown.Length > tag.Length && shown.StartsWith(tag, StringComparison.Ordinal))
return shown.Substring(tag.Length);
return shown;
}
static string TagOf(Client.GameClient c)
{
if (c == null || c.Player == null) return null;
byte state = c.AccountState;
if (c.ProjectManager) state = StateProjectManager;
else if (c.HelpDesk && !c.IsStaffAccount) state = StateGameHelper;
string tag;
return File.Value.TryGetValue(state, out tag) ? tag : null;
}
}
}
src/Qahr.Mobile.Game/Gameplay/Players/Player.GetArray.cs متغير فيه سطر واحد (الاسم اللي فوق الشخصية).
// ================================================== ==========================
// Player.GetArray - GetArray, MysteryFruit, GetShareBattlePowers, TableID, PokerTableID, PokerSeat, VotePoints, Guild...
// Part of the partial class Player (split by Server/DevTools/CsSplit, code moved unchanged).
// ================================================== ==========================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;
using Qahr.Mobile.Game.MsgServer;
using Qahr.Mobile.Game.MsgNpc;
using Qahr.Mobile.Role.Instance;
using System.Windows.Forms;
using ProtoBuf;
using System.IO;
using Qahr.Mobile.Game.MsgTournaments;
using Qahr.Mobile.Game.MsgMonster;
using Qahr.Mobile.Database;
using Qahr.Mobile.Game.MsgFloorItem;
namespace Qahr.Mobile.Role
{
public unsafe partial class Player
{
public unsafe ServerSockets.Packet GetArray(ServerSockets.Packet stream, bool WindowsView)
{
byte prestigeRank = (byte)Database.PrestigeRanking.GetMyRank(Database. PrestigeRanking.GetIndex(Class), UID);
stream.InitWriter();
var proto = new SpawnPacketProto()
{
UID = UID,
Mesh = Mesh,
Head = HeadId,
Garment = GarmentId,
LeftWeapon = LeftWeaponId,
LeftWeaponSoul = LeftWeapsonSoul,
RightWeapon = RightWeaponId,
RightWeaponSoul = RightWeapsonSoul,
LeftWeaponAccessory = LeftWeaponAccessoryId,
RightWeaponAccessory = RightWeaponAccessoryId,
Steed = SteedId,
MountArmor = MountArmorId,
AppearanceType = (ushort)AparenceType,
GuildRank = (uint)GuildRank,
GuildID = GuildID,
Wing = WingTitleHaloHide ? 0 : WingId,
WingPlus = WingPlus,
WingProgress = WingProgress,
Bottle = Bottle,
Hitpoints = (uint)HitPoints,
X = X,
Y = Y,
HairStyle = Hair,
Facing = (byte)Angle,
Action = (ushort)Action,
Reborn = Reborn,
SecondRebornClass = SecoundeClass,
FirstRebornClass = FirstClass,
Level = Level,
WindowSpawn = (byte)(WindowsView ? 1 : 0),
Away = Away > 0,
ExtraBattlePower = ExtraBattlePower,
FlowerIcon = FairyForm,//This for FairyForm, if you're not transform in fairy default value is -1
NobilityRank = (byte)NobilityRank,
Armor = ArmorId,
ArmorSoul = ArmorSoul,
HeadSoul = HeadSoul,
SteedColor = SteedColor,
SteedPlus = SteedPlus,
ClanUID = ClanUID,
ClanRank = ClanRank,
Title = SomeHide ? 0 : (uint)MyTitle,
ActiveSubClasses = (byte)ActiveSublass,
SubClass = SubClassHasPoints,
JiangHuActive = JiangHuActive > 0,
JiangHuTalent = JiangHuTalent,
MaxLife = Owner.Status.MaxHitpoints,
RealUID = RealUID,
UnionID = InUnion ? MyUnion.UID : 0,
UnionType = InUnion ? (uint)MyUnion.IsKingdom : 0,
BattlePower = BattlePower,
QuizPoints = QuizPoints,
Class = Class,
GuildBattlePower = GuildBattlePower,
InvisibleArena = (byte)(Owner.IsWatching() ? 1 : 0),
MyWing = WingTitleHaloHide ? 0 : SpecialWingID,
MyTitle = WingTitleHaloHide ? 0 : SpecialTitleID,
MyTitleScore = SpecialTitleScore,
CountryCode = CountryID,
PrestigeRank = (byte)(prestigeRank >= 1 && prestigeRank <= 3 ? prestigeRank : 0),
InnerStrengthScore = InnerPower.TotalScore,
MainFlag = (byte)MainFlag,
Enlighten = Enilghten,
Official_Harem_Guards = InUnion ? (uint)ExploitsRank : 0,
Name = System.Text.Encoding.UTF8.GetBytes(global::Qahr.Mo bile.StaffTag.StaffTag.Display(this)),// QahrMobile: [GM]/[HD]/[PM] by account rank, Mobile/StaffTag/StaffTag.cs
FamilyName = System.Text.Encoding.UTF8.GetBytes(""),
SyndicateName = System.Text.Encoding.UTF8.GetBytes(MyGuild != null ? MyGuild.GuildName : ""),
LeagueName = System.Text.Encoding.UTF8.GetBytes(!InUnion ? "" : MyUnion.Name),
MateName = System.Text.Encoding.UTF8.GetBytes(ClanName ?? ""),
OwnerPetName = System.Text.Encoding.UTF8.GetBytes(""),
Name134 = System.Text.Encoding.UTF8.GetBytes("")
};
Qahr.Mobile.Phone.ItemVisuals.Dress(proto);// QahrMobile: item visuals (look/soul/steed colour others see), Mobile/ItemVisuals/ItemVisuals.cs
MsgGameItem relic;
if (Owner.Equipment.TryGetEquip(Flags.ConquerItem.Rel ics, out relic))
{
var RelicFlag = relic.RelicAttributes.Where(i => i > 0 && i.Epic);
if (RelicFlag.Count() >= 5)
{
proto.Relic = (byte)(50 + relic.RelicAttributes.Where(i => i > 0 && i.Epic).Count());
}
else if (RelicFlag.Count() == 1)
proto.Relic = (byte)(43 + relic.RelicAttributes.Where(i => i > 0 && i.Epic).Count());
else if (RelicFlag.Count() >= 2)
proto.Relic = (byte)(39 + relic.RelicAttributes.Where(i => i > 0 && i.Epic).Count());
else
proto.Relic = (byte)(42 + relic.RelicAttributes.Where(i => i > 0 && i.Epic).Count());
}
proto.SageMode1 = NiniaP0;
if (Owner.Player.CollectionID != 0)
proto.PistilAroma = Owner.Player.CollectionID;
if (Owner.Player.PandaID != 0)
proto.PandaPonpon = Owner.Player.PandaID;
proto.HaloTitle = WingTitleHaloHide ? 0 : Owner.Player.SpecialHaloID;
proto.StatusFlags = new ulong[BitVector.bits.Length];
proto.Medal = Medal;
for (int x = 0; x < BitVector.bits.Length; x++)
proto.StatusFlags[x] = BitVector.bits[x];
proto.HundredWeapons = new long[5];
var visibleHundredWeapons = Owner.HundredWeapons.Objects.Values.Where(i => i.AppearancePosition > 0).OrderBy(i => i.AppearancePosition).ToArray();
for (int i = 0; i < Math.Min(proto.HundredWeapons.Length, visibleHundredWeapons.Length); i++)
{
var binaryFormat = Convert.ToString((int)visibleHundredWeapons[i].WeaponSubtype, 2) + Convert.ToString(visibleHundredWeapons[i].Score, 2);
while (binaryFormat.Length < 25)
binaryFormat = binaryFormat + "0";
proto.HundredWeapons[i] = Convert.ToUInt32(binaryFormat, 2);
}
proto.MountArmorColor = MountArmorColor;
proto.FrameID = Owner.Player.FrameID;
proto.todayFlowerType = TodayFlowerType;
proto.FlowerRank = (ulong)FlowerRank;
proto.MachineInfo = Owner.Player.TableBetDice;
if (AtributesStatus.IsWarrior(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[1] = (uint)obj.ItemID * 10 + obj.dwParam;
proto.HundredWeapons[2] = obj.Progress;
}
}
if (AtributesStatus.IsArcher(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[1] = (uint)obj.ItemID;
proto.HundredWeapons[2] = obj.Progress;
}
}
if (AtributesStatus.IsMonk(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[1] = (uint)obj.ItemID;
proto.HundredWeapons[2] = obj.Progress;
}
}
if (AtributesStatus.IsTaoist(this.Class))
{
Archives.Item t = this.Owner.MyArchives.isOpen();
if (t != null)
{
proto.HundredWeapons = new long[4];
proto.HundredWeapons[0] = (uint)(t.ItemID);
proto.HundredWeapons[1] = t.Progress;
if (this.TaoHeavenState > 0)
proto.HundredWeapons[2] = this.Owner.HeavenVector;
else
proto.HundredWeapons[2] = 31;
}
}
if (AtributesStatus.IsPirate(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[0] = (uint)(obj.ItemID);
proto.HundredWeapons[2] = obj.Progress;
}
}
if (AtributesStatus.IsLee(this.Class))
{
Archives.Item obj = this.Owner.MyArchives.isOpen();
if (obj != null)
{
proto.HundredWeapons[0] = (uint)(obj.ItemID);
proto.HundredWeapons[1] = obj.Progress;
proto.HundredWeapons[3] = (long)Owner.MyArchives.Effect;
}
}
proto.FootPrintID = SpecialFootprintID;
proto.ActionCool = SpecialHaloAction;
proto.FootPrintScore = SpecialFootprintScore;
proto.ActionCoolScore = SpecialHaloActionScore;
stream.ProtoBufferSerialize(proto);
stream.Finalize(Game.GamePackets.MsgPlayer);
return stream;
}
public byte MysteryFruit = 0;
public uint GetShareBattlePowers(uint target_battlepower)
{
return (uint)Database.TutorInfo.ShareBattle(this.Owner, (int)target_battlepower);
}
public uint TableID { get; set; }
public uint PokerTableID { get; set; }
public byte PokerSeat { get; set; }
public byte VotePoints = 0;
public byte GuildBoss;
public uint NobilityCps = 0;
public Qahr.Mobile.Game.MsgServer.MsgSpell FocusClientSpell;
public Qahr.Mobile.Game.MsgServer.MsgSpell WeepStorm;
public bool doFocus = false;
}
}
src/Qahr.Mobile.Game/Net/Packets/MsgLogin/MsgClientInfo.cs متغير فيه سطر واحد (اسمك في الصورة بتاعتك).
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProtoBuf;
namespace Qahr.Mobile.Game.MsgServer
{
public unsafe static partial class MsgBuilder
{
}
public class MsgClientInfo
{
[ProtoContract]
public class ProtoStructure
{
[ProtoMember(1, IsRequired = true)]
public uint UID;
[ProtoMember(2, IsRequired = true)]
public uint AparenceType;
[ProtoMember(3, IsRequired = true)]
public uint Mesh;
[ProtoMember(4, IsRequired = true)]
public uint Hair;
[ProtoMember(5, IsRequired = true)]
public ulong Money;
[ProtoMember(6, IsRequired = true)]
public uint ConquerPoints;
[ProtoMember(7, IsRequired = true)]
public long Experience;
[ProtoMember(8, IsRequired = true)]
public ushort IDServer;
[ProtoMember(9, IsRequired = true)]
public long SetLocationType;
[ProtoMember(10, IsRequired = true)]
public long SpecialTitleID;
[ProtoMember(11, IsRequired = true)]
public long VirtutePoints;
[ProtoMember(12, IsRequired = true)]
public long HeavenBlessing;
[ProtoMember(13, IsRequired = true)]
public uint Strength;
[ProtoMember(14, IsRequired = true)]
public uint Agility;
[ProtoMember(15, IsRequired = true)]
public uint Vitality;
[ProtoMember(16, IsRequired = true)]
public uint Spirit;
[ProtoMember(17, IsRequired = true)]
public uint Atributes;
[ProtoMember(18, IsRequired = true)]
public uint HitPoints; // [ProtoFix 2026-10-14] client CMsgUserInfoPB #18 is uint32 (was int)
[ProtoMember(19, IsRequired = true)]
public uint Mana;
[ProtoMember(20, IsRequired = true)]
public uint PKPoints;
[ProtoMember(21, IsRequired = true)]
public ushort Level;
[ProtoMember(22, IsRequired = true)]
public uint Class;
[ProtoMember(23, IsRequired = true)]
public uint FirstClass;
[ProtoMember(24, IsRequired = true)]
public uint SecoundeClass;
[ProtoMember(25, IsRequired = true)]
public ulong NobilityRank;
[ProtoMember(26, IsRequired = true)]
public byte Reborn;
[ProtoMember(27, IsRequired = true)]
public long autoallot;
[ProtoMember(28, IsRequired = true)]
public uint QuizPoints;
[ProtoMember(29, IsRequired = true)]
public ulong MainFlag;
[ProtoMember(30, IsRequired = true)]
public long Enilghten;
[ProtoMember(31, IsRequired = true)]
public long EnlightenReceive;
[ProtoMember(32, IsRequired = true)]
public long Mentorachieve;
[ProtoMember(33, IsRequired = true)]
public long MentorDay;
[ProtoMember(34, IsRequired = true)]
public uint VipLevel;
[ProtoMember(35, IsRequired = true)]
public ushort MyTitle;
[ProtoMember(36, IsRequired = true)]
public uint BoundConquerPoints; // [ProtoFix 2026-10-14] client CMsgUserInfoPB #36 is uint32 (was int)
[ProtoMember(37, IsRequired = true)]
public ulong ActiveSublass;
[ProtoMember(38, IsRequired = true)]
public ulong SubClass;
[ProtoMember(39, IsRequired = true)]
public long RacePoints;
[ProtoMember(40, IsRequired = true)]
public long CountryID;
[ProtoMember(41, IsRequired = true)]
public long LeagueContributionLev;
[ProtoMember(42, IsRequired = true)]
public long SoldIdentity;
[ProtoMember(43, IsRequired = true)]
public long ProfExperience;
[ProtoMember(44, IsRequired = true)]
public long RegisterDay;
[ProtoMember(45, IsRequired = true)]
public long FaceFrame;
[ProtoMember(46, IsRequired = true)]
public string Names;
[ProtoMember(47, IsRequired = true)]
public string Spouse;
[ProtoMember(48, IsRequired = true)]
public long MaxFloor;
[ProtoMember(49, IsRequired = true)]
public long AccountFlag;
[ProtoMember(50, IsRequired = true)]
public string Description;
[ProtoMember(51, IsRequired = true)]
public ushort FrameID;
[ProtoMember(52, IsRequired = true)]
public ushort idFBLookFace;
}
}
public unsafe static partial class MsgBuilder
{
public static unsafe ServerSockets.Packet ClientInfo(this ServerSockets.Packet stream, Role.Player client, int inittransfer = 0)
{
stream.InitWriter();
var proto = new MsgClientInfo.ProtoStructure()
{
UID = client.UID,
AparenceType = client.AparenceType,
Mesh = client.Mesh,
Hair = client.Hair,
Money = client.Money,
ConquerPoints = (uint)client.ConquerPoints,
IDServer = (ushort)Database.GroupServerList.MyServerInfo.ID,
SetLocationType = client.SetLocationType,
SpecialTitleID = client.SpecialTitleID,
VirtutePoints = client.VirtutePoints,
HeavenBlessing = client.HeavenBlessing,
Strength = client.Strength,
Agility = client.Agility,
Vitality = client.Vitality,
Spirit = client.Spirit,
Atributes = client.Atributes,
HitPoints = (uint)System.Math.Max(0, client.HitPoints), // [ProtoFix 2026-10-14] clamp: a negative int would go out as a 10-byte varint
Mana = client.Mana,
PKPoints = client.PKPoints,
Level = client.Level,
Class = client.Class,
FirstClass = client.FirstClass,
SecoundeClass = client.SecoundeClass,
NobilityRank = (ulong)client.NobilityRank,
Reborn = client.Reborn,
autoallot= inittransfer,
QuizPoints = client.QuizPoints,
MainFlag = (ulong)client.MainFlag,
Enilghten = client.Enilghten,
EnlightenReceive = client.EnlightenReceive,
VipLevel = client.VipLevel,
MyTitle = client.MyTitle,
BoundConquerPoints = (uint)System.Math.Max(0, client.BoundConquerPoints), // [ProtoFix 2026-10-14] clamp negative
SubClass = (ulong)client.SubClass.GetHashPoint(),
ActiveSublass = (ulong)client.ActiveSublass,
RacePoints = client.RacePoints,
CountryID = client.CountryID,
LeagueContributionLev = 0,
SoldIdentity = 28433125,
//ProfExperience = 2400,
RegisterDay = 4638,
FaceFrame = client.Face,
Names = global::Qahr.Mobile.StaffTag.StaffTag.Display(clie nt),// QahrMobile: [GM]/[HD]/[PM] by account rank, Mobile/StaffTag/StaffTag.cs
Spouse = client.Spouse,
MaxFloor = 0,
AccountFlag = 0,
Description = client.Description,
FrameID= client.FrameID,
};
stream.ProtoBufferSerialize(proto);
stream.Finalize(GamePackets.MsgUserInfo);
return stream;
}
public static void GetHeroInfo(this ServerSockets.Packet stream, Client.GameClient Owner, out MsgClientInfo.ProtoStructure pQuery, out Role.Player user)
{
pQuery = new MsgClientInfo.ProtoStructure();
pQuery = stream.ProtoBufferDeserialize<MsgClientInfo.ProtoStructure>(pQuery);
user = new Role.Player(Owner);
user.InitTransfer = (uint)pQuery.autoallot;
user.RealUID = pQuery.UID;
user.AparenceType = pQuery.AparenceType;
user.Body = (ushort)(pQuery.Mesh % 10000);
user.Face = (ushort)(pQuery.Mesh / 10000);
user.Hair = pQuery.Hair;
user.Money = pQuery.Money;
user.ConquerPoints = (uint)pQuery.ConquerPoints;
user.Experience = (ulong)pQuery.Experience;
user.ServerID = pQuery.IDServer;
user.SetLocationType = (ushort)pQuery.SetLocationType;
user.SpecialTitleID = 0;
user.SpecialWingID = 0;
user.VirtutePoints = (uint)pQuery.VirtutePoints;
user.HeavenBlessing = stream.ReadInt32();
user.Strength = (ushort)pQuery.Strength;
user.Agility = (ushort)pQuery.Agility;
user.Vitality = (ushort)pQuery.Vitality;
user.Spirit = (ushort)pQuery.Spirit;
user.Atributes = (ushort)pQuery.Atributes;
user.HitPoints = (int)System.Math.Min(pQuery.HitPoints, (uint)int.MaxValue); // [ProtoFix 2026-10-14] uint -> int without wrap
user.Mana = (ushort)pQuery.Mana;
user.PKPoints = (ushort)pQuery.PKPoints;
user.Level = pQuery.Level;
user.Class = pQuery.Class;
user.FirstClass = pQuery.FirstClass;
user.SecoundeClass = pQuery.SecoundeClass;
user.NobilityRank = (Role.Instance.Nobility.NobilityRank)pQuery.Nobili tyRank;
user.Reborn = pQuery.Reborn;
user.QuizPoints = pQuery.QuizPoints;
user.MainFlag = (Qahr.Mobile.Role.Player.MainFlagType)pQuery.MainF lag;
user.Enilghten = (ushort)pQuery.Enilghten;
user.EnlightenReceive = (ushort)pQuery.EnlightenReceive;
user.VipLevel = (byte)pQuery.VipLevel;
user.MyTitle = (byte)pQuery.MyTitle;
user.BoundConquerPoints = (int)System.Math.Min(pQuery.BoundConquerPoints, (uint)int.MaxValue); // [ProtoFix 2026-10-14] uint -> int without wrap
user.CountryID = (ushort)pQuery.CountryID;
user.Face = (ushort)pQuery.FaceFrame;
user.Name = pQuery.Names;
user.Spouse = pQuery.Spouse;
user.Description = pQuery.Description;
}
public static unsafe ServerSockets.Packet LoaderHeroInfo(this ServerSockets.Packet stream, Role.Player client, byte inittransfer = 0)
{
stream.InitWriter();
stream.Write(client.UID);
stream.Write(client.Mesh);
stream.Write((ushort)Database.GroupServerList.MySe rverInfo.ID);
stream.Write((byte)client.Level);
stream.Write((byte)client.NobilityRank);
stream.Write((byte)client.VipLevel);
stream.Write((uint)client.Class);
stream.Write((ushort)0);
stream.Write(client.Name);
stream.Finalize(GamePackets.MsgUserInfo * 10);
return stream;
}
}
}
src/Qahr.Mobile.Game/Net/Packets/MsgServer/MsgMessage.Handler.cs متغير فيه سطرين (اسمك في الشات، والهمس للاسم اللي فيه الوسم).
// ================================================== ==========================
// MsgMessage.Handler - MsgHandler
// Part of the partial class MsgMessage (split by Server/DevTools/CsSplit, code moved unchanged).
// ================================================== ==========================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Qahr.Mobile.Game.MsgFloorItem;
using Qahr.Mobile.Game.MsgNpc;
using System.IO;
using ProtoBuf;
using Qahr.Mobile.Game.MsgTournaments;
using Qahr.Mobile.Role.Instance;
using Qahr.Mobile.Role;
using System.Xml.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Threading;
namespace Qahr.Mobile.Game.MsgServer
{
public partial class MsgMessage
{
[PacketAttribute(GamePackets.MsgTalk)]
public unsafe static void MsgHandler(Client.GameClient client, ServerSockets.Packet packet)
{
string str3;
int num3;
MsgMessage msg = new MsgMessage();
msg.Deserialize(packet);
// اسم المرسِل لازم يكون اسم اللاعب الحقيقي (كان ينفع يتزوّر SYSTEM أو اسم GM)
msg._From = global::Qahr.Mobile.StaffTag.StaffTag.Display(clie nt.Player);// QahrMobile: the sender's [GM]/[HD]/[PM] tag, Mobile/StaffTag/StaffTag.cs
if (client.Player.IsStillBanned)
{
if (client.Player.PermenantBannedChat)
{
client.SendSysMesage("Sorry, you still banned from chatting Permenatly.", ChatMode.System, MsgColor.white);
}
else
{
client.SendSysMesage("Sorry, you still banned from chatting till " + client.Player.BannedChatStamp.ToString(), ChatMode.System, MsgColor.white);
}
return;
}
if (ChatCommands(client, msg))
return;
if (msg.__Message.StartsWith("@"))
return;
try
{
string[] lines = msg.__Message.Split(new string[] { "[" }, StringSplitOptions.RemoveEmptyEntries);
for (int x = 0; x < lines.Length; x++)
{
string str = lines[x];
if (str.Contains("Item "))
{
string[] line = str.Split(' ');
if (line != null && line.Length > 2)
{
uint UID = 0;
if (uint.TryParse(line[2], out UID))
{
MsgGameItem msg_item;
if (client.TryGetItem(UID, out msg_item))
{
Pool.ChatItems.Add(msg_item.UID, msg_item);
}
}
}
}
}
}
catch (Exception e)
{
MyConsole.WriteException(e);
}
if (!client.IsGm)
{
if ((msg.__Message.Contains("عفواً لايمكن عرض الروابط في الإرشيف") || msg.__Message.Contains("عفواً لايمكن عرض الروابط في الإرشيف")) || msg.__Message.Contains(".com"))
{
string[] strArray3 = msg.__Message.Split(new string[] { " " }, StringSplitOptions.None);
num3 = 0;
while (num3 < strArray3.Length)
{
string oldValue = strArray3[num3];
if ((((oldValue.EndsWith(".com") || oldValue.EndsWith(".net")) || oldValue.StartsWith("عفواً لايمكن عرض الروابط في الإرشيف")) || oldValue.Contains(".com")) && !((oldValue.Contains("Lucky") || oldValue.Contains("mediafire")) || oldValue.Contains("gulfup")))
{
msg.__Message = msg.__Message.Replace(oldValue, "*****.com");
}
num3++;
}
client.CreateBoxDialog("You Can't Put Sites Here .");
}
}
msg.Mesh = client.Player.Mesh;
switch (msg.ChatType)
{
case ChatMode.CrosTheServer:
{
if (client.Inventory.Contain(3002218, 1))
{
packet.Seek(packet.Size - 8);
packet.Finalize(Game.GamePackets.MsgTalk);
if (client.Player.InUnion)
MsgInterServer.StaticConnexion.Send(packet);
else
MsgInterServer.StaticConnexion.Send(packet);
client.Inventory.Remove(3002218, 1, packet);
}
break;
}
case ChatMode.Ally:
{
if (client.Player.MyGuild != null)
{
foreach (var guild in client.Player.MyGuild.Ally.Values)
guild.SendPacket(msg.GetArray(packet));
}
break;
}
case ChatMode.HawkMessage:
{
if (client.IsVendor)
{
client.MyVendor.HalkMeesaje = msg;
client.Player.View.SendView(msg.GetArray(packet), true);
}
break;
}
case ChatMode.Team:
{
if (client.Team != null)
client.Team.SendTeam(msg.GetArray(packet), client.Player.UID);
break;
}
case MsgMessage.ChatMode.Talk:
{
client.Player.View.SendView(msg.GetArray(packet), false);
break;
}
case MsgMessage.ChatMode.World:
{
if (DateTime.Now > client.Player.LastWorldMessaj.AddSeconds(15))
{
client.Player.LastWorldMessaj = DateTime.Now;
foreach (var kv in Pool.GamePoll) // [perf] live lock-free enumeration (no .Values snapshot)
{
var user = kv.Value;
if (user.Player.UID != client.Player.UID)
{
if (user.Player.InUnion)
user.Send(msg.GetArray(packet, (uint)Role.Instance.Union.Member.GetRank(user.Play er.UnionMemeber.Rank)));
else
user.Send(msg.GetArray(packet));
}
}
}
break;
}
case ChatMode.Whisper:
{
bool send = false;
foreach (var kv in Pool.GamePoll) // [perf] live lock-free enumeration (no .Values snapshot)
{
var user = kv.Value;
if (user.Player.Name == msg._To || user.Player.Name == global::Qahr.Mobile.StaffTag.StaffTag.Strip(msg._T o))// QahrMobile: whisper to a "[GM]Name" shown name, Mobile/StaffTag/StaffTag.cs
{
msg.Mesh = client.Player.Mesh;
msg.UID = client.Player.UID;
user.Send(msg.GetArray(packet));
send = true;
break;
}
}
if (!send)
{
client.SendSysMesage("The player is not online.", ChatMode.System, MsgColor.white);
}
break;
}
case ChatMode.Guild:
{
if (client.Player.MyGuild != null)
client.Player.MyGuild.SendPacket(msg.GetArray(pack et));
break;
}
case ChatMode.Friend:
{
System.Collections.Concurrent.ConcurrentDictionary<uint, Role.Instance.Associate.Member> friends;
if (client.Player.Associate.Associat.TryGetValue(Role .Instance.Associate.Friends, out friends))
{
foreach (var user in Pool.GamePoll.Values)
{
if (friends.ContainsKey(user.Player.UID))
user.Send(msg.GetArray(packet));
}
}
break;
}
case ChatMode.Clan:
{
if (client.Player.MyClan != null)
client.Player.MyClan.Send(msg.GetArray(packet));
break;
}
}
}
}
}
بعدها اعمل Build وشغل السيرفر.
الوسوم اللي جاية في الملف:
3 [GM]
5 [HD]
255 [PM]
لو عايز الهيلبر يبقى [Helper] مثلا غير السطر التاني في الملف، ومش محتاج ريستارت للملف ده.
ملحوظة: الرتبة بتتقري وقت الدخول، فلو اديت حد رتبة وهو جوه اللعبة لازم يخرج ويدخل عشان الوسم يظهر.
الصور بعد الحل:
الأولى [GM]GuildTest فوق الشخصية وفي صورة الشخصية.
التانية الرسالة في الشات باسم [GM]GuildTest.