Skip to content

Commit

Permalink
update tRO mapLogin (#3469)
Browse files Browse the repository at this point in the history
* update tRO Network files
* update tRO map_login
* code cleanup
* updated table files

Co-authored-by: ya4ept <[email protected]>
Co-authored-by: Alison <[email protected]>
  • Loading branch information
3 people authored Sep 4, 2021
1 parent 89f6711 commit ff9707a
Show file tree
Hide file tree
Showing 17 changed files with 23,762 additions and 15,734 deletions.
8 changes: 4 additions & 4 deletions src/Network/Receive/tRO.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#########################################################################
# OpenKore - Network subsystem
# This module contains functions for sending messages to the server.
# Copyright (c) 2021 OpenKore Team
#
# This software is open source, licensed under the GNU General Public
# License, version 2.
Expand All @@ -10,10 +10,10 @@
# See http://www.gnu.org/licenses/gpl.html for the full license.
#########################################################################
# tRO (Thai)

package Network::Receive::tRO;
use strict;
use base qw(Network::Receive::ServerType0);
use Globals;

sub new {
my ($class) = @_;
Expand Down Expand Up @@ -46,11 +46,11 @@ sub new {

$self->{packet_lut}{$_} = $handlers{$_} for keys %handlers;

$self->{vender_items_list_item_pack} = 'V v2 C V C3 a16 a25';
$self->{npc_store_info_pack} = "V V C V";
$self->{buying_store_items_list_pack} = "V v C V";
$self->{makable_item_list_pack} = "V4";
$self->{npc_market_info_pack} = "V C V2 v";
$self->{npc_store_info_pack} = "V V C V";
$self->{vender_items_list_item_pack} = 'V v2 C V C3 a16 a25';


return $self;
Expand Down
70 changes: 51 additions & 19 deletions src/Network/Send/tRO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,57 @@
# See http://www.gnu.org/licenses/gpl.html for the full license. #
#################################################################################################
# tRO (Thai)

package Network::Send::tRO;

use strict;
use base qw(Network::Send::ServerType0);
use Log qw(debug);
use Utils qw(getTickCount);

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

my %packets = (
'0436' => ['map_login', 'a4 a4 a4 V2 C', [qw(accountID charID sessionID unknown tick sex)]],#23
);

$self->{packet_list}{$_} = $packets{$_} for keys %packets;

my %handlers = qw(
master_login 0A76
game_login 0275
buy_bulk_vender 0801
actor_action 0437
skill_use 0438
character_move 035F
sync 0360
actor_look_at 0361
item_take 0362
item_drop 0363
storage_item_add 0364
storage_item_remove 0365
skill_use_location 0366
actor_info_request 0368
actor_look_at 0361
actor_name_request 0369
buy_bulk_buyer 0819
buy_bulk_request 0817
buy_bulk_closeShop 0815
buy_bulk_openShop 0811
buy_bulk_request 0817
buy_bulk_vender 0801
char_create 0A39
char_delete2_accept 098F
character_move 035F
friend_request 0202
game_login 0275
homunculus_command 022D
item_drop 0363
item_list_window_selected 07E4
item_take 0362
map_login 0436
master_login 0A76
party_join_request_by_name 02C4
friend_request 0202
homunculus_command 022D
storage_password 023B
party_setting 07D7
send_equip 0998
pet_capture 08B5
char_delete2_accept 098F
char_create 0A39
rodex_open_mailbox 0AC0
rodex_refresh_maillist 0AC1
send_equip 0998
skill_use 0438
skill_use_location 0366
storage_item_add 0364
storage_item_remove 0365
storage_password 023B
sync 0360
);

$self->{packet_lut}{$_} = $handlers{$_} for keys %handlers;
Expand Down Expand Up @@ -94,4 +104,26 @@ sub reconstruct_master_login {
}
}

# 0x0436,23
sub sendMapLogin {
my ($self, $accountID, $charID, $sessionID, $sex) = @_;
my $msg;
$sex = 0 if ($sex > 1 || $sex < 0); # Sex can only be 0 (female) or 1 (male)

#my $unknown = pack('C4', (0x90, 0x13, 0xE0, 0xE8));

$msg = $self->reconstruct({
switch => 'map_login',
accountID => $accountID,
charID => $charID,
sessionID => $sessionID,
unknown => 768,# 00 00 03 00
tick => getTickCount,
sex => $sex,
});

$self->sendToServer($msg);
debug "Sent sendMapLogin\n", "sendPacket", 2;
}

1;
Loading

0 comments on commit ff9707a

Please sign in to comment.