本文整理汇总了C#中Packet.WriteMapleString方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteMapleString方法的具体用法?C# Packet.WriteMapleString怎么用?C# Packet.WriteMapleString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.WriteMapleString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckNameResult
public static Packet CheckNameResult(string pName, bool pUsed)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Check_Name_Result);
p.WriteMapleString(pName);
p.WriteByte((byte)(pUsed ? 1 : 0));
return p;
}
示例2: LoginBackground
public static Packet LoginBackground(Dictionary<string, int> pBackgrounds)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Login_Background);
foreach (KeyValuePair<string, int> Background in pBackgrounds)
{
p.WriteMapleString(Background.Key);
p.WriteByte((byte)Background.Value);
}
return p;
}
示例3: Login
public static Packet Login(Client pClient, long pSessionId)
{
Packet p = new Packet();
p.WriteByte((byte)SendOpcodes.Login_Status);
p.WriteByte(0);
p.WriteByte(0);
p.WriteInt(0);
p.WriteInt(pClient.Account.Id);
p.WriteByte(0);
p.WriteBool(false); // TODO: Admin.
p.WriteByte(1);
p.WriteMapleString(pClient.Account.Username);
p.WriteInt(0);
p.WriteInt(0);
p.WriteInt(0);
return p;
}
示例4: Worldlist
public static Packet Worldlist(World pWorld, int[] pLoads)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.World_Information);
p.WriteByte(pWorld.Id);
p.WriteMapleString(pWorld.Name);
p.WriteByte(2); // TODO: Flag.
p.WriteMapleString(Constants.EventMessage);
p.WriteShort(100);
p.WriteShort(100);
p.WriteByte(0);
p.WriteByte((byte)pLoads.Length);
int Id = 1;
foreach (int Load in pLoads)
{
Console.WriteLine("Load: " + Load);
p.WriteMapleString(String.Format("{0}-{1}", pWorld.Name, Id));
p.WriteInt(Load * 200);
p.WriteByte(pWorld.Id);
p.WriteShort((short)(Id - 1));
Id++;
}
p.WriteShort(0);
p.WriteInt(0);
p.WriteByte(0);
return p;
}
示例5: PlayerChat
public static Packet PlayerChat(int pCharacterId, string pMessage, bool pWhiteBackground, byte pShow)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Player_Chat);
p.WriteInt(pCharacterId);
p.WriteBool(pWhiteBackground);
p.WriteMapleString(pMessage);
p.WriteByte(pShow);
return p;
}
示例6: CharacterEnter
public static Packet CharacterEnter(Character pCharacter)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Player_Spawn);
p.WriteInt(pCharacter.Id);
p.WriteByte(pCharacter.Level);
p.WriteMapleString(pCharacter.Name);
// Quest 111111 - I don't care for now.
p.WriteMapleString("");
// TODO: Guilds!
p.WriteZero(8);
p.WriteByte(0);
// Buffs
List<Pair<int, int>> BuffValue = new List<Pair<int, int>>();
List<Pair<int, int>> BuffValueNew = new List<Pair<int, int>>();
int[] Mask = new int[12];
Mask[0] |= -33554432;
Mask[1] |= 512;
Mask[5] |= 163840;
for (int i = 0; i < Mask.Length; i++)
{
p.WriteInt(Mask[i]);
}
foreach (Pair<int, int> i in BuffValue)
{
if (i.Right == 3)
{
p.WriteInt(i.Left);
}
else if (i.Right == 2)
{
p.WriteShort((short)i.Left);
}
else if (i.Right == 1)
{
p.WriteByte((byte)i.Left);
}
}
p.WriteInt(-1);
if (BuffValueNew.Count < 1)
{
p.WriteZero(10);
}
else
{
p.WriteByte(0);
foreach (Pair<int, int> i in BuffValueNew)
{
if (i.Right == 4)
{
p.WriteInt(i.Left);
}
else if (i.Right == 2)
{
p.WriteShort((short)i.Left);
}
else if (i.Right == 1)
{
p.WriteByte((byte)i.Left);
}
else if (i.Right == 0)
{
p.WriteZero((byte)i.Left);
}
}
}
p.WriteZero(20);
int Magic_Spawn = new Random().Next();
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(10);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(10);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteShort(0);
// TODO: Mounts.
p.WriteLong(0L);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteLong(0L);
p.WriteByte(1);
p.WriteInt(Magic_Spawn);
p.WriteZero(15);
p.WriteByte(1);
//.........这里部分代码省略.........
示例7: AddCharacterInformation
public static void AddCharacterInformation(Packet pPacket, Character pCharacter)
{
pPacket.WriteInt(-1);
pPacket.WriteInt(-2097153);
pPacket.WriteZero(20);
AddCharacterStats(pPacket, pCharacter);
pPacket.WriteByte(20); // TODO: Buddylist class.
pPacket.WriteByte(0);
pPacket.WriteByte(0);
pPacket.WriteByte(0);
AddInventoryInfo(pPacket, pCharacter);
AddSkillInfo(pPacket, pCharacter);
AddCooldownInfo(pPacket, pCharacter);
AddQuestInfo(pPacket, pCharacter);
AddRingInfo(pPacket, pCharacter);
AddRocksInfo(pPacket, pCharacter);
AddMonsterBookInfo(pPacket, pCharacter);
pPacket.WriteShort(0);
pPacket.WriteShort(0);
// TODO: Quest info packet.
pPacket.WriteShort(0);
if (Constants.JobConstants.isWildHunter(pCharacter.Job))
AddJaguarInfo(pPacket, pCharacter);
pPacket.WriteByte(0);
AddStealSkills(pPacket, pCharacter);
AddInnerStats(pPacket, pCharacter);
pPacket.WriteLong(1);
pPacket.WriteLong(1);
pPacket.WriteLong(0);
pPacket.WriteLong(0);
pPacket.WriteByte(0);
pPacket.WriteLong(Tools.GetTime(-2));
pPacket.WriteInt(0);
pPacket.WriteByte(0);
//TODO: Farm Info.
pPacket.WriteMapleString("Creating...");
pPacket.WriteInt(0); // Waru.
pPacket.WriteInt(0); // Level
pPacket.WriteInt(0); // EXP
pPacket.WriteInt(0); // AestheticPoints
pPacket.WriteInt(0); // Gems
pPacket.WriteInt(0); // ?
pPacket.WriteZero(5);
pPacket.WriteInt(0);
pPacket.WriteZero(13);
pPacket.WriteLong(Tools.GetTime(-2));
pPacket.WriteInt(0);
pPacket.WriteInt(322037760);
pPacket.WriteZero(68);
pPacket.WriteLong(Tools.GetTime(Tools.CurrentTimeMillis()));
pPacket.WriteInt(0);
pPacket.WriteByte(1);
pPacket.WriteShort(0);
pPacket.WriteInt(41870555);
pPacket.WriteInt(6550069);
pPacket.WriteLong(4);
for (int i = 0; i < 4; i++)
pPacket.WriteLong(9410165 + i);
}
示例8: AddEquipInfo
public static void AddEquipInfo(Packet p, Equip equip, Character c)
{
p.WriteByte(1); // Item type. 2 - An item, 3 - A pet. TODO: Pets.
p.WriteInt(equip.ItemID);
p.WriteByte(0); // todo: unique id.
AddExpirationTime(p, equip.Expiration);
p.WriteByte(0); // TODO: Extended slots.
p.WriteInt(0); // All values of all stats.
p.WriteByte(equip.Slots);
p.WriteByte(equip.Level);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteShort(equip.Str);
p.WriteByte(0); // Inc skills?
p.WriteByte(equip.ItemLevel);
p.WriteInt(equip.ItemEXP * 100000);
p.WriteInt(0); // Durability.
p.WriteInt(equip.ViciousHammer);
p.WriteShort(0); // PVP Damage.
p.WriteInt(4);
p.WriteByte(0xFF);
p.WriteMapleString(""); // Owner.
p.WriteByte(0); // State.
p.WriteByte(0); // Enhance.
p.WriteShort(0); // ptl1
p.WriteShort(0); // ptl2
p.WriteShort(0); // ptl3
p.WriteShort(0); // bonus ptl 1
p.WriteShort(0); // bonus ptl2
p.WriteShort(0);
p.WriteShort(0);
p.WriteShort(0); // socket state
p.WriteShort(0); // socket1
p.WriteShort(0); // socket 2
p.WriteShort(0); // socket 3
//if (equip.CashId > 0)
//p.writelong
p.WriteLong(Tools.GetTime(-2));
p.WriteInt(-1);
}