iRO 21.12.2012 server merge
Moderator: Moderators
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: iRO 21.12.2012 server merge
Useless, repetitive and otherwise unrelated posts were split to http://forums.openkore.com/viewtopic.php?t=18563.
-
- Noob
- Posts: 13
- Joined: 23 Dec 2012, 04:54
- Noob?: Yes
Re: iRO 21.12.2012 server merge
latest ServerType0.pm works for me, my inventory is back, but still can't auto open storage with "c r1 r0 n"
Works when I open storage manually but it gives
Packet Parser: Unknown switch: 0975
Packet Parser: Unknown switch: 0976
anyone can help?
Sorry for my bad english grammar.
Works when I open storage manually but it gives
Packet Parser: Unknown switch: 0975
Packet Parser: Unknown switch: 0976
anyone can help?
Sorry for my bad english grammar.
-
- Noob
- Posts: 11
- Joined: 21 Dec 2012, 05:07
- Noob?: No
Re: iRO 21.12.2012 server merge
Here's what I've got for cart. I'll do storage once I get back (need to go card shopping real quick...long live procrastination!)
You'll need to uncomment the packet from the packet_list at the top too to enable the cart parsing. Worked fine with the modified parsing Harvest just added. Wanted to clean it up (hope I did ok) since he did a good amount of rework on the inventory stuff (iteration).
(I think I pasted it all...)
Code: Select all
sub cart_items_nonstackable {
my ($self, $args) = @_;
my $newmsg;
$self->decrypt(\$newmsg, substr($args->{RAW_MSG}, 4));
my $msg = substr($args->{RAW_MSG}, 0, 4).$newmsg;
my @itemKeys = $self->parse_items_nonstackable($args, substr $msg, 4);
for my $item (@itemKeys) {
my ($local_item, $add);
$local_item = $cart{inventory}[$item->{index}] ||= Actor::Item->new;
for (keys %$item) {
$local_item->{$_} = $item->{$_};
}
$local_item->{name} = itemName($local_item);
$local_item->{amount} = 1;
debug "Non-Stackable Cart Item: $local_item->{name} ($local_item->{index}) x 1\n", "parseMsg";
Plugins::callHook('packet_cart', {index => $local_item->{index}});
}
$ai_v{'inventory_time'} = time + 1;
$ai_v{'cart_time'} = time + 1;
}
sub cart_items_stackable {
my ($self, $args) = @_;
my $newmsg;
$self->decrypt(\$newmsg, substr($args->{RAW_MSG}, 4));
my $msg = substr($args->{RAW_MSG}, 0, 4).$newmsg;
my @itemKeys = $self->parse_items_stackable($args, substr $msg, 4);
for my $item (@itemKeys) {
my ($local_item, $add);
$local_item = $cart{inventory}[$item->{index}] ||= Actor::Item->new;
if($local_item->{amount}) {
$local_item->{amount} += $item->{amount};
} else {
for (keys %$item) {
$local_item->{$_} = $item->{$_};
}
}
$local_item->{name} = itemName($local_item);
debug "Stackable Cart Item: $local_item->{name} ($local_item->{index}) x $local_item->{amount}\n", "parseMsg";
Plugins::callHook('packet_cart', {index => $local_item->{index}});
}
$ai_v{'inventory_time'} = time + 1;
$ai_v{'cart_time'} = time + 1;
}
Code: Select all
# Override this function if you need to.
sub items_nonstackable {
my ($self, $args) = @_;
my $items = $self->{nested}->{items_nonstackable};
if($args->{switch} eq '00A4' || # inventory
$args->{switch} eq '00A6' || # storage
$args->{switch} eq '0122' # cart
) {
return $items->{type1};
} elsif ($args->{switch} eq '0295' || # inventory
$args->{switch} eq '0296' || # storage
$args->{switch} eq '0297' # cart
) {
return $items->{type2};
} elsif ($args->{switch} eq '02D0' || # inventory
$args->{switch} eq '02D1' || # storage
$args->{switch} eq '02D2' # cart
) {
return $items->{$rpackets{'00AA'} == 7 ? 'type3' : 'type4'};
} elsif ($args->{switch} eq '0901' || # inventory
$args->{switch} eq '0903' # cart
) {
return $items->{type5};
} else {
warning "items_nonstackable: unsupported packet ($args->{switch})!\n";
}
}
Code: Select all
# Override this function if you need to.
sub items_stackable {
my ($self, $args) = @_;
my $items = $self->{nested}->{items_stackable};
if($args->{switch} eq '00A3' || # inventory
$args->{switch} eq '00A5' || # storage
$args->{switch} eq '0123' # cart
) {
return $items->{type1};
} elsif ($args->{switch} eq '01EE' || # inventory
$args->{switch} eq '01F0' || # storage
$args->{switch} eq '01EF' # cart
) {
return $items->{type2};
} elsif ($args->{switch} eq '02E8' || # inventory
$args->{switch} eq '02EA' || # storage
$args->{switch} eq '02E9' # cart
) {
return $items->{type3};
} elsif ($args->{switch} eq '0900' || # inventory
$args->{switch} eq '0902' #cart
) {
return $items->{type5};
} else {
warning "items_stackable: unsupported packet ($args->{switch})!\n";
}
}
(I think I pasted it all...)
-
- Noob
- Posts: 3
- Joined: 26 Jul 2012, 08:28
- Noob?: No
Re: iRO 21.12.2012 server merge
styuwono wrote:latest ServerType0.pm works for me, my inventory is back, but still can't auto open storage with "c r1 r0 n"
Try these "storageAuto_npc_steps c r1 c r0 n".Good luck!
-
- Noob
- Posts: 11
- Joined: 21 Dec 2012, 05:07
- Noob?: No
Re: iRO 21.12.2012 server merge
The ServerType0.pm, assuming you're using one with Harvest's patch applied to it, has the new stackable and unstackable cart and storage packets commented out at the top, so the switch for 0975 and 0976 can't be found. That's why you're getting those unknown switch warnings.styuwono wrote:latest ServerType0.pm works for me, my inventory is back, but still can't auto open storage with "c r1 r0 n"
Works when I open storage manually but it gives
Packet Parser: Unknown switch: 0975
Packet Parser: Unknown switch: 0976
anyone can help?
Sorry for my bad english grammar.
Go into src/Network/Receive/ServerType0.pm and at the end of the packet_list at the top, uncomment the last several lines of it. That'll let it handle the parsing of them.
-
- Noob
- Posts: 13
- Joined: 23 Dec 2012, 04:54
- Noob?: Yes
Re: iRO 21.12.2012 server merge
Storage auto is working with these:
storageAuto_npc_type 3
storageAuto_npc_steps c r1 r0 n
But still can't access cart items.
For Merchant class with cart got error like this when login
Packet Parser: Unknown switch: 0902
storageAuto_npc_type 3
storageAuto_npc_steps c r1 r0 n
But still can't access cart items.
For Merchant class with cart got error like this when login
Packet Parser: Unknown switch: 0902
-
- Noob
- Posts: 5
- Joined: 21 Dec 2012, 03:59
- Noob?: No
Re: iRO 21.12.2012 server merge
Ok eternal harvest's patch has '0903' => ['cart_items_stackable'] but then supports fixes has 0903 handled by items_nonstackable , shouldnt 0903 be handled by items_stackable if eternal harvest's partch is correct? I'm working on a rollup patch consisting of support's fixes and harvest's together (along with storage fixes) and I want to make sure I get all the packets right.
-
- Noob
- Posts: 11
- Joined: 21 Dec 2012, 05:07
- Noob?: No
Re: iRO 21.12.2012 server merge
I just did some testing. I threw some OCAs in my cart and this is what I got when I printed the Stackable packet interprets:whosiwhatsit wrote:Ok eternal harvest's patch has '0903' => ['cart_items_stackable'] but then supports fixes has 0903 handled by items_nonstackable , shouldnt 0903 be handled by items_stackable if eternal harvest's partch is correct? I'm working on a rollup patch consisting of support's fixes and harvest's together (along with storage fixes) and I want to make sure I get all the packets right.
Stackable Cart Item: switch = 0902, Old Card Album (2) x 200
...
Non-Stackable Cart Item: switch = 0903, Variant Shoes (7) x 1
Pretty sure 0903 is non-stackable.
-
- Noob
- Posts: 5
- Joined: 21 Dec 2012, 03:59
- Noob?: No
Re: iRO 21.12.2012 server merge
Well I'm not entirely certain how items_stackable and items_nonstackable need to be written to properly handle things, both 0975 and 0976 are ending up in items_nonstackable so.... not sure what to do there but I went ahead and rewrote sub storage_items_stackable and sub storage_items_nonstackable to use the new collections (is that the perl term for that?) setupsupport wrote:I just did some testing. I threw some OCAs in my cart and this is what I got when I printed the Stackable packet interprets:whosiwhatsit wrote:Ok eternal harvest's patch has '0903' => ['cart_items_stackable'] but then supports fixes has 0903 handled by items_nonstackable , shouldnt 0903 be handled by items_stackable if eternal harvest's partch is correct? I'm working on a rollup patch consisting of support's fixes and harvest's together (along with storage fixes) and I want to make sure I get all the packets right.
Stackable Cart Item: switch = 0902, Old Card Album (2) x 200
...
Non-Stackable Cart Item: switch = 0903, Variant Shoes (7) x 1
Pretty sure 0903 is non-stackable.
Code: Select all
sub storage_items_nonstackable {
my ($self, $args) = @_;
my $newmsg;
$self->decrypt(\$newmsg, substr($args->{RAW_MSG}, 4));
my $msg = substr($args->{RAW_MSG}, 0, 4).$newmsg;
my @itemKeys = $self->parse_items_nonstackable($args, substr $msg, 4);
for my $item (@itemKeys) {
my ($local_item, $add);
binAdd(\@storageID, $item->{index});
$local_item = $storage{$item->{index}} ||= Actor::Item->new;
for (keys %$item) {
$local_item->{$_} = $item->{$_};
}
$local_item->{name} = itemName($local_item);
$local_item->{amount} = 1;
$local_item->{binID} = binFind(\@storageID, $item->{index});
debug "Storage: $local_item->{name} ($local_item->{binID})\n", "parseMsg";
}
}
Code: Select all
sub storage_items_nonstackable {
my ($self, $args) = @_;
my $newmsg;
$self->decrypt(\$newmsg, substr($args->{RAW_MSG}, 4));
my $msg = substr($args->{RAW_MSG}, 0, 4).$newmsg;
my @itemKeys = $self->parse_items_nonstackable($args, substr $msg, 4);
for my $item (@itemKeys) {
my ($local_item, $add);
binAdd(\@storageID, $item->{index});
$local_item = $storage{$item->{index}} ||= Actor::Item->new;
for (keys %$item) {
$local_item->{$_} = $item->{$_};
}
$local_item->{name} = itemName($local_item);
$local_item->{amount} = 1;
$local_item->{binID} = binFind(\@storageID, $item->{index});
debug "Storage: $local_item->{name} ($local_item->{binID})\n", "parseMsg";
}
}
-
- Plain Yogurt
- Posts: 59
- Joined: 23 Dec 2012, 23:11
- Noob?: Yes
Re: iRO 21.12.2012 server merge
new problem: you can't access character at all if you have more than 15 character in your account... Slot 16 and onward are not detected while my main char is on slot 17+ due to Valkyrie base server...styuwono wrote: May be this helps. I've done merging the file with the patch and my bot is now running smooth. Just place in
..\src\Network\Receive\
http://www.4shared.com/file/3bFCXoR8/ServerType0.html
while I can access all characters before testing this file. I revert back to old version at this moment. Can someone show what the things that restore your character slot? The first problem is about how to restore character slot anyway...