Thread: NetScape - C# Multi Rev RSPS

Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31
  1. #11  
    Registered MrClassic

    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    25
    Posts
    1,962
    Thanks given
    16,354
    Thanks received
    397
    Rep Power
    5000
    Goodluck
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. Thankful user:


  3. #12  
    number 1 sponsor

    Join Date
    Aug 2017
    Posts
    878
    Thanks given
    658
    Thanks received
    654
    Rep Power
    4691
    !!! gl
    Reply With Quote  
     

  4. Thankful users:


  5. #13  
    Mikan Fanboy



    Omar's Avatar
    Join Date
    Dec 2007
    Posts
    184
    Thanks given
    335
    Thanks received
    479
    Rep Power
    4431
    Appreciate the C# reference
    [Only registered and activated users can see links. ]

    Spoiler for aaaa:




    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. Thankful user:


  7. #14  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Age
    28
    Posts
    2,527
    Thanks given
    192
    Thanks received
    747
    Rep Power
    1315
    Best of luck with this. I had never thought of using a HashSet like you did in [Only registered and activated users can see links. ] . This is fairly different from most of the approaches to the Player Update packet that are utilized currently. Is their a specific reason why you took this approach?
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  8. Thankful user:


  9. #15  
    Registered Member
    JayArrowz's Avatar
    Join Date
    Sep 2008
    Posts
    65
    Thanks given
    57
    Thanks received
    60
    Rep Power
    353
    Quote Originally Posted by Advocatus View Post
    Best of luck with this. I had never thought of using a HashSet like you did in [Only registered and activated users can see links. ] . This is fairly different from most of the approaches to the Player Update packet that are utilized currently. Is their a specific reason why you took this approach?
    Thanks,

    This was the way it was done in Apollo, however I did check over this and the RegionCoordinates have a specific hash code:
    Code:
    		public override int GetHashCode()
    		{
    			return X << 16 | Y;
    		}
    Doing stuff like HashSet.Contains(regionCoords) is a O(1) operation due to this. Compared to a list where the worst time could be O(N) where N is the size of the list.
    Also the HashSet prevents duplicates fairly quickly as opposed to a list where you have to check every item for a duplicate O(N) again.

    If you do have any alternatives which may be better please do let me know.


    Edit also i forgot:
    Code:
    .ToHashSet()
    will create a new HashSet of the already existing one. Like a shallow copy.
    Reply With Quote  
     

  10. Thankful user:


  11. #16  
    true

    DerekH's Avatar
    Join Date
    Dec 2011
    Age
    16
    Posts
    1,186
    Thanks given
    553
    Thanks received
    259
    Rep Power
    125
    Awesome, best of luck.
    Reply With Quote  
     

  12. Thankful user:


  13. #17  
    Illustrator

    Ethan's Avatar
    Join Date
    Feb 2016
    Age
    22
    Posts
    74
    Thanks given
    7
    Thanks received
    34
    Rep Power
    118
    Woah good fucking luck with this project brother!
    Spoiler for .:

    Zombie is my bitch


    Reply With Quote  
     

  14. Thankful user:


  15. #18  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Age
    28
    Posts
    2,527
    Thanks given
    192
    Thanks received
    747
    Rep Power
    1315
    Quote Originally Posted by JayArrowz View Post
    Thanks,

    This was the way it was done in Apollo, however I did check over this and the RegionCoordinates have a specific hash code:
    Code:
    		public override int GetHashCode()
    		{
    			return X << 16 | Y;
    		}
    Doing stuff like HashSet.Contains(regionCoords) is a O(1) operation due to this. Compared to a list where the worst time could be O(N) where N is the size of the list.
    Also the HashSet prevents duplicates fairly quickly as opposed to a list where you have to check every item for a duplicate O(N) again.

    If you do have any alternatives which may be better please do let me know.


    Edit also i forgot:
    Code:
    .ToHashSet()
    will create a new HashSet of the already existing one. Like a shallow copy.
    Haha. Whoops. Checking the github, there has been quite a few changes to the [Only registered and activated users can see links. ] class

    Checking the local copy of Apollo that I had checked the other day it had

    Code:
    package org.apollo.game.sync.task;
    
    import org.apollo.game.event.impl.RegionChangeEvent;
    import org.apollo.game.model.Player;
    import org.apollo.game.model.Position;
    
    /**
     * A {@link SynchronizationTask} which does pre-synchronization work for the specified {@link Player}.
     * 
     * @author Graham
     */
    public final class PrePlayerSynchronizationTask extends SynchronizationTask {
    
    	/**
    	 * The player.
    	 */
    	private final Player player;
    
    	/**
    	 * Creates the {@link PrePlayerSynchronizationTask} for the specified player.
    	 * 
    	 * @[Only registered and activated users can see links. ] player The player.
    	 */
    	public PrePlayerSynchronizationTask(Player player) {
    		this.player = player;
    	}
    
    	/**
    	 * Checks if a region update is required.
    	 * 
    	 * @[Only registered and activated users can see links. ] {@code true} if so, {@code false} otherwise.
    	 */
    	private boolean isRegionUpdateRequired() {
    		Position current = player.getPosition();
    		Position last = player.getLastKnownRegion();
    
    		int deltaX = current.getLocalX(last);
    		int deltaY = current.getLocalY(last);
    
    		return deltaX < 16 || deltaX >= 88 || deltaY < 16 || deltaY >= 88;
    	}
    
    	@Override
    	public void run() {
    		player.getWalkingQueue().pulse();
    
    		if (player.isTeleporting()) {
    			player.resetViewingDistance();
    		}
    
    		if (!player.hasLastKnownRegion() || isRegionUpdateRequired()) {
    			player.setRegionChanged(true);
    
    			Position position = player.getPosition();
    			player.setLastKnownRegion(position);
    
    			player.send(new RegionChangeEvent(position));
    		}
    	}
    
    }
    So yeah, big difference haha.
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  16. #19  
    Registered Member
    JayArrowz's Avatar
    Join Date
    Sep 2008
    Posts
    65
    Thanks given
    57
    Thanks received
    60
    Rep Power
    353
    Yeah quite a lot of branches for apollo easy to get mixed up . I do think how I combined the pre, update and post update stuff looks ugly as f, I will be separating it properly later on.
    Reply With Quote  
     

  17. #20  
    Officially Running

    Mr Dream's Avatar
    Join Date
    Dec 2013
    Posts
    1,735
    Thanks given
    489
    Thanks received
    273
    Rep Power
    761
    wow, very very nice ill follow this
    Reply With Quote  
     

Page 2 of 4 FirstFirst 1234 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Multi-rev support for 530
    By I am Montage in forum Buying
    Replies: 0
    Last Post: 10-05-2020, 11:36 PM
  2. Replies: 9
    Last Post: 11-24-2012, 04:38 PM
  3. Replies: 16
    Last Post: 10-09-2012, 10:47 PM
  4. Making Multi Pking Zone @ revs
    By romo173 in forum Help
    Replies: 0
    Last Post: 08-03-2012, 12:04 AM
  5. Replies: 13
    Last Post: 03-08-2011, 02:32 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •