本文整理汇总了C#中CLFramework.PacketWriter类的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter类的具体用法?C# PacketWriter怎么用?C# PacketWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PacketWriter类属于CLFramework命名空间,在下文中一共展示了PacketWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdatePlace
public static byte[] UpdatePlace()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_SAVE_PLACE);
Writer.Byte(1);
return Writer.GetBytes();
}
示例2: Exchange_Accept
public static byte[] Exchange_Accept()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_EXCHANGE_ACCEPT);
Writer.Byte(1);
return Writer.GetBytes();
}
示例3: ConnectWrong
public static byte[] ConnectWrong(ushort type)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Opcodes.SERVER.SERVER_GATEWAY_LOGIN_RESPONSE);
Writer.Word(type);
return Writer.GetBytes();
}
示例4: ClientCheck2
public static void ClientCheck2(Definitions.Clientdefinition sys)
{
PacketWriter Writer = new PacketWriter();
Writer.Create (0x2005);
Writer.Byte(1);
Writer.Byte(0);
Writer.Byte(1);
Writer.Byte(0x47);
Writer.Byte(1);
Writer.Byte(5);
Writer.Byte(0);
Writer.Byte(0);
Writer.Byte(0);
Writer.Byte(2);
sys.client.Send(Writer.GetBytes());
Writer = new PacketWriter();
Writer.Create(0x6005);
Writer.Byte(3);
Writer.Byte(0);
Writer.Byte(2);
Writer.Byte(0);
Writer.Byte(2);
sys.client.Send(Writer.GetBytes());
Writer = new PacketWriter();
Writer.Create(0xA100);
Writer.Byte(1);
Writer.Byte(0);
sys.client.Send(Writer.GetBytes());
}
示例5: ServerListPacket
public static byte[] ServerListPacket(int cliVersion)
{
//Create a new packet writer to create our packet
PacketWriter W = new PacketWriter();
//Write the opcode from server to client
W.Create(Opcodes.SERVER.SERVER_SERVERLIST);
//Structure of packet below
W.Word(0x0201);
W.Text("CLOWEN_DEV_PROJECT");
W.Byte(0);
//Repeat the following packet data below for each server in the list
foreach (KeyValuePair<int, Definitions.Serverdef.ServerDetails> Gameservers in Definitions.Serverdef.Serverlist)
{
if (cliVersion == Definitions.Serverdef.SilkroadClientVersion)
{
W.Bool(true);
W.Word(Gameservers.Value.id);
W.Text(Gameservers.Value.name);
W.Word(Gameservers.Value.usedSlots);
W.Word(Gameservers.Value.maxSlots);
W.Byte(Gameservers.Value.status);
}
}
//Static 0 byte
W.Byte(0);
//Send the created packet back to the request (client).
return W.GetBytes();
}
示例6: GuildLeave
public static byte[] GuildLeave()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_GUILD_LEAVE);
Writer.Byte(1);
return Writer.GetBytes();
}
示例7: ConnectSuccess
public static byte[] ConnectSuccess()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_CONNECTION);
Writer.Bool(true);
return Writer.GetBytes();
}
示例8: PrivateMessageCheck
public static byte[] PrivateMessageCheck(WorldMgr.character c)
{
DB ms = new DB("SELECT * FROM message WHERE receiver='" + c.Information.Name + "'");
PacketWriter Writer = new PacketWriter();
int count = ms.Count();
Writer.Create(OperationCode.SERVER_PM_MESSAGE);
Writer.Byte(1);//Static
Writer.Byte(Convert.ToByte(count));//Total count
using (System.Data.SqlClient.SqlDataReader reader = ms.Read())
{
while (reader.Read())
{
string pmfrom = reader.GetString(1);
string pmto = reader.GetString(2);
string pmmessage = reader.GetString(3);
byte pmstatus = reader.GetByte(4);
DateTime pmdate = Convert.ToDateTime(reader.GetDateTime(5));
Writer.Text(pmfrom); // Message From
Writer.DWord(0x8A070000); // date
Writer.DWord(0xC7058401); // date
Writer.Byte(pmstatus); // Status (0 = Unread) (1 = Read)
}
ms.Close();
}
return Writer.GetBytes();
}
示例9: AlchemyResponse
public static byte[] AlchemyResponse(bool isSuccess, ObjData.slotItem sItem, byte type, byte totalblue)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_ALCHEMY);
Writer.Byte(1);
Writer.Byte(2);
Writer.Bool(isSuccess);
Writer.Byte(sItem.Slot);
if (!isSuccess) { Writer.Byte(0); }
Writer.DWord(0);
Writer.DWord(sItem.ID);
Writer.Byte(sItem.PlusValue);
Writer.LWord(0);
Writer.DWord(sItem.Durability);
Writer.Byte(ObjData.Manager.ItemBlue[sItem.dbID].totalblue);
for (int i = 0; i <= ObjData.Manager.ItemBlue[sItem.dbID].totalblue - 1; i++)
{
Writer.DWord(ObjData.Manager.MagicOptions.Find(mg => (mg.Name == Convert.ToString(ObjData.Manager.ItemBlue[sItem.dbID].blue[i]))).ID);
Writer.DWord(ObjData.Manager.ItemBlue[sItem.dbID].blueamount[i]);
}
Writer.Word(1);
Writer.Word(2);
Writer.Word(3);
return Writer.GetBytes();
}
示例10: NewsPacket
public static byte[] NewsPacket()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(Opcodes.SERVER.SERVER_MAIN);
Writer.Byte(0);
Writer.Byte((byte)Definitions.Serverdef.News_List.Count);
foreach (Definitions.Serverdef.NewsList n in Definitions.Serverdef.News_List)
{
Writer.Text(n.Title);
Writer.Text(n.Article);
Writer.Word(n.Year);
Writer.Word(n.Month);
Writer.Word(n.Day);
Writer.Word(0); // Hour
Writer.Word(0); // Minute
Writer.Word(0); // Second
Writer.Word(0); // MiliSecond
}
Writer.Word(0);
return Writer.GetBytes();
}
示例11: ObjectDeSpawn
public static byte[] ObjectDeSpawn(int id)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_SOLO_DESPAWN);
Writer.DWord(id);
return Writer.GetBytes();
}
示例12: FriendData
public static byte[] FriendData(int target, byte type, string name, WorldMgr.character c, bool state)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.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();
}
示例13: FriendGroupManage
public static byte[] FriendGroupManage(string type,string groupname, short groupid, int targetid)
{
PacketWriter Writer = new PacketWriter();
switch (type)
{
case "ADD":
Writer.Create(OperationCode.SERVER_FRIEND_GROUP);
Writer.Byte(1);
Writer.Text(groupname);
Writer.Word(groupid);
break;
case "REMOVE":
Writer.Create(OperationCode.SERVER_FRIEND_GROUP_REMOVE);
Writer.Byte(1);
Writer.Word(groupid);
break;
case "MOVE":
Writer.Create(OperationCode.SERVER_FRIEND_GROUP_MANAGE_FRIEND);
Writer.Byte(1);
Writer.DWord(targetid);
Writer.Word(groupid);
break;
}
return Writer.GetBytes();
}
示例14: PetSpawn
///////////////////////////////////////////////////////////////////////////
// Despawn Pet
///////////////////////////////////////////////////////////////////////////
public static byte[] PetSpawn(int petid, byte type, CLGameServer.WorldMgr.pet_obj o)
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.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();
}
示例15: LeaveJob
public static byte[] LeaveJob()
{
PacketWriter Writer = new PacketWriter();
Writer.Create(OperationCode.SERVER_LEAVE_JOB);
Writer.Byte(1);
return Writer.GetBytes();
}