本文整理汇总了C#中Framework.PacketWriter.Text方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.Text方法的具体用法?C# PacketWriter.Text怎么用?C# PacketWriter.Text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework.PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.Text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FriendData
public static byte[] FriendData(int target, byte type, string name, character c, bool state)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_FRIEND_DATA);
switch (type)
{
case 2:
//Friend invite accepted
Writer.Byte(2);
Writer.DWord(target); //Id
Writer.Text(c.Information.Name); //Name
Writer.DWord(c.Information.Model); //Model
break;
case 3:
//Remove friend from own list
Writer.Byte(3);
Writer.DWord(target);
break;
case 4:
//Fried online / offline update
Writer.Byte(4);
Writer.DWord(target);
Writer.Byte(state);
break;
case 5:
//Send private message..
Writer.Byte(8);
Writer.Text(name);
Writer.DWord(0);
Writer.DWord(0);//time info
break;
}
return Writer.GetBytes();
}
示例2: GuildSetTitle
public static byte[] GuildSetTitle(int charid, string charname, string title)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_SET_TITLE);
Writer.DWord(charid);
Writer.Text(charname);
Writer.Text(title);
return Writer.GetBytes();
}
示例3: FriendGroupManage
public static byte[] FriendGroupManage(string type,string groupname, short groupid, int targetid)
{
PacketWriter Writer = new PacketWriter();
switch (type)
{
case "ADD":
Writer.Create(Systems.SERVER_FRIEND_GROUP);
Writer.Byte(1);
Writer.Text(groupname);
Writer.Word(groupid);
break;
case "REMOVE":
Writer.Create(Systems.SERVER_FRIEND_GROUP_REMOVE);
Writer.Byte(1);
Writer.Word(groupid);
break;
case "MOVE":
Writer.Create(Systems.SERVER_FRIEND_GROUP_MANAGE_FRIEND);
Writer.Byte(1);
Writer.DWord(targetid);
Writer.Word(groupid);
break;
}
return Writer.GetBytes();
}
示例4: PetSpawn
///////////////////////////////////////////////////////////////////////////
// Despawn Pet
///////////////////////////////////////////////////////////////////////////
public static byte[] PetSpawn(int petid, byte type, pet_obj o)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_PLAYER_SPAWN_PET); //Select Opcode
Writer.DWord(petid); //Pet ID
switch (type)
{
case 1:
//Despawn pet
Writer.Byte(1);
break;
case 2:
//Rename pet respawn
Writer.Byte(5);
Writer.Text(o.Petname);
break;
case 3:
//Attack pet respawn for exp info
Writer.Byte(3);//Static
Writer.LWord(o.exp);//New exp
Writer.DWord(o.OwnerID);//Owner id
break;
}
return Writer.GetBytes();
}
示例5: AgentServer
public static byte[] AgentServer()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_AGENTSERVER);
Writer.Text("AgentServer");
Writer.Bool(true);
return Writer.GetBytes();
}
示例6: MakeAliasError
public static byte[] MakeAliasError(string name, byte switchinfo)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_MAKE_ALIAS);
Writer.Byte(2);
Writer.Word(0);
Writer.Byte(0);
Writer.Text(name);
return Writer.GetBytes();
}
示例7: HonorRank
public static byte[] HonorRank(character c)
{
Systems.MsSQL ms = new Systems.MsSQL("SELECT * FROM rank_honor");
PacketWriter Writer = new PacketWriter();
int countinfo = ms.Count();
Writer.Create(Systems.SERVER_HONOR_RANK);
Writer.Byte(1);
int i = 0;
Writer.Byte(Convert.ToByte(countinfo));
using (SqlDataReader reader = ms.Read())
{
while (reader.Read())
{
byte rankicon = reader.GetByte(1);
string rankname = reader.GetString(2);
byte ranklevel = reader.GetByte(3);
byte ranklevelc = reader.GetByte(4);
int graduatesc = reader.GetInt32(5);
int rankposc = reader.GetInt32(6);
Writer.DWord(i + 1);
Writer.Byte(rankicon);
Writer.Text(rankname);
Writer.Byte(ranklevel);
Writer.Byte(ranklevelc);
Writer.DWord(graduatesc);
//If player has no guild, we write a 0 word value
if (c.Network.Guild.Name == null)
{
Writer.Word(0);
}
//If player has a guild we write the guild name.
else
{
Writer.Text(c.Network.Guild.Name);
}
i++;
}
ms.Close();
}
return Writer.GetBytes();
}
示例8: FriendDecline
public static byte[] FriendDecline(string name)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_FRIEND_INVITE);
Writer.Byte(2);
Writer.Word(0x640B);
Writer.Byte(0);
Writer.Word(0x000B);
Writer.Text(name);
return Writer.GetBytes();
}
示例9: MakeAlias
public static byte[] MakeAlias(string name, byte switchinfo)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_MAKE_ALIAS);
Writer.Byte(1);
switch (switchinfo)
{
case 0:
Writer.Byte(0);
Writer.Text(name);
break;
case 1:
Writer.Byte(1);
Writer.Text(name);
break;
default:
Console.WriteLine("Alias Case: " + switchinfo);
break;
}
return Writer.GetBytes();
}
示例10: JoinFormedRequest
public static byte[] JoinFormedRequest(character requesting, character owner)
{
//Create new packet writer
PacketWriter Writer = new PacketWriter();
//Add opcode for packet
Writer.Create(Systems.SERVER_PARTY_JOIN_FORMED);
//Character model information (Req).
Writer.DWord(requesting.Information.Model);
//Leader id
Writer.DWord(requesting.Information.UniqueID);
//Party id
Writer.DWord(owner.Network.Party.ptid);
//Static
Writer.DWord(0);
Writer.DWord(0);
Writer.Byte(0);
Writer.Byte(0xFF);
//Write character unique id
Writer.DWord(requesting.Information.UniqueID);
//Write character name
Writer.Text(requesting.Information.Name);
//Write model information
Writer.DWord(requesting.Information.Model);
//Write level information
Writer.Byte(requesting.Information.Level);
//Static
Writer.Byte(0xAA);
//X and Y Sector
Writer.Byte(requesting.Position.xSec);
Writer.Byte(requesting.Position.ySec);
//Static
Writer.Word(0);
Writer.Word(0);
Writer.Word(0);
Writer.Word(1);
Writer.Word(1);
//If character is in a guild
if (requesting.Network.Guild != null)
//Write guild name
Writer.Text(requesting.Network.Guild.Name);
//If character is not in a guild
else
//Write word value 0
Writer.Word(0);
//Static
Writer.Byte(0);
Writer.DWord(0);
Writer.DWord(0);
//Return all bytes to send
return Writer.GetBytes();
}
示例11: GuildSetOnline
public static byte[] GuildSetOnline(guild c, int memberid)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_ONLINE);
Writer.DWord(memberid);
Writer.DWord(c.Guildid);
Writer.Text(c.Name);
Writer.Word(0);
Writer.DWord(0);
Writer.DWord(0);
Writer.DWord(0);
Writer.Byte(0);
Writer.Byte(1);
return Writer.GetBytes();
}
示例12: ListPartyMatching
void ListPartyMatching(List<party> pt)
{
//Create new packet writer
PacketWriter Writer = new PacketWriter();
//Add opcode
Writer.Create(Systems.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 (party currpt in pt)
{
//Get player information using leaderid
Systems s = Systems.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(1);
//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());
}
示例13: Unique_Data
public static byte[] Unique_Data(byte type, int mobid, string name)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_UNIQUE_ANNOUNCE);
Writer.Byte(type);
switch (type)
{
case 5:
Writer.Byte(0x0C);
Writer.DWord(mobid);
break;
case 6:
Writer.Byte(0x0C);
Writer.DWord(mobid);
Writer.Text(name);
break;
}
return Writer.GetBytes();
}
示例14: AttackPetStats
public static byte[] AttackPetStats(pet_obj c,byte slot)
{
PacketWriter writer = new PacketWriter();
writer.Create(Systems.SERVER_PET_INFORMATION);
writer.DWord(c.UniqueID);
writer.DWord(c.Model);
writer.DWord(0x00000168);//stats
writer.DWord(0x00000168);//stats
writer.LWord(c.exp);//Experience
writer.Byte(c.Level);//Level
writer.Word(0);//Angle
writer.DWord(0x00000001);//1 = Attack icon enabled, 2 = disabled
if (c.Petname != "No name") writer.Text(c.Petname);//Petname
else
writer.Word(0);//No name
writer.Byte(0);//Static perhaps
writer.DWord(c.OwnerID);//Owner
writer.Byte(slot);
return writer.GetBytes();
}
示例15: ChatPacket
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Chat Packet
////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static byte[] ChatPacket(byte type, int id, string text, string name)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.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();
}