29
29
import org .runejs .client .scene .camera .CameraRotation ;
30
30
import org .runejs .client .scene .camera .CutsceneCamera ;
31
31
import org .runejs .client .scene .camera .SphericalCamera ;
32
- import org .runejs .client .scene .util .CollisionMap ;
33
32
import org .runejs .client .sound .MusicSystem ;
34
33
import org .runejs .client .sound .SoundSystem ;
35
34
import org .runejs .client .util .Signlink ;
@@ -79,7 +78,7 @@ public class Game {
79
78
public static int loginStatus = 0 ;
80
79
public static int modewhat = 0 ;
81
80
public static int modewhere = 0 ;
82
- public static long aLong1203 = 0L ;
81
+ public static long lastClickTime = 0L ;
83
82
public static int mouseInvInterfaceIndex = 0 ;
84
83
public static int anInt509 = 0 ;
85
84
public static boolean aBoolean519 = true ;
@@ -103,6 +102,10 @@ public class Game {
103
102
public static long aLong1841 ;
104
103
public static int clientVersion ;
105
104
public static int playerRights = 0 ;
105
+ /**
106
+ * Backup port if the first one fails?
107
+ */
108
+ private static int someOtherPort ;
106
109
private static int gameServerPort ;
107
110
private static int duplicateClickCount = 0 ;
108
111
private static int lastClickY = 0 ;
@@ -267,7 +270,7 @@ public static boolean drawInterface(int areaId, int minX, int minY, int maxX, in
267
270
i_12_ = 0 ;
268
271
if (i_14_ < 5 && i_14_ > -5 )
269
272
i_14_ = 0 ;
270
- if (Buffer .lastItemDragTime < 5 ) {
273
+ if (GameInterface .lastItemDragTime < 5 ) {
271
274
i_14_ = 0 ;
272
275
i_12_ = 0 ;
273
276
}
@@ -615,7 +618,7 @@ else if (gameInterface.xTextAlignment == 1)
615
618
616
619
617
620
public static void setConfigToDefaults () {
618
- aLong1203 = 0L ;
621
+ lastClickTime = 0L ;
619
622
mouseCapturer .coord = 0 ;
620
623
duplicateClickCount = 0 ;
621
624
aBoolean1735 = true ;
@@ -633,12 +636,12 @@ public static void setConfigToDefaults() {
633
636
IncomingPackets .thirdLastOpcode = -1 ;
634
637
IncomingPackets .incomingPacketBuffer .currentPosition = 0 ;
635
638
MovedStatics .menuActionRow = 0 ;
636
- MouseHandler .method650 (0 );
639
+ MouseHandler .setFramesSinceMouseInput (0 );
637
640
for (int i = 0 ; i < 100 ; i ++)
638
641
ChatBox .chatMessages [i ] = null ;
639
642
GameInterface .itemCurrentlySelected = 0 ;
640
643
MovedStatics .destinationX = 0 ;
641
- Buffer .anInt1985 = -1 ;
644
+ MovedStatics .anInt1985 = -1 ;
642
645
Player .npcCount = 0 ;
643
646
SoundSystem .reset ();
644
647
widgetSelected = 0 ;
@@ -1324,10 +1327,10 @@ else if(x > 764)
1324
1327
}
1325
1328
}
1326
1329
if (MouseHandler .clickType != 0 ) {
1327
- long l = (MouseHandler .aLong2561 - aLong1203 ) / 50L ;
1330
+ long delta = (MouseHandler .clickTime - lastClickTime ) / 50L ;
1328
1331
int i = MouseHandler .clickX ;
1329
1332
int i_10_ = MouseHandler .clickY ;
1330
- aLong1203 = MouseHandler .aLong2561 ;
1333
+ lastClickTime = MouseHandler .clickTime ;
1331
1334
if (i >= 0 ) {
1332
1335
if (i > 764 )
1333
1336
i = 764 ;
@@ -1341,9 +1344,9 @@ else if(x > 764)
1341
1344
int i_11_ = 0 ;
1342
1345
if (MouseHandler .clickType == 2 )
1343
1346
i_11_ = 1 ;
1344
- if (l > 4095 )
1345
- l = 4095L ;
1346
- int i_12_ = (int ) l ;
1347
+ if (delta > 4095 )
1348
+ delta = 4095L ;
1349
+ int i_12_ = (int ) delta ;
1347
1350
OutgoingPackets .buffer .putPacket (234 );
1348
1351
int i_13_ = i_10_ * 765 + i ;
1349
1352
OutgoingPackets .buffer .putIntLE ((i_11_ << 19 ) + (i_12_ << 20 ) + i_13_ );
@@ -1398,7 +1401,7 @@ else if(x > 764)
1398
1401
}
1399
1402
MovedStatics .anInt199 ++;
1400
1403
if (GameInterface .activeInterfaceType != 0 ) {
1401
- Buffer .lastItemDragTime ++;
1404
+ GameInterface .lastItemDragTime ++;
1402
1405
if (MouseHandler .mouseX > Renderable .anInt2869 + 5 || Renderable .anInt2869 + -5 > MouseHandler .mouseX || MovedStatics .anInt2798 + 5 < MouseHandler .mouseY || MovedStatics .anInt2798 - 5 > MouseHandler .mouseY )
1403
1406
MovedStatics .lastItemDragged = true ;
1404
1407
if (MouseHandler .currentMouseButtonPressed == 0 ) {
@@ -1407,7 +1410,7 @@ else if(x > 764)
1407
1410
if (GameInterface .activeInterfaceType == 2 )
1408
1411
GameInterface .redrawTabArea = true ;
1409
1412
GameInterface .activeInterfaceType = 0 ;
1410
- if (MovedStatics .lastItemDragged && Buffer .lastItemDragTime >= 5 ) {
1413
+ if (MovedStatics .lastItemDragged && GameInterface .lastItemDragTime >= 5 ) {
1411
1414
GameInterface .lastActiveInvInterface = -1 ;
1412
1415
MovedStatics .processRightClick ();
1413
1416
if (GameInterface .lastActiveInvInterface == GameInterface .modifiedWidgetId && mouseInvInterfaceIndex != GameInterface .selectedInventorySlot ) {
@@ -1486,7 +1489,7 @@ else if(MovedStatics.menuActionRow > 0)
1486
1489
}
1487
1490
1488
1491
if (MouseHandler .currentMouseButtonPressed == 1 || MouseHandler .clickType == 1 )
1489
- Npc .anInt3294 ++;
1492
+ MovedStatics .anInt3294 ++;
1490
1493
1491
1494
int i = 34 ;
1492
1495
if (GameInterface .gameScreenInterfaceId != -1 )
@@ -1540,7 +1543,7 @@ else if(ChatBox.dialogueId != -1)
1540
1543
int i_21_ = KeyFocusListener .resetFramesSinceKeyboardInput ();
1541
1544
if (i_20_ > 4500 && i_21_ > 4500 ) {
1542
1545
SceneCluster .idleLogout = 250 ;
1543
- MouseHandler .method650 (4000 );
1546
+ MouseHandler .setFramesSinceMouseInput (4000 );
1544
1547
OutgoingPackets .buffer .putPacket (216 );
1545
1548
}
1546
1549
@@ -1764,7 +1767,7 @@ public static void handleLoginScreenActions() {
1764
1767
if (MovedStatics .anInt2321 < 1 ) {
1765
1768
MovedStatics .anInt2321 ++;
1766
1769
if (gameServerPort == currentPort ) {
1767
- currentPort = CollisionMap . someOtherPort ;
1770
+ currentPort = someOtherPort ;
1768
1771
} else {
1769
1772
currentPort = gameServerPort ;
1770
1773
}
@@ -1778,7 +1781,7 @@ public static void handleLoginScreenActions() {
1778
1781
} catch (IOException ioexception ) {
1779
1782
if (MovedStatics .anInt2321 < 1 ) {
1780
1783
if (currentPort == gameServerPort ) {
1781
- currentPort = CollisionMap . someOtherPort ;
1784
+ currentPort = someOtherPort ;
1782
1785
} else {
1783
1786
currentPort = gameServerPort ;
1784
1787
}
@@ -1791,11 +1794,11 @@ public static void handleLoginScreenActions() {
1791
1794
}
1792
1795
1793
1796
private static void method947 (int arg0 ) {
1794
- synchronized (CollisionMap .anObject162 ) {
1795
- if ((Buffer .anInt1987 ^ 0xffffffff ) != arg0 ) {
1796
- Buffer .anInt1987 = 1 ;
1797
+ synchronized (MovedStatics .anObject162 ) {
1798
+ if ((MovedStatics .anInt1987 ^ 0xffffffff ) != arg0 ) {
1799
+ MovedStatics .anInt1987 = 1 ;
1797
1800
try {
1798
- CollisionMap .anObject162 .wait ();
1801
+ MovedStatics .anObject162 .wait ();
1799
1802
} catch (InterruptedException interruptedexception ) {
1800
1803
/* empty */
1801
1804
}
@@ -1914,8 +1917,8 @@ public static void method910() {
1914
1917
if (true ) {
1915
1918
if (VertexNormal .lowMemory && MovedStatics .onBuildTimePlane != Player .worldLevel )
1916
1919
Landscape .method789 (Player .localPlayer .pathY [0 ], MovedStatics .regionY , MovedStatics .regionX , Player .localPlayer .pathX [0 ], Player .worldLevel );
1917
- else if (Buffer .anInt1985 != Player .worldLevel ) {
1918
- Buffer .anInt1985 = Player .worldLevel ;
1920
+ else if (MovedStatics .anInt1985 != Player .worldLevel ) {
1921
+ MovedStatics .anInt1985 = Player .worldLevel ;
1919
1922
Minimap .method299 (Player .worldLevel );
1920
1923
}
1921
1924
}
@@ -2119,7 +2122,7 @@ public void method35(int arg1) {
2119
2122
if (currentPort != gameServerPort )
2120
2123
currentPort = gameServerPort ;
2121
2124
else
2122
- currentPort = CollisionMap . someOtherPort ;
2125
+ currentPort = someOtherPort ;
2123
2126
updateServerSocket = null ;
2124
2127
updateServerSignlinkNode = null ;
2125
2128
anInt292 ++;
@@ -2155,10 +2158,10 @@ public void processGameLoop() {
2155
2158
MouseHandler .method1015 ();
2156
2159
2157
2160
if (gameStatusCode == 0 ) {
2158
- InteractiveObjectTemporary .startup ();
2161
+ MovedStatics .startup ();
2159
2162
method992 ();
2160
2163
} else if (gameStatusCode == 5 ) {
2161
- InteractiveObjectTemporary .startup ();
2164
+ MovedStatics .startup ();
2162
2165
method992 ();
2163
2166
} else if (gameStatusCode == 10 ) {
2164
2167
Class60 .updateLogin ();
@@ -2226,7 +2229,7 @@ else if (gameStatusCode == 5) {
2226
2229
method164 ();
2227
2230
} else if (gameStatusCode == 40 )
2228
2231
MovedStatics .method940 (English .connectionLost , false , English .pleaseWaitAttemptingToReestablish );
2229
- Npc .anInt3294 = 0 ;
2232
+ MovedStatics .anInt3294 = 0 ;
2230
2233
}
2231
2234
2232
2235
public void connectUpdateServer () {
@@ -2352,7 +2355,7 @@ public void close() {
2352
2355
2353
2356
public void startup () {
2354
2357
// Define ports
2355
- CollisionMap . someOtherPort = modewhere == 0 ? 443 : 50000 + Player .worldId ;
2358
+ someOtherPort = modewhere == 0 ? 443 : 50000 + Player .worldId ;
2356
2359
gameServerPort = modewhere != 0 ? Player .worldId + 40000 : Configuration .GAME_PORT ;
2357
2360
currentPort = gameServerPort ;
2358
2361
0 commit comments