quest system support

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

Moderator: Moderators

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

Re: quest system support

#21 Post by kLabMouse »

Structure of packet 0x02b3 updated.
obsc
Noob
Noob
Posts: 18
Joined: 11 Sep 2009, 03:58
Noob?: Yes

Re: quest system support

#22 Post by obsc »

kLabMouse wrote: ...
You see the "show: 00 00 00 00" ??? that's Because sometimes MS VC++ optimizer, optimize in memory structures for effective use. that's why, some "char"s can get extra 3 bytes.
well, i am c/c++ dev, so i pretty much know about padding. the thing is i'd never thought that low of gravity that they could dare feeding send() with plain structures that were not wrapped in pack(1)... padding aside, i'd never thought that there could exist idiots who'd send garbage (zeroed structures carrying no meaning) over network... well, i know such creatures exist, but for them to exist in commercial organizations...
Technology wrote:obsc, can you record packet 02B3 (aka. quest_add)?
no problem, but it'll have to wait for some free time for ro.
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: quest system support

#23 Post by Technology »

Yea, sending more information than is needed is gravity's trademark. ;)
All is committed to svn, please test.
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!
obsc
Noob
Noob
Posts: 18
Joined: 11 Sep 2009, 03:58
Noob?: Yes

Re: quest system support

#24 Post by obsc »

in case it's still needed:

Code: Select all

B3 02 D3 EA 00 00 01 00 00 00 00 00 00 00 00 01 
00 50 04 00 00 00 00 43 6F 63 6F 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 
obsc
Noob
Noob
Posts: 18
Joined: 11 Sep 2009, 03:58
Noob?: Yes

Re: quest system support

#25 Post by obsc »

Technology wrote:Yea, sending more information than is needed is gravity's trademark. ;)
All is committed to svn, please test.
i don't like new way of showing quest info ^^;;

Code: Select all

quest list
--------------------------------- Quest List ----------------------------------
  0 60115                           non-active
  1 HASH(0x305f050)                 non-active
  2 60118                           non-active
  3 HASH(0x305f110)                 non-active
-------------------------------------------------------------------------------
btw there should be only two quests. imho quest info should be shown one quest per line (with all counters), with correct indexing, etc.
Last edited by obsc on 11 Sep 2009, 12:11, edited 1 time in total.
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: quest system support

#26 Post by Technology »

obsc wrote:

Code: Select all

B3 02 D3 EA 00 00 01 00 00 00 00 00 00 00 00 01 
00 50 04 00 00 00 00 43 6F 63 6F 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 
perfect 8-)

Code: Select all

quest_add 60115, 1, 0, 0, 1
1104, 0, Coco
EDIT:
obsc wrote:

Code: Select all

quest list
--------------------------------- Quest List ----------------------------------
  0 60115                           non-active
  1 HASH(0x305f050)                 non-active
  2 60118                           non-active
  3 HASH(0x305f110)                 non-active
-------------------------------------------------------------------------------
uhm wtf that must be a bug somewhere, sad thing is it will stay a bug without further information :?

EDIT2:
might have found it, update to latest svn and test again please
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!
obsc
Noob
Noob
Posts: 18
Joined: 11 Sep 2009, 03:58
Noob?: Yes

Re: quest system support

#27 Post by obsc »

Technology wrote: ...
uhm wtf that must be a bug somewhere, sad thing is it will stay a bug without further information :?

EDIT2:
might have found it, update to latest svn and test again please
well, i'd say still missed )

Code: Select all

quest list
--------------------------------- Quest List ----------------------------------
  0 60115                           non-active
  1 60118                           non-active
-------------------------------------------------------------------------------
need counters shown. btw, what is this "non-active" supposed to mean? both quest are active (according to client) afaik.
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: quest system support

#28 Post by Technology »

Why the hell isn't time showing up? its 0 but it should show up.
active/inactive should be fixed now, for the rest i suggest someone makes a log with debug on.
If possible record the packets too.
I don't have a clue why the monsters aren't showing up, its probably a stupid bug somewhere...

EDIT: i hope its fixed now, if not, eat my shorts :twisted:
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!
obsc
Noob
Noob
Posts: 18
Joined: 11 Sep 2009, 03:58
Noob?: Yes

Re: quest system support

#29 Post by obsc »

Technology wrote:Why the hell isn't time showing up? its 0 but it should show up.
active/inactive should be fixed now, for the rest i suggest someone makes a log with debug on.
If possible record the packets too.
I don't have a clue why the monsters aren't showing up, its probably a stupid bug somewhere...

EDIT: i hope its fixed now, if not, eat my shorts :twisted:
well, the most funny thing is that it's not fixed ) although it really started showing time (still no counters info) ^^;;

well, i think i pinpointed the real problem. i'm not sure if i'm right since i started writing in perl today (lol, common sense ftw! even in insane cases like perl syntax...), but seems like i got it working.

here's my patch for one of the files (i'm not dev/comitter, so plz bother to verify it and apply where necessary):

Code: Select all

Index: ServerType0.pm
===================================================================
--- ServerType0.pm	(revision 6901)
+++ ServerType0.pm	(working copy)
@@ -7217,6 +7217,7 @@
 			$mission->{mobID} = $mobID;
 			$mission->{count} = $count;
 			$mission->{mobName} = bytesToString($mobName);
+			$quest->{missions}->{$mobID} = $mission;
 			debug "- $mobID $count $mobName\n", "info";
 		}
 	}
@@ -7235,6 +7236,7 @@
 		$mission->{mobID} = $mobID;
 		$mission->{count} = $count;
 		$mission->{mobName} = bytesToString($mobName);
+		$questList->{$questID}->{missions}->{$mobID} = $mission;
 		debug "- $mobID $count $mobName\n", "info";
 	}
 }
@@ -7259,6 +7261,7 @@
 		my $mission = $questList->{$questID}->{missions}->{$mobID};
 		$mission->{count} = $count;
 		$mission->{mobID} = $mobID;
+		$questList->{$questID}->{missions}->{$mobID} = $mission;
 		debug ("questID (%s) - mob(%s) count(%s) \n", $questID, monsterName($mobID), $count), "info";
 	}
 }
i have no actual knowledge of how perl manages objects, but it seems my common-sense-assumption was not that wrong. i think you'll get the idea of this "fix" immediately.
well, not the best way to resolve this issue - treat it as proof-of-concept type ))

also, do what needs to be done with debug message on line 7265:

Code: Select all

		debug ("questID (%s) - mob(%s) count(%s) \n", $questID, monsterName($mobID), $count), "info";
plain replace of "message TF" with "debug" in code can lead to pretty funny diagnostic messages ^^;;

upd: my bad... i meant line 7265 of src\Network\Receive\ServerType0.pm
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: quest system support

#30 Post by Technology »

wtf, look at this:

Code: Select all

#!/usr/bin/env perl
use strict;

our $testList;
$testList->{test} = "yes";
test();

sub test {
	my $test = $testList; # $test gets a reference == OK
	$test->{test} = "no";
	# $testList = $test;
}

print "Do we need to use the commented out line? " . $testList->{test} . "\n";
The answer is no, like i expected.

I basically did the same but why the hell isn't it acting the same?
As you can see, $mission is just as $test just a reference to the hash.

nvm, i see what is wrong now, the $quest->{missions}->{$mobID} is not a hash reference yet because it is still undef!!!!!!!!
so perl makes a scalar $mission with value undef, which is no reference to the hash...

Code: Select all

#!/usr/bin/env perl
use strict;

our $testList;
$testList->{test};
test();

sub test {
	my $test = $testList->{test}; # $test doesn't get a reference to a hash but a value (undef) == NOK!
	$test->{test} = "no";
	#$testList->{test}->{test} = $test->{test};
}

print "Do we need to use the commented out line? " . ($testList->{test}->{test} ? $testList->{test}->{test} : "yes") . "\n";
The answer here is yes, because $testList->{test}->{test} is undefined.

Such a dumb mistake, i wanted to write the code tidier and shorter but instead... :oops:

EDIT: now we force the reference, i hope its fixed now. test svn once again okay? :?
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!