本文整理汇总了C#中Packet.WriteUshort方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteUshort方法的具体用法?C# Packet.WriteUshort怎么用?C# Packet.WriteUshort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.WriteUshort方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteByte(this._id_u8);
packet.WriteBuffer(this._role_base.GetBuffer());
ushort id_f32_count = (ushort)this._id_f32.Count;
packet.WriteUshort(id_f32_count);
for (ushort i = 0; i < id_f32_count; i++)
{
float xxx = this._id_f32[i];
packet.WriteFloat(xxx);
}
packet.WriteByte(id_op_u8_flag);
if (this.id_op_u8_flag == 1)
{
packet.WriteByte(this._id_op_u8);
}
packet.WriteByte(op_role_base_flag);
if (this.op_role_base_flag == 1)
{
packet.WriteBuffer(this._op_role_base.GetBuffer());
}
packet.Encode(Msg.P_REQ_TEST_SEND);
return packet;
}
示例2: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteByte(this._id_u8);
packet.WriteUshort(this._id_u16);
packet.WriteUint(this._id_u32);
ushort repeat_id_u8_count = (ushort)this._repeat_id_u8.Count;
packet.WriteUshort(repeat_id_u8_count);
for (ushort i = 0; i < repeat_id_u8_count; i++)
{
byte xxx = this._repeat_id_u8[i];
packet.WriteByte(xxx);
}
packet.WriteByte(optional_id_u8_flag);
if (this.optional_id_u8_flag == 1)
{
packet.WriteByte(this._optional_id_u8);
}
packet.Encode(Msg.P_REQ_TEST_X_X);
return packet;
}
示例3: Encode
public Packet Encode()
{
Packet packet = new Packet();
ushort players_count = (ushort)this._players.Count;
packet.WriteUshort(players_count);
for (ushort i = 0; i < players_count; i++)
{
MsgScenePlayer xxx = this._players[i];
packet.WriteBuffer(xxx.GetBuffer());
}
packet.Encode(Msg.P_ACK_SCENE_PLAYERS);
return packet;
}
示例4: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteByte(this._id_u8);
ushort id_f32_count = (ushort)this._id_f32.Count;
packet.WriteUshort(id_f32_count);
for (ushort i = 0; i < id_f32_count; i++)
{
float xxx = this._id_f32[i];
packet.WriteFloat(xxx);
}
packet.WriteByte(id_op_u8_flag);
if (this.id_op_u8_flag == 1)
{
packet.WriteByte(this._id_op_u8);
}
return packet;
}
示例5: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteUlong(this._u64);
packet.WriteString(this._strxx);
packet.WriteBuffer(this._msg_req.GetBuffer());
packet.WriteByte(msg_opt_flag);
if (this.msg_opt_flag == 1)
{
packet.WriteBuffer(this._msg_opt.GetBuffer());
}
ushort msg_rep_count = (ushort)this._msg_rep.Count;
packet.WriteUshort(msg_rep_count);
for (ushort i = 0; i < msg_rep_count; i++)
{
MsgTestPhp xxx = this._msg_rep[i];
packet.WriteBuffer(xxx.GetBuffer());
}
packet.Encode(Msg.P_ACK_TEST_PHP_OK);
return packet;
}
示例6: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteUint(this._uid);
packet.WriteUint(this._uuid);
packet.WriteUshort(this._sid);
packet.WriteUshort(this._cid);
packet.WriteString(this._os);
packet.WriteString(this._version);
packet.WriteString(this._uname);
packet.WriteString(this._source);
packet.WriteString(this._source_sub);
packet.WriteUint(this._login_time);
packet.Encode(Msg.P_REQ_ROLE_CREATE);
return packet;
}
示例7: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteUint(this._uid);
packet.WriteUint(this._uuid);
packet.WriteUshort(this._sid);
packet.WriteUshort(this._cid);
packet.WriteUint(this._login_time);
packet.WriteString(this._pwd);
packet.WriteByte(this._relink);
packet.WriteByte(this._debug);
packet.WriteString(this._os);
packet.WriteString(this._version);
packet.Encode(Msg.P_REQ_ROLE_LOGIN);
return packet;
}
示例8: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteUshort(this._u16);
return packet;
}