本文整理汇总了C#中Framework.PacketWriter类的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter类的具体用法?C# PacketWriter怎么用?C# PacketWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PacketWriter类属于Framework命名空间,在下文中一共展示了PacketWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GuildLeave
public static byte[] GuildLeave()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_LEAVE);
Writer.Byte(1);
return Writer.GetBytes();
}
示例2: DisbandGuildMsgEnd
public static byte[] DisbandGuildMsgEnd()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_DISBAND_MSG);
Writer.Byte(1);
return Writer.GetBytes();
}
示例3: GuildKick
public static byte[] GuildKick(int memberid)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_DISBAND);
Writer.DWord(memberid);
return Writer.GetBytes();
}
示例4: GuildKickMsg
public static byte[] GuildKickMsg()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_KICK);
Writer.Byte(1);
return Writer.GetBytes();
}
示例5: FORTRESSNOTE
public static byte[] FORTRESSNOTE()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_FORTRESS_NOTIFY);
Writer.Byte(0);
Writer.Byte(0);
return Writer.GetBytes();
}
示例6: GuildDonateGP
public static byte[] GuildDonateGP(int donatedgp)
{
PacketWriter writer = new PacketWriter();
writer.Create(Systems.SERVER_GUILD_DONATE_GP);
writer.Byte(1);
writer.DWord(donatedgp);
return writer.GetBytes();
}
示例7: GuildCreateLow
public static byte[] GuildCreateLow()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD);
Writer.Byte(2);
Writer.Byte(0xA);
Writer.Byte(0x4C);
return Writer.GetBytes();
}
示例8: PrivateItemPacket
public static void PrivateItemPacket(PacketWriter Writer, int id, byte max, byte avatar, bool mspawn)
{
try
{
List<byte> slots = new List<byte>();
Systems.MsSQL ms = new Systems.MsSQL("SELECT * FROM char_items WHERE owner='" + id + "' AND slot >= '0' AND slot <= '" + max + "' AND inavatar='" + avatar + "' AND storagetype='0' AND quantity='1'");
using (SqlDataReader reader = ms.Read())
{
int count = ms.Count();
Writer.Byte(count);
while (reader.Read())
{
byte slot = reader.GetByte(5);
byte plusvalue = reader.GetByte(4);
int itemid = reader.GetInt32(2);
if (itemid != 0)
{
if (!slots.Exists(delegate(byte bk)
{
return bk == slot;
}))
{
slots.Add(slot);
}
Writer.DWord(itemid);
Writer.Byte(plusvalue);
}
}
}
ms.Close();
}
catch (Exception ex)
{
Console.WriteLine("Item Error : {0}", ex);
Systems.Debugger.Write(ex);
}
}
示例9: 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();
}
示例10: SendGuildStart
public static byte[] SendGuildStart()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(0x34B3);
return Writer.GetBytes();
}
示例11: UnionInfo
public static byte[] UnionInfo(Systems c)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_UNIONS);
Writer.DWord(c.Character.Information.CharacterID); // Union owner id
Writer.DWord(7); // ??Need to check
Writer.DWord(c.Character.Network.Guild.Guildid); // Union leader guild id
Writer.Byte(c.Character.Network.Guild.Unions.Count); // Count guilds in union
//Get all guilds details
foreach (int guild in c.Character.Network.Guild.Unions)
{
//Load other guild data
Systems.MsSQL guild_data = new Systems.MsSQL("SELECT * FROM guild WHERE id='"+ guild +"'");
using (System.Data.SqlClient.SqlDataReader reader = guild_data.Read())
{
while (reader.Read())
{
string Guildname = reader.GetString(1);
byte Guildlevel = reader.GetByte(2);
byte Guildmembercount = reader.GetByte(6);
int Ownerid = reader.GetInt32(9);
string Charname = Systems.MsSQL.GetData("SELECT name FROM character WHERE id='" + Ownerid + "'", "name").ToString();
int Charmodel = Convert.ToInt32(Systems.MsSQL.GetData("SELECT chartype FROM character WHERE id='" + Ownerid + "'", "chartype"));
Writer.DWord(guild); //Guild ID
Writer.Text(reader.GetString(1)); //Guildname
Writer.Byte(reader.GetByte(2)); //Guildlevel
Writer.Text(Charname); //Ownername
Writer.DWord(Charmodel); //Owner model
Writer.Byte(reader.GetByte(6)); //Guild member count
//Get guild details
Systems Guildmembers = Systems.GetGuildPlayer(guild);
//Add clients that are online to union list
//Null check
if (Guildmembers != null)
{
foreach (int member in Guildmembers.Character.Network.Guild.Members)
{
//make sure member isnt 0
if (member != 0)
{
//Get player details
Systems getmember = Systems.GetPlayerMainid(member);
//Make sure that the player is there
if (getmember != null)
{
//Add client to union list
c.Character.Network.Guild.UnionMembers.Add(getmember.Character.Information.CharacterID);
//Add to member
if (c.Character.Information.CharacterID != getmember.Character.Information.CharacterID)
{
getmember.Character.Network.Guild.UnionMembers.Add(c.Character.Information.CharacterID);
}
}
}
}
}
}
}
}
return Writer.GetBytes();
}
示例12: SendGuildInfo
public static byte[] SendGuildInfo(guild guildGlobal)
{
PacketWriter Writer = new PacketWriter();
/////////////////////////////////////////////////////////////////////////
//Opcode information
/////////////////////////////////////////////////////////////////////////
Writer.Create(Systems.SERVER_GUILD_INFO_LOAD);
/////////////////////////////////////////////////////////////////////////
//Packet Structure
/////////////////////////////////////////////////////////////////////////
//Writer.Byte(1); // Guild update
Writer.DWord(guildGlobal.Guildid); // Unique Guild ID
Writer.Text(guildGlobal.Name); // Guild Name
Writer.Byte(guildGlobal.Level); // Guild level
Writer.DWord(guildGlobal.PointsTotal); // Guild GP
Writer.Word(guildGlobal.NewsTitle.Length); // Guild Message Title Lenght
Writer.String(guildGlobal.NewsTitle); // Guild Message Title
Writer.Word(guildGlobal.NewsMessage.Length); // Guild Message Lenght
Writer.String(guildGlobal.NewsMessage); // Guild Message
Writer.DWord(0); // War on guild id
Writer.Byte(0); // War status?
/////////////////////////////////////////////////////////////////////////
// Write Guild Member information for each excisting member.
/////////////////////////////////////////////////////////////////////////
Guild_ListPlayersInfo(guildGlobal.MembersInfo, Writer);
Writer.Byte(0);
return Writer.GetBytes();
}
示例13: SendGuildInfo2
public static byte[] SendGuildInfo2(character c)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_ONLINE);
Writer.DWord(c.Information.UniqueID); // Guildmaster ID
Writer.DWord(c.Network.Guild.Guildid); // Guild ID
Writer.Text(c.Network.Guild.Name);
if (c.Network.Guild.GrantName != "")
Writer.Text(c.Network.Guild.GrantName); // Guildmaster grand name len
else
Writer.Word(0);
Writer.DWord(0); // ?
Writer.DWord(0); // ?
Writer.DWord(0); // ? Amount of guilds in union ?
Writer.Byte(1); // ?
Writer.Byte(1);
return Writer.GetBytes();
}
示例14: GuildTransferMessage
public static byte[] GuildTransferMessage()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Systems.SERVER_GUILD_TRANSFER_MSG);
Writer.Byte(1);
return Writer.GetBytes();
}
示例15: SendGuildEnd
public static byte[] SendGuildEnd()
{
/////////////////////////////////////////////////////////////////////////
// Guild end
/////////////////////////////////////////////////////////////////////////
PacketWriter Writer = new PacketWriter();
Writer.Create(0x34B4);
return Writer.GetBytes();
}