Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • SuperNativeZ: 2009SCAPE - Perfect Realistic Emulation. Play Runescape like it was in 2009. [link]
      February 18, 2020, 01:04:45 PM
    • SuperNativeZ: 2009SCAPE - Perfect Realistic Emulation. Play Runescape like it was in 2009. [link]
      February 18, 2020, 01:04:39 PM
    • SuperNativeZ: 2009SCAPE - Perfect Realistic Emulation. Play Runescape like it was in 2009. [link]
      February 18, 2020, 01:04:35 PM
    • ragnoroker: Join RuneGuild Today! BIG DROP PARTY IN 1 HOUR JOIN NOW - Newish Server 30+ Online all the time - Very Unique - Play now : [link]
      February 15, 2020, 04:16:38 PM
    • ragnoroker: Join RuneGuild Today! BIG DROP PARTY IN 1 HOUR JOIN NOW - Discord : [link]
      February 15, 2020, 04:15:41 PM
    • ragnoroker: Join RuneGuild Today! BIG DROP PARTY IN 1 HOUR JOIN NOW :) - [link]
      February 15, 2020, 04:14:50 PM
    • friendlyhelper: Meet up with old and new friends and explore what Runescape Classic could have been had development continued [link]
      February 15, 2020, 03:55:17 PM
    • friendlyhelper: Meet up with old and new friends and explore what Runescape Classic could have been had development continued [link]
      February 15, 2020, 03:49:34 PM
    • friendlyhelper: After well over 6 years of continuous runtime, RSCR still most actively developed RSC server  [link]
      February 15, 2020, 03:49:29 PM
    • SnowRSPS: Checkout Snowrsps.com - Snow317.org - Snowscape.net Open 24.7 [link] !Do not join Galaxy!
      February 15, 2020, 08:15:39 AM
    • SnowRSPS: Checkout Snowrsps.com - Snow317.org - Snowscape.net Open 24.7 [link] !Do not join Galaxy!
      February 15, 2020, 08:15:32 AM
    • SuperNativeZ: GALAXY #1 UNIQUE CUSTOM RSPS [link][link]
      February 14, 2020, 12:27:16 PM
    • SuperNativeZ: GALAXY #1 UNIQUE CUSTOM RSPS [link][link]
      February 14, 2020, 12:27:11 PM
    • SuperNativeZ: GALAXY #1 UNIQUE CUSTOM RSPS [link][link]
      February 14, 2020, 12:27:00 PM
    • ragnoroker: Looking for a new server? Join RuneGuild : [link] You won't be disappointed.
      February 14, 2020, 07:49:42 AM
    • ragnoroker: Looking for a new server? Join RuneGuild : [link] You won't be disappointed.
      February 14, 2020, 07:49:37 AM
    • ragnoroker: Looking for a new server? Join RuneGuild : [link] You won't be disappointed.
      February 14, 2020, 07:49:33 AM
    • Tonystark2830: https: //discord .gg /AHeVSMQ
      February 13, 2020, 11:35:21 AM
    • Tonystark2830:[link]
      February 13, 2020, 11:35:06 AM
    • Tonystark2830:[link] who ever has the most invites will be given money weekly! whats the catch? you must have over 15 invites for the week!  if you are tied with someone else at the end of the week you will both be awarded the same amount "no it will not be split"
      February 13, 2020, 11:34:42 AM

    Author Topic: [194 and 317 compared] Refactored "buildMenuForPlayer" method  (Read 631 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Pretty interesting to see the changes between the 194 client and the 317 client.

    194
    Code: Java
    1.         publicfinalvoid buildMenuForPlayer(Player targetPlayer, int data1,
    2.                         int data2, int data3){
    3.                 if(targetPlayer != localPlayer
    4.                                 && menuActionRow <400){
    5.                         String targetPlayerDisplayName =(targetPlayer.name
    6.                                         + getCombatLevelDifferenceColour(targetPlayer.combatLevel,
    7.                                                         localPlayer.combatLevel)
    8.                                         +" (level-"+ targetPlayer.combatLevel+")");
    9.                         if(itemSelected ==1){
    10.                                 menuActionName[menuActionRow]="Use "+ selectedItemName +" with @[email protected]"
    11.                                                 + targetPlayerDisplayName;
    12.                                 menuActionId[menuActionRow]=636;
    13.                                 menuActionData1[menuActionRow]= data1;
    14.                                 menuActionData2[menuActionRow]= data2;
    15.                                 menuActionData3[menuActionRow]= data3;
    16.                                 menuActionRow++;
    17.                         }elseif(spellSelected ==1){
    18.                                 if((selectedSpellUsability & 0x8)==8){
    19.                                         menuActionName[menuActionRow]= selectedSpellTooltip +" @[email protected]"+ targetPlayerDisplayName;
    20.                                         menuActionId[menuActionRow]=730;
    21.                                         menuActionData1[menuActionRow]= data1;
    22.                                         menuActionData2[menuActionRow]= data2;
    23.                                         menuActionData3[menuActionRow]= data3;
    24.                                         menuActionRow++;
    25.                                 }
    26.                         }else{
    27.                                 menuActionName[menuActionRow]="Trade with @[email protected]"+ targetPlayerDisplayName;
    28.                                 menuActionId[menuActionRow]=1682;
    29.                                 menuActionData1[menuActionRow]= data1;
    30.                                 menuActionData2[menuActionRow]= data2;
    31.                                 menuActionData3[menuActionRow]= data3;
    32.                                 menuActionRow++;
    33.                                 menuActionName[menuActionRow]="Follow @[email protected]"+ targetPlayerDisplayName;
    34.                                 menuActionId[menuActionRow]=1930;
    35.                                 menuActionData1[menuActionRow]= data1;
    36.                                 menuActionData2[menuActionRow]= data2;
    37.                                 menuActionData3[menuActionRow]= data3;
    38.                                 menuActionRow++;
    39.                                 if(wildernessLevel >0){
    40.                                         menuActionName[menuActionRow]="Attack @[email protected]"+ targetPlayerDisplayName;
    41.                                         menuActionId[menuActionRow]=1754;
    42.                                         menuActionData1[menuActionRow]= data1;
    43.                                         menuActionData2[menuActionRow]= data2;
    44.                                         menuActionData3[menuActionRow]= data3;
    45.                                         menuActionRow++;
    46.                                 }
    47.                         }
    48.                 }
    49.         }

    317
    Code: Java
    1.         privatevoid buildMenuForPlayer(Player targetPlayer, int data1, int data2,
    2.                         int data3){
    3.                 if(targetPlayer == localPlayer)
    4.                         return;
    5.                 if(menuActionRow >=400)
    6.                         return;
    7.                 String targetPlayerDisplayName;
    8.                 if(targetPlayer.skill==0)
    9.                         targetPlayerDisplayName = targetPlayer.name
    10.                                         + getCombatLevelDifferenceColour(localPlayer.combatLevel,
    11.                                                         targetPlayer.combatLevel)+" (level-"
    12.                                         + targetPlayer.combatLevel+")";
    13.                 else
    14.                         targetPlayerDisplayName = targetPlayer.name+" (skill-"+ targetPlayer.skill+")";
    15.                 if(itemSelected ==1){
    16.                         menuActionName[menuActionRow]="Use "+ selectedItemName
    17.                                         +" with @[email protected]"+ targetPlayerDisplayName;
    18.                         menuActionId[menuActionRow]=491;
    19.                         menuActionData1[menuActionRow]= data1;
    20.                         menuActionData2[menuActionRow]= data2;
    21.                         menuActionData3[menuActionRow]= data3;
    22.                         menuActionRow++;
    23.                 }elseif(spellSelected ==1){
    24.                         if((selectedSpellUsability &8)==8){
    25.                                 menuActionName[menuActionRow]= selectedSpellTooltip +" @[email protected]"
    26.                                                 + targetPlayerDisplayName;
    27.                                 menuActionId[menuActionRow]=365;
    28.                                 menuActionData1[menuActionRow]= data1;
    29.                                 menuActionData2[menuActionRow]= data2;
    30.                                 menuActionData3[menuActionRow]= data3;
    31.                                 menuActionRow++;
    32.                         }
    33.                 }else{
    34.                         for(int a =4; a >=0; a--)
    35.                                 if(playerActionNames[a]!=null){
    36.                                         menuActionName[menuActionRow]= playerActionNames[a]
    37.                                                         +" @[email protected]"+ targetPlayerDisplayName;
    38.                                         int modifier =0;
    39.                                         if(playerActionNames[a].equalsIgnoreCase("attack")){
    40.                                                 if(targetPlayer.combatLevel> localPlayer.combatLevel)
    41.                                                         modifier =2000;
    42.                                                 if(localPlayer.team!=0&& targetPlayer.team!=0)
    43.                                                         if(localPlayer.team== targetPlayer.team)
    44.                                                                 modifier =2000;
    45.                                                         else
    46.                                                                 modifier =0;
    47.                                         }elseif(playerActionNotAtTop[a])
    48.                                                 modifier =2000;
    49.                                         if(a ==0)
    50.                                                 menuActionId[menuActionRow]=561+ modifier;
    51.                                         if(a ==1)
    52.                                                 menuActionId[menuActionRow]=779+ modifier;
    53.                                         if(a ==2)
    54.                                                 menuActionId[menuActionRow]=27+ modifier;
    55.                                         if(a ==3)
    56.                                                 menuActionId[menuActionRow]=577+ modifier;
    57.                                         if(a ==4)
    58.                                                 menuActionId[menuActionRow]=729+ modifier;
    59.                                         menuActionData1[menuActionRow]= data1;
    60.                                         menuActionData2[menuActionRow]= data2;
    61.                                         menuActionData3[menuActionRow]= data3;
    62.                                         menuActionRow++;
    63.                                 }
    64.  
    65.                 }
    66.                 for(int a =0; a < menuActionRow; a++){
    67.                         if(menuActionId[a]==516){
    68.                                 menuActionName[a]="Walk here @[email protected]"+ targetPlayerDisplayName;
    69.                                 return;
    70.                         }
    71.                 }
    72.         }

    All dummies have been removed from both versions.
    Runescape Gambling

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: [194 and 317 compared] Refactored "buildMenuForPlayer" method
    « Reply #1 on: November 04, 2014, 01:45:20 PM »
    Lol between 194 and 317 they decided that the wilderness wouldn't be the only area you could have pvp.

    So did the wildernessLevel just become a dummy between 194 and 317 or what?

    OfflineRyley

    • Member
    • ****
    • *
    • Posts: 7,315
    • Thanks: +0/-0
      • View Profile
    Re: [194 and 317 compared] Refactored "buildMenuForPlayer" method
    « Reply #2 on: November 05, 2014, 09:54:20 PM »
    Lol between 194 and 317 they decided that the wilderness wouldn't be the only area you could have pvp.

    So did the wildernessLevel just become a dummy between 194 and 317 or what?

    No, they relied on the client to determine the actions a player had on right-click. In modern servers we send a frame with the option and position, which gave them more control over what actions were displayed (assuming there were more than trade, follow and attack by the time 317 was around)

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal