void client_UseCardCompleted(object sender, RookieCard.UseCardCompletedEventArgs e) { PacketStream packet = new PacketStream(); RookieCardContext context = (RookieCardContext)e.UserState; packet.WriteUInt32(0); packet.WriteUInt32(Packet.WIS_2_GS_USE_ROOKIE_CARD_RESULT); packet.WriteUInt32(context.playerId); packet.WriteByte((byte)e.Result); packet.WriteUInt32(e.itemTemplate); packet.WriteString(context.charName); uint len = packet.GetLength(); packet.Seek(0); packet.WriteUInt32(len); FSession.SendPacket(packet); }
void SendPacket(PacketStream packet) { SendData(packet.GetBytes(), (int)packet.GetLength()); }