本文整理汇总了C#中CLFramework.PacketWriter.Text3方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.Text3方法的具体用法?C# PacketWriter.Text3怎么用?C# PacketWriter.Text3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLFramework.PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.Text3方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFormedParty
public static byte[] CreateFormedParty(WorldMgr.party pt)
{
//Create new packet writer
PacketWriter Writer = new PacketWriter();
//Add opcode to packet
Writer.Create(OperationCode.SERVER_FORMED_PARTY_CREATED);
//Static byte
Writer.Byte(1);
//Party id
Writer.DWord(pt.ptid);
//0 Dword value
Writer.DWord(0);
//Party type
Writer.Byte(pt.Type);
//Party purpose
Writer.Byte(pt.ptpurpose);
//Party min level required
Writer.Byte(pt.minlevel);
//Party max level allowed
Writer.Byte(pt.maxlevel);
//Party name
Writer.Text3(pt.partyname);
//Return all bytes to send
return Writer.GetBytes();
}
示例2: ChatPacket
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Chat Packet
////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static byte[] ChatPacket(byte type, int id, string text, string name)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_CHAT);
Writer.Byte(type);
switch (type)
{
case 1:
Writer.DWord(id);
Writer.Text3(text);
break;
case 3:
Writer.DWord(id);
Writer.Text3(text);
break;
case 2:
Writer.Text(name);
Writer.Text3(text);
break;
case 4:
Writer.Text(name);
Writer.Text3(text);
break;
case 5:
Writer.Text(name);
Writer.Text3(text);
break;
case 6:
Writer.Text(name);
Writer.Text3(text);
break;
case 7:
Writer.Text3(text);
break;
case 9:
Writer.Text(name);
Writer.Text3(text);
break;
case 11:
Writer.Text(name);
Writer.Text3(text);
break;
}
return Writer.GetBytes();
}
示例3: RenameParty
public void RenameParty()
{
try
{
//Create new packet reader
PacketReader reader = new PacketReader(PacketInformation.buffer);
//First integer is party id
int partyid = reader.Int32();
//Second integer is not needed
int NotNeeded = reader.Int32();
//Byte party type
byte ptype = reader.Byte();
//Byte party purpose
byte purpose = reader.Byte();
//Byte minimum level
byte minlevel = reader.Byte();
//Byte max level to enter party
byte maxlevel = reader.Byte();
//Party name lenght
short namel = reader.Int16();
//Party name each character is a word value using text3
string pname = reader.Text3();
//Create new packet writer
PacketWriter Writer = new PacketWriter();
//Add opcode to server packet
Writer.Create(OperationCode.SERVER_PARTY_CHANGENAME);
//Write static byte 1
Writer.Byte(1);
//Write party id
Writer.DWord(partyid);
//Write dword 0
Writer.DWord(0);
//Write party type
Writer.Byte(ptype);
//Write party purpose
Writer.Byte(purpose);
//Write party minimum level
Writer.Byte(minlevel);
//Write party max level
Writer.Byte(maxlevel);
//Write party name
Writer.Text3(pname);
//Send bytes to client
client.Send(Writer.GetBytes());
}
//If a error happens
catch (Exception ex)
{
//Write the exception to the log
}
}
示例4: ListPartyMatching
public void ListPartyMatching(List<WorldMgr.party> pt)
{
//Create new packet writer
PacketWriter Writer = new PacketWriter();
//Add opcode
Writer.Create(OperationCode.SERVER_SEND_PARTYLIST);
//Write static bytes
Writer.Byte(1);
Writer.Byte(4);
Writer.Byte(0);
//Write total count of partys
Writer.Byte(pt.Count);
//If party count higher is then zero
if (pt.Count > 0)
{
//Repeat for each party in list of party's
foreach (WorldMgr.party currpt in pt)
{
//Get player information using leaderid
PlayerMgr s = Helpers.GetInformation.GetPlayer(currpt.LeaderID);
//Write party id
Writer.DWord(currpt.ptid);
//Write leader id
Writer.DWord(currpt.LeaderID);
//Write charactername
Writer.Text(s.Character.Information.Name);
//Write static byte 1
Writer.Byte(currpt.Race);
//Write current party players count
Writer.Byte(currpt.Members.Count);
//Write party type
Writer.Byte(currpt.Type);
//Write party purpose
Writer.Byte(currpt.ptpurpose);
//Write min level required
Writer.Byte(currpt.minlevel);
//Write max level to join the party
Writer.Byte(currpt.maxlevel);
//Write party name
Writer.Text3(currpt.partyname);
}
}
//Send bytes to the client
client.Send(Writer.GetBytes());
}
示例5: EnterStall
public static byte[] EnterStall(int CharacterID, WorldMgr.stall stall)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_STALL_OTHER_OPEN);
Writer.Byte(1);
Writer.DWord(stall.ownerID);
Writer.Text3(stall.WelcomeMsg);
Writer.Bool(stall.isOpened);
Writer.Byte(0);
StallItemPacket(stall.ItemList, Writer);
Writer.Byte(stall.Members.Count - 2);
for (byte i = 0; i < stall.Members.Count; i++)
{
if (stall.Members[i] != stall.ownerID && stall.Members[i] != CharacterID)
Writer.DWord(stall.Members[i]);
}
return Writer.GetBytes();
}
示例6: StallWelcome
public static byte[] StallWelcome(string welcome)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_STALL_ACTION);
Writer.Byte(1);
Writer.Byte(6);
Writer.Text3(welcome);
return Writer.GetBytes();
}
示例7: StallOpenGlobal
public static byte[] StallOpenGlobal(string stallname, int CharacterID, int StallModel)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_STALL_OPEN);
Writer.DWord(CharacterID);
Writer.Text3(stallname);
Writer.DWord(StallModel); //Decoration
return Writer.GetBytes();
}
示例8: StallNameGlobal
public static byte[] StallNameGlobal(int characterid, string stallname)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_STALL_RENAME);
Writer.DWord(characterid);
Writer.Text3(stallname);
return Writer.GetBytes();
}
示例9: ObjectSpawn
//.........这里部分代码省略.........
}
Writer.Byte((byte)(c.State.LastState == 128 ? 2 : 1));
Writer.Byte(0);
//Info : If a player spawns at your location and is walking it send byte 3, else 0 byte.
if (c.Transport.Right)
Writer.Byte(c.Transport.Horse.Walking == true ? 3 : 0);
else
Writer.Byte(c.Position.Walking == true ? 3 : 0);
Writer.Byte((byte)(c.Information.Berserking ? 1 : 0));
Writer.Byte(0);
Writer.Float(c.Speed.WalkSpeed);
Writer.Float(c.Speed.RunSpeed);
Writer.Float(c.Speed.BerserkSpeed);
Writer.Byte(c.Action.Buff.count);
for (byte b = 0; b < c.Action.Buff.SkillID.Length; b++)
{
if (c.Action.Buff.SkillID[b] != 0)
{
Writer.DWord(c.Action.Buff.SkillID[b]);
Writer.DWord(c.Action.Buff.OverID[b]);
}
}
#endregion
/////////////////////////////////////////////////////// Character Job information / name
#region Job information & name
Writer.Text(c.Information.Name);
Writer.Byte(0);
if (c.Transport.Right)
{
Writer.Byte(1);
Writer.Byte(0);
Writer.DWord(c.Transport.Horse.UniqueID);
}
else
{
Writer.Byte(0);
Writer.Byte(0);
}
Writer.Byte(0);
if (c.Network.Stall != null && c.Network.Stall.ownerID == c.Information.UniqueID)
Writer.Byte(0x04);
else
Writer.Byte(0);
//Writer.Byte(0);
if (c.Network.Guild.Guildid > 0)
{
Writer.Text(c.Network.Guild.Name);
if (c.Network.Guild.GrantName != "")
{
Writer.DWord(0);//Icon ?
Writer.Text(c.Network.Guild.GrantName);
}
else
{
Writer.DWord(0);//Icon
Writer.Word(0);//No grantname
}
}
else
{
Writer.Word(0);//No guild
Writer.DWord(0);//No icon
Writer.Word(0);//No grantname
}
Writer.DWord(0);// emblem (guild)
Writer.DWord(0); // unique id (union)
Writer.DWord(0); //emblem (union)
Writer.Byte(0); // flag (guild_war)
Writer.Byte(0); // flag (fortress_rank)
if (c.Network.Stall != null && c.Network.Stall.ownerID == c.Information.UniqueID)
{
Writer.Text3(c.Network.Stall.StallName);
Writer.DWord(c.Information.StallModel);
}
Writer.Byte(0);
#endregion
/////////////////////////////////////////////////////// Pvp state
#region pvpstate
if (c.Information.Pvpstate > 0 || c.Information.Murderer)
{
Writer.Byte(0x22);
}
else
{
Writer.Byte(0xFF);
}
#endregion
Writer.Byte(4);
return Writer.GetBytes();
}