Quote:
Originally Posted by IAmHawtness
System.currentTimeMillis() is the same as Environment.TickCount  .
I'm just not sure if your write(byte[]) method is correct, could you perhaps convert the pw.getBytes to a text string so it shows as "50 00 F1 03 xx xx xx xx xx xx" etc.? Perhaps then you'll be able to see what's wrong
|
the System.currentTimeMillis() actually returns a long number that is few times the digits of what i see in the timer field in the the itemusage packets. What i do see if that both the co_timer and system timer increments at the same rate.
i definitely can over write the timer field in the packet with my system timer, but doesn't that mean i need to overwrite the timer field in any packet that contains a timer field? I am trying to avoid that.
Alright, this is an output of what i get when i check on my different timers.
Code:
Waiting ...
Waiting ...
DH exchange complete.
Client time base :21161659 Proxy time base :1299186607937
Client Time Diff:10470 Proxy Timer Diff:10531
Client Time Diff:20489 Proxy Timer Diff:20547
Client Time Diff:30557 Proxy Timer Diff:30609
Client Time Diff:40589 Proxy Timer Diff:40641
Client Time Diff:50627 Proxy Timer Diff:50688
Client Time Diff:60659 Proxy Timer Diff:60719
Client Time Diff:70676 Proxy Timer Diff:70734
Client Time Diff:80679 Proxy Timer Diff:80734
Following are the codes that actually prints the about results.
Code:
case 1009:
PacketTypes.ItemUsage usage = new PacketTypes.ItemUsage(p);
if (packetSource == CLIENT) {
if (usage.usageType != 27) {
System.out.println(usage.toString());
Utility.printHexPacket(p);
}
//------------------------------------------------------------------------
//sets proxy timer on first invocation of item usage packet.
//to update proxy timer, perform System.currentTimeMillis - proxy_time_base + timer
//------------------------------------------------------------------------
if (this.timer == 0) {
this.timer = usage.timer;
this.proxy_time_base = System.currentTimeMillis();
System.out.println("Client time base" + this.timer + "\tProxy time base :" + this.proxy_time_base);
}
System.out.println("Client Time Diff:" + (usage.timer - this.timer) + "\tProxy Timer Diff:" + (System.currentTimeMillis() - this.proxy_time_base));
if (usage.usageType == 37) {
System.out.println("Throwing away "+usage.itemID);
this.items.remove(usage.itemID);
}
}
break;
Here is an original packet from perform met upgrade in TC
in this case item location contains met UID.
Looking at the timer ... i have a feeling that it was
stepped up. If it wasn't meant to be this way.. then i must be doing something wrong with my local timers.
Code:
Client Time Diff:411789 Proxy Timer Diff:411797
Client Time Diff:421793 Proxy Timer Diff:421844
Size=80 ,Type=1009, ItemID=1053324710, ItemLocation=1053324733, UsageType=20, timer=24730295
50 0 F1 3 A6 75 C8 3E BD 75 C8 3E 14 0 0 0 B7 5A 79 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 54 51 43 6C 69 65 6E 74
Client Time Diff:3568636 Proxy Timer Diff:426891
Here is a proxy constructed tc met upgrade packet - which causes dc.
Code:
Client Time Diff:612624 Proxy Timer Diff:612688
Client Time Diff:622624 Proxy Timer Diff:622688
Client Time Diff:632646 Proxy Timer Diff:632703
Met spam started
You have 9 gears, and 2 mets.
Upgrade packet Built: length = 88, timer =21801940
50 0 F1 3 AD 75 C8 3E BC 75 C8 3E 14 0 0 0 94 72 7A 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 54 51 43 6C 69 65 6E 74
EDIT:
above output come from the same session...
I know it is a bit weird that why the proxy generated packet is attempting to use the same met as the previous manual upgrade, well, you can see from my codes that i only removed an item from my itemlist if it is dropped. Didn't account for other ways an item can be consumed/traded/sold and what not. However this is definitely not the main cause as i have edited my codes and tested; Still dc's
I have a feeling that problem lies with my timestamp.