r8163 party booking

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

r8163 party booking

#1 Post by EternalHarvest »

http://openkore.svn.sourceforge.net/vie ... ision=8163
* Full support for party booking by the OpenKore.
"Full" without kRO ST? Trying booking in it would probably just crash.

It also employs arbitrary map IDs instead of map names used anywhere else and arbitrary job IDs, but that's not a big deal, "full support" can be added later.

So we have deal_request, guild_request, guild_ally_request, sync_request, GM_req_acc_name (ok, you got me there), deal_request, adopt_request, friend_request, gameguard_request, storage_password_request, auction_item_request_search, cash_password_request, login_pin_code_request. New packet names: party_booking_req_register, party_booking_req_search, party_booking_req_update.

Notice how we never used "ack" in packet names in favor of more descriptive words:

Code: Select all

PACKET_ZC_ACK_REQNAME
  actor_info
PACKET_ZC_ACK_WHISPER
  private_message_sent
PACKET_ZC_ACK_CREATE_CHATROOM
  chat_created
PACKET_ZC_ACK_EXCHANGE_ITEM
  deal_begin
PACKET_ZC_ACK_ADD_EXCHANGE_ITEM
  deal_add_you
PACKET_ZC_ACK_MAKE_GROUP
  party_organize_result
PACKET_ZC_ACK_REQ_JOIN_GROUP
  party_invite_result
PACKET_ZC_ACK_TOUSESKILL
  skill_use_failed
etc
Receive packets are all "booking_", but Send ones are "party_booking_".

Code: Select all

'0802' => ['party_booking_req_register', 's8', [qw(level MapID job0 job1 job2 job3 job4 job5)]],
'0804' => ['party_booking_req_search', 's3 L s', [qw(level MapID job LastIndex ResultCount)]],
'0806' => ['party_booking_delete'],
'0808' => ['party_booking_req_update', 's6', [qw(job0 job1 job2 job3 job4 job5)]],
"s"? Are they really signed short? Why you're putting (in Commands) 65535 into signed short, then?
Why "delete" isn't "req", like others?

Code: Select all

'0805' => ['booking_ack_search', 's a a*', [qw(len IsExistMoreResult innerData)]],
Signed length. By the way, you can just use "x2" there, packet reconstructor would do everything for you anyway.

Code: Select all

'0809' => ['booking_insert', 'L Z24 L v8', [qw(index name expire lvl map_id job1 job2 job3 job4 job5 job6)]],
'080A' => ['booking_update', 'L v6', [qw(index job1 job2 job3 job4 job5 job6)]],
'080B' => ['booking_delete', 'L', [qw(index)]],
"L/l" and "S/s" aren't portable (http://perldoc.perl.org/functions/pack.html), notice which pack codes all other packets use?
Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: r8163 party booking

#2 Post by Kaspy »

[EN]
I updated: http://cia.vc/stats/project/openkore/.message/350c40

Just missing now part arbitrary, but I will not do that.


I never changed before the send/kro and receive\kro, but tested it on a local server and everything seems correct this.

[PT-BR]
Atualizei: http://cia.vc/stats/project/openkore/.message/350c40

Só falta agora a parte arbitrária, mas não irei fazer isso.


Eu nunca mexi antes no send\kro e receive\kro, mas testei em um servidor local e parece esta tudo correto.
Image
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: r8163 party booking

#3 Post by EternalHarvest »

Booking functions display non-latin names incorrectly.
Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: r8163 party booking

#4 Post by Kaspy »

It gets tricky I test this in practice, but I believe this solves the case, right?

Code: Select all

Index: ServerType0.pm
===================================================================
--- ServerType0.pm	(revision 8353)
+++ ServerType0.pm	(working copy)
@@ -3941,7 +3941,7 @@
 						 "MapID: @<<<<<\n".
 						 "Job: @<<<< @<<<< @<<<< @<<<< @<<<<\n" .
 						 "---------------------------------------------"),
-					   [$charName, $index, getFormattedDate($expireTime), $level, $mapID, @job]), "booking";
+					   [bytesToString($charName), $index, getFormattedDate($expireTime), $level, $mapID, @job]), "booking";
 	}
 }
 
@@ -3963,7 +3963,7 @@
 sub booking_insert {
 	my ($self, $args) = @_;
 
-	message TF("%s has created a new group booking (index: %s)\n", $args->{name}, $args->{index});
+	message TF("%s has created a new group booking (index: %s)\n", bytesToString($args->{name}), $args->{index});
 }
 
 # 0x80A
Image