michael1414 wrote:About the scripts, could be added some scripts about using packets from opcode > 255. Would be very nice.
This would be much easier if the javadoc was accessible; however, I am busy with ACM ICPC & related contests/training and have been unable to prepare a guide about script writing.
Let's just sum up that there are two primary script types you will want to use:
A) Low-level packet handling, manually selecting blocking or asynchronous handling. (subclasses of net.l2emuproject.proxy.script.Script)
Blocking implies packet modification (either within the buffer, or dropping the packet, or allocating a buffer of a different size and writing own data). Therefore, since you must know everything (possible opcodes and structures in all client versions your script is being created for), you can only register the 1st opcodes you are interested in. Hardly convenient, but you know how it is: every once in a while, some opcodes get shifted or shuffled around. So if you register all possible variants; you will still have to filter them by version, etc.
B) High-level asynchronous* packet handling, making use of Packet Payload [Field] Enumeration (PPE). You do not specify any opcodes to handle packets. You define script aliases for fields already in packet definitions and when you get a packet event in your script, you can obtain a typed pointer list for each aliased field. Of course, if the definition doesn't specify that field within a loop, then this list will only contain one pointer (to the field). There are functions to read any type of integer value (since we have many D/Q or D/H/C or H/C or C/H field type changes between protocol versions) for your convenience.
* this merely means that scripts receive packet events outside the I/O thread(s); they still handle events one at a time and in the same order packets were sent/received.
That's a short overview of how scripts work. Of course, without a guide (and javadoc), this doesn't help much. I'll try to get to it.
michael1414 wrote:Firstly, how dumping packets for opening in future ? In scripts ? Or is there option in cmd or export in UI ?.
In earlier versions, there was a menu option which would enable/disable automatic packet logging when connections are initiated. Currently, all connections are logged to disk. Packet logs can be found in [user.home]/l2emu-unique-netpro/
michael1414 wrote:Second: Could be added PAUSE/RESUME for dumping packets (sometimes I want dump packets only for checking one thing and I not need tons of packets).
That's a good idea.
michael1414 wrote:Next things that could be usefull is filtering packets by Opcode or name (usefull for checking for example packet with opcode 31 is changing)
Filtering by opcode is currently possible via [menu bar] Packets -> Configure -> Select the protocol version of an active connection. You may check/uncheck packets to include/exclude them from view in the packet table.
I have been thinking about implementing filtering in a more convenient way, similarly to how you have suggested. I'll look into it.