Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved all "sendCharCreate" to send.pm #3517

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/Network/Send.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2272,7 +2272,18 @@ sub sendCardMerge {
}

sub sendCharCreate {
my ($self, $slot, $name, $str, $agi, $vit, $int, $dex, $luk, $hair_style, $hair_color) = @_;
my $self = shift;
my ($slot, $name, $str, $agi, $vit, $int, $dex, $luk, $hair_style, $hair_color, $job_id, $sex);

if ($self->{packet_lut}{char_create} eq '0067') {
($slot, $name, $str, $agi, $vit, $int, $dex, $luk, $hair_style, $hair_color) = @_;
} elsif ($self->{packet_lut}{char_create} eq '0970') {
($slot, $name, $hair_style, $hair_color) = @_;
} elsif ($self->{packet_lut}{char_create} eq '0A39') {
($slot, $name, $hair_style, $hair_color, $job_id, $sex) = @_;
$job_id ||= 0; # novice
$sex ||= 0; # female
}
$hair_color ||= 1;
$hair_style ||= 0;

Expand All @@ -2287,7 +2298,9 @@ sub sendCharCreate {
luk => $luk,
slot => $slot,
hair_color => $hair_color,
hair_style => $hair_style
hair_style => $hair_style,
job_id => $job_id,
sex => $sex
}));

debug "Sent Char Create\n", "sendPacket", 2;
Expand Down
12 changes: 0 additions & 12 deletions src/Network/Send/cRO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ sub reconstruct_master_login {
}
}

sub sendCharCreate {
my ( $self, $slot, $name, $hair_style, $hair_color, $job_id, $sex ) = @_;

$hair_color ||= 1;
$hair_style ||= 0;
$job_id ||= 0; # novice
$sex ||= 0; # female

my $msg = pack 'v a24 CvvvvC', 0x0A39, stringToBytes( $name ), $slot, $hair_color, $hair_style, $job_id, 0, $sex;
$self->sendToServer( $msg );
}

# 0x0436,23
sub sendMapLogin {
my ($self, $accountID, $charID, $sessionID, $sex) = @_;
Expand Down
42 changes: 13 additions & 29 deletions src/Network/Send/iRO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,35 @@
# also distribute the source code.
# See http://www.gnu.org/licenses/gpl.html for the full license.
#########################################################################
# tRO (Thai) for 2008-09-16Ragexe12_Th
# Servertype overview: https://openkore.com/wiki/ServerType
# International (iRO)

package Network::Send::iRO;

use strict;
use Globals;
use Network::Send::ServerType0;
use base qw(Network::Send::ServerType0);
use Log qw(error debug);
use I18N qw(stringToBytes);
use Utils qw(getTickCount getHex getCoordString);

sub new {
my ($class) = @_;
my $self = $class->SUPER::new(@_);

my %handlers = qw(
sync 0360
character_move 035F
actor_action 0437
actor_info_request 0368
actor_look_at 0361
item_take 0362
item_drop 0363
storage_item_add 0364
storage_item_remove 0365
skill_use_location 0366
party_setting 07D7
buy_bulk_vender 0801
char_create 0A39
char_delete2_accept 098F
send_equip 0998
character_move 035F
item_drop 0363
item_take 0362
map_login 0436
actor_action 0437
party_setting 07D7
send_equip 0998
skill_use 0438
skill_use_location 0366
storage_item_add 0364
storage_item_remove 0365
sync 0360
);
$self->{packet_lut}{$_} = $handlers{$_} for keys %handlers;

Expand All @@ -51,16 +47,4 @@ sub new {
return $self;
}

sub sendCharCreate {
my ( $self, $slot, $name, $hair_style, $hair_color, $job_id, $sex ) = @_;

$hair_color ||= 1;
$hair_style ||= 0;
$job_id ||= 0; # novice
$sex ||= 0; # female

my $msg = pack 'v a24 CvvvvC', 0x0A39, stringToBytes( $name ), $slot, $hair_color, $hair_style, $job_id, 0, $sex;
$self->sendToServer( $msg );
}

1;
9 changes: 1 addition & 8 deletions src/Network/Send/kRO/RagexeRE_2012_03_07f.pm
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ sub new {
return $self;
}

sub sendCharCreate {
my ($self, $slot, $name, $hair_style, $hair_color) = @_;
my $msg = pack('v a24 C v2', 0x0970, stringToBytes($name), $slot, $hair_color, $hair_style);
$self->sendToServer($msg);
debug "Sent sendCharCreate\n", "sendPacket", 2;
}

1;

=cut
Expand Down Expand Up @@ -150,4 +143,4 @@ sub sendCharCreate {
0x0907,5,moveitem,2:4
0x0908,5
0x08D7,28,battlegroundreg,2:4 //Added to prevent disconnections
=pod
=pod
1 change: 1 addition & 0 deletions src/Network/Send/kRO/Sakexe_0.pm
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ sub new {
'08C2' => ['macro_stop'],#2
'08C9' => ['request_cashitems'],#2
'096E' => ['merge_item_request', 'v a*', [qw(length itemList)]], #-1
'0970' => ['char_create', 'a24 C v2', [qw(name slot hair_style hair_color)]],
'097C' => ['rank_general', 'v', [qw(type)]],
'098D' => ['clan_chat', 'v Z*', [qw(len message)]],
'098F' => ['char_delete2_accept', 'v a4 a*', [qw(len charID code)]],
Expand Down
12 changes: 4 additions & 8 deletions tables/servers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ itemListType 1
ignoreAntiCheatWarning 0

# http://ro.zhaouc.com/
[cRO - China: Prontera]
[China - cRO: Prontera]
ip acc.ro.zhaouc.com
port 6900
master_version 4
Expand All @@ -74,7 +74,7 @@ rankingSystemType 1
itemListType 1

# https://eu.4game.com/ro/
[EU - euRO: Revo Classic]
[European - euRO: Revo Classic]
ip 185.47.158.72
port 6800
version 1
Expand Down Expand Up @@ -171,7 +171,7 @@ serverEncoding Japanese
addTableFolders Old

# http://roz.gnjoy.com/
[Korea - kRO:Zero]
[Korea - kRO: Zero]
ip 112.175.128.137
port 6950
OTP_ip 112.175.128.135
Expand Down Expand Up @@ -235,7 +235,6 @@ secureLogin_type 0
secureLogin_requestCode
secureLogin_account 0
serverEncoding Western
gameGuard 0
addTableFolders pRO
charBlockSize 147
pinCode 1
Expand All @@ -256,7 +255,6 @@ secureLogin_type 0
secureLogin_requestCode
secureLogin_account 0
serverEncoding Western
gameGuard 0
addTableFolders pRO
charBlockSize 147
pinCode 1
Expand All @@ -266,7 +264,7 @@ itemListType 1
ignoreAntiCheatWarning 0

# https://ru.4game.com/ro/play/
[Russia - rRO-Renewal]
[Russia - rRO: Renewal]
ip 109.105.140.145
port 6800
master_version 25
Expand All @@ -277,7 +275,6 @@ addTableFolders rRO
charBlockSize 145
storageEncryptKey 0x050B6F79, 0x0202C179, 0x0E20120, 0x04FA43E3, 0x0179B6C8, 0x05973DF2, 0x07D8D6B, 0x08CB9ED9
blockingPlayerCancel 1
gameGuard 0

# https://ro.gnjoy.com.tw/
[Taiwan - twRO: Sarah, Alice, Bakili, Charles, Poli]
Expand Down Expand Up @@ -308,7 +305,6 @@ serverType tRO
serverEncoding Thai
addTableFolders tRO
charBlockSize 175
gameGuard 0
charDeleteDateType 1
blockingPlayerCancel 1
rankingSystemType 1
Expand Down