sendBuyBulkVender in SeverType0.pm

This place is for Closed bug reports only. NOT for asking help!

Moderators: Moderators, Developers

Message
Author
sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

sendBuyBulkVender in SeverType0.pm

#1 Post by sofax222 »

I am player in Free twRO.
I always can not buy item from vender.
I found a bug in send packet for sendBuyBulkVender.
As following

Original Code of src/Network/Send/SeverType0.pm

Code: Select all

.......
# 0x0134,-1,purchasereq,2:4:8
sub sendBuyBulkVender {
	my ($self, $venderID, $r_array) = @_;
	my $msg = pack('v2 a4', 0x0134, 8+4*@{$r_array}, $venderID);
	for (my $i = 0; $i < @{$r_array}; $i++) {
		$msg .= pack('v2', $r_array->[$i]{amount}, $r_array->[$i]{itemIndex});
		debug "Sent bulk buy vender: $r_array->[$i]{itemIndex} x $r_array->[$i]{amount}\n", "d_sendPacket", 2;
	}
	$self->sendToServer($msg);
}
.....
New Code of src/Network/Send/SeverType0.pm
(I modify the first two lines in the sub.)

Code: Select all

.......
# 0x0134,-1,purchasereq,2:4:8
sub sendBuyBulkVender {
	my ($self, $venderID, $r_array, $venderCID) = @_;
	my $msg = pack('v2 a4 a4', 0x0801, 12+4*@{$r_array}, $venderID, $venderCID);
	for (my $i = 0; $i < @{$r_array}; $i++) {
		$msg .= pack('v2', $r_array->[$i]{amount}, $r_array->[$i]{itemIndex});
		debug "Sent bulk buy vender: $r_array->[$i]{itemIndex} x $r_array->[$i]{amount}\n", "d_sendPacket", 2;
	}
	$self->sendToServer($msg);
}
.....

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

Re: sendBuyBulkVender in SeverType0.pm

#2 Post by kLabMouse »

This should go to twRO ServerType
and Checked on all others.

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: sendBuyBulkVender in SeverType0.pm

#3 Post by sofax222 »

Update the twRO.pm :
Add the corrected sendBuyBulkVender function !
Update to SVN 7709

Post Reply