本帖最後由 91001022 於 2013-3-30 00:21 編輯
轉載 http://ro2.snop.idv.tw/forum.php ... page%3D1&page=1
內容如下 有點難度 建議還是去論壇看比較好 我貼的有點亂
2013/3/29 官服維護後,角色封包變動....
多處修改,如下:
注意: 以下修改涉及主程式修改,
稍有不慎恐會造成無法程執行,
建議修改前先行備份,以備不時之需
1. 伺服器定義檔 tables/servers.txt
修改您所指定的伺服,把 charBlockSize 改為 144
2. 封包定義檔 recvpackets
修改您所指定的封包定義檔,
082D 29
09A0 6
099D 0
3. 修改 src/Network/Receive/ServerType0.pm
先找到「if ($args->{switch} eq '099D' && $args->{RAW_MSG_SIZE} != 4) {」字串,
原程式碼
# FIXME better support for multiple received_characters packets
if ($args->{switch} eq '099D' && $args->{RAW_MSG_SIZE} != 4) {
$net->setState(1.5);
return
}
修改成
# FIXME better support for multiple received_characters packets
# if ($args->{switch} eq '099D' && $args->{RAW_MSG_SIZE} != 4) {
# $net->setState(1.5);
# return
# }
也就是把第 02 ~ 05 行註解掉
4. 修改 src/Network/Receive/twRO.pm (這是最複雜的部分),
修改(1).
先找到「use strict;」字串,
原程式碼
use strict;
use Globals;
use base qw(Network::Receive::ServerType0);
use Log qw(message warning error debug);
use Network::MessageTokenizer;
use I18N qw(bytesToString stringToBytes);
修改成
use strict;
use Time::HiRes;
use Globals;
use base qw(Network::Receive::ServerType0);
use Misc;
use Utils;
use Log qw(message warning error debug);
use Network::MessageTokenizer;
use I18N qw(bytesToString stringToBytes);
也就是新增插入第 02, 05, 06 行
修改(2).
先找到「my %packets = (」字串,
原程式碼
my %packets = (
'006D' => ['character_creation_successful', 'a4 V9 v V2 v14 Z24 C6 v2', [qw(charID exp zeny exp_job lv_job opt1 opt2 option stance manner points_free hp hp_max sp sp_max walk_speed type hair_style weapon lv points_skill lowhead shield tophead midhead hair_color clothes_color name str agi vit int dex luk slot renameflag)]],
'0097' => ['private_message', 'v Z28 Z*', [qw(len privMsgUser privMsg)]],
'097A' => ['quest_all_list2', 'v3 a*', [qw(len count unknown message)]],
);
修改成
my %packets = (
'006D' => ['character_creation_successful', 'a4 V9 v V2 v14 Z24 C6 v2', [qw(charID exp zeny exp_job lv_job opt1 opt2 option stance manner points_free hp hp_max sp sp_max walk_speed type hair_style weapon lv points_skill lowhead shield tophead midhead hair_color clothes_color name str agi vit int dex luk slot renameflag)]],
'0097' => ['private_message', 'v Z28 Z*', [qw(len privMsgUser privMsg)]],
'097A' => ['quest_all_list2', 'v3 a*', [qw(len count unknown message)]],
'082D' => ['received_characters_info', 'x2 C5 x20', [qw(normal_slot premium_slot billing_slot producible_slot valid_slot)]],
'09A0' => ['unknown_09A0', 'a4', [qw(unknown)]],
'099D' => ['received_characters', 'v a*', [qw(len charInfo)]],
'08B9' => ['account_id', 'x4 a4 x2', [qw(accountID)]], # 12
);
也就是新增插入第 05 ~ 08 行
修改(3).
先找到「my %handlers = qw(」字串,
原程式碼
my %handlers = qw(
actor_moved 0856
actor_exists 0857
actor_connected 0858
account_id 0283
received_characters 082D
);
修改成
my %handlers = qw(
actor_moved 0856
actor_exists 0857
actor_connected 0858
account_id 08B9
received_characters 099D
);
也就是修改第 05 的「08B9」和第 06 行的「099D」
修改(4).
先找到程式檔最底下的「1;」字串,
原程式碼
}
1;
修改成
}
sub unknown_09A0 {
$messageSender->sendToServer($messageSender->reconstruct({switch => 'unknown_09A1'}));
}
sub received_characters_info {
my ($self, $args) = @_;
Scalar::Util::weaken(my $weak = $self);
my $timeout = {timeout => 6, time => time};
$self->{charSelectTimeoutHook} = Plugins::addHook('Network::serverConnect/special' => sub {
if ($weak && timeOut($timeout)) {
$weak->received_characters({charInfo => '', RAW_MSG_SIZE => 4});
}
});
$self->{charSelectHook} = Plugins::addHook(charSelectScreen => sub {
if ($weak) {
Plugins::delHook(delete $weak->{charSelectTimeoutHook}) if $weak->{charSelectTimeoutHook};
}
});
$timeout{charlogin}{time} = time;
$self->received_characters($args);
}
1;
也就是新增插入第 02 ~ 28 行
5. 修改 src/Network/Send/twRO.pm
先找到「my %packets = (」字串,
原程式碼
my %packets = (
'0819' => ['buy_bulk_buyer', 'x2 a4 a4 v a*', [qw(buyerID buyingStoreID zeny itemInfo)]],
);
修改成
my %packets = (
'0819' => ['buy_bulk_buyer', 'x2 a4 a4 v a*', [qw(buyerID buyingStoreID zeny itemInfo)]],
'09A1' => ['unknown_09A1'],
);
也就是新增插入第 03 行
------------------------------------------
追加修改 2013/04/01 00:36
6. 修改 src/Network/Receive/ServerType0.pm
先找到「'0283'」字串,
原程式碼:
'0283' => ['account_id', 'V', [qw(accountID)]],
修改成:
'0283' => ['account_id', 'a4', [qw(accountID)]],
也就是把原「'V'」改成「'a4'」 |