Ban charBlockSize from user configuration!

This section is created for developers and non-developers who think that he/she has a good (and realistic) idea that might contribute to the OpenKore community.

Moderator: Moderators

Message
Author
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Ban charBlockSize from user configuration!

#1 Post by Technology »

We all know the charBlockSize problem is a very common problem and a pain in the ass to both us and the users.
It was solved before by just guessing between a few numbers, because thats simply faster for us than to record the packet and look at its length.
But I don't like guessing and especially not when it can in fact be avoided.

There are 2 ways to do this:

- we can let kore dynamically find the block size from the known range of charBlockSizes
here's the proof of concept:

[The extension patch has been deactivated and can no longer be displayed.]

note: kRO recently started using:
'006B' => ['received_characters', 'v C3 C L3 a7 a*', [qw(len max_slots available_slots premium_slots unknown1 code time1 time2 unknown2 charList)]], # PACKETVER >= 20100413
note: we do need the correct position of charList in 006B with this approach...


- charBlockSize is bound to serverType, so there is no need to let the user specify it...
In fact, it uses a list of the same structure thats found in 006D,
so we can just look at that packet and use the appropriate block size/unpackstring.
If we were to implement dynamic struct unpacking, we could use the struct used in 006D for 006B. (this would ofcourse be the ideal solution)

note: some similar approach can already be implemented in kRO, due to its timeline-like properties.



So thats how to ban charBlockSize from user configuration.
The charBlockSize myth is Busted! ;)

Tho I can see use in the charBlockSize configuration option for servers other than kRO/eA,
since there is nobody to support those servers by src, maybe its better to let users support it by conf...
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Ban charBlockSize from user configuration!

#2 Post by kLabMouse »

Nice one.
But, in this implementation Private Server Dev's can add a few extra bytes to packet, so OpenKore will get confused.
I suggest to look for "Z24" block data (char name) and that will help us to deal with thus bad PServer dev's.

Edit:
I Also suggest, to use binary specific configuration.
Because every server has it's own uniq ServerType, and kRO ST's are used for PServers, we do not ever need this kind of thing anymore, because the data len is hardcoded into client itself, and we can make a few HEX patters to search and determinate the value to statically set in ST.

Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: Ban charBlockSize from user configuration!

#3 Post by Technology »

another example
kLabMouse wrote:But, in this implementation Private Server Dev's can add a few extra bytes to packet, so OpenKore will get confused.
... deal with thus bad PServer dev's.
Do these exist? :P Lets assume yes...
Lets say pserver dev exist that would and could pull this off, he might as well change other packets too.
Even if he changes a packet, its bypassed in no-time, they might as well implement encryption right away, its just as easy.
The current system is also prone to the same pserver dev that can add enough bytes (more than 108) to the server sent packet to provide us with fake characters while fixing this for the client.
kLabMouse wrote:I suggest to look for "Z24" block data (char name) and that will help us to deal with thus bad PServer dev's.
Given the pserver dev can change the packets, we might as well do this for all packets that contain the char name or any other data then.

To me it makes sense to handle stuff by rule and handle 'possible' exceptions differently.
Also, just think for a sec about which solution will give both us and the users the least problems in most cases.

For any official server and standard eA server, the packet structure of this particular packet can even be retrieved from its time-line of packet changes.
Its true, there are more than 1 ways to do this. (letting user specify charBlockSize, calculating charblocksize, using time-line)
Although, by using the binary time-line to deter the which packet structures to use is the ONLY way we can unify the way we unpack/pack all RO packets into 1 system.

binary time-line packet structure length example in eA/kRO:
  • 106 (from start)
    108 (from 20061023)
    110 (doesn't even exist in eA)
    112 (from 20081217)
kLabMouse wrote: Because every server has it's own uniq ServerType, and kRO ST's are used for PServers, we do not ever need this kind of thing anymore, because the data len is hardcoded into client itself, and we can make a few HEX patters to search and determinate the value to statically set in ST.
We could yea, but would how exceptional is it that a pserver dev will actually change this(or a) packet?
This would be very useful to track official server client changes for dynamic len packets tho.

charBlockSize is a confusing, and above all useless config option...
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Ban charBlockSize from user configuration!

#4 Post by kLabMouse »

Well. We can delete the option from Config and Server Entry.
But left it in ServerType files.

akosianel
Noob
Noob
Posts: 3
Joined: 15 Oct 2011, 03:55
Noob?: Yes

Re: Ban charBlockSize from user configuration!

#5 Post by akosianel »

how exactly do I do the 1st step? :|

akosianel
Noob
Noob
Posts: 3
Joined: 15 Oct 2011, 03:55
Noob?: Yes

Re: Ban charBlockSize from user configuration!

#6 Post by akosianel »

How exactly do I do the 1st step? (charblocksize.patch)

Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: Ban charBlockSize from user configuration!

#7 Post by Technology »

akosianel wrote:How exactly do I do the 1st step? (charblocksize.patch)
Its just a proof of concept and the patch is kinda old so I wouldn't suggest doing anything with it unless you know what you are doing.
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!

akosianel
Noob
Noob
Posts: 3
Joined: 15 Oct 2011, 03:55
Noob?: Yes

Re: Ban charBlockSize from user configuration!

#8 Post by akosianel »

so how exactly do I get the charblocksize? :| Already tried charblocksize #s 100-140, none works. xD

btw, sorry for double posting, my internet lagged a while ago.

starbucksz
Noob
Noob
Posts: 11
Joined: 10 Apr 2012, 03:17
Noob?: Yes

Re: Ban charBlockSize from user configuration!

#9 Post by starbucksz »

so what's use of that .patch file? where i will put that?

kimson3
Noob
Noob
Posts: 3
Joined: 07 Jul 2012, 12:45
Noob?: Yes

Re: Ban charBlockSize from user configuration!

#10 Post by kimson3 »

where will i put the charBlockSize that you have posted?

Post Reply