Thread: ZRS3 Reborn

Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1 ZRS3 Reborn 
    Member ZRS3 Reborn Market Banned

    James™'s Avatar
    Join Date
    Nov 2007
    Age
    29
    Posts
    2,467
    Thanks given
    280
    Thanks received
    298
    Rep Power
    497



    ZRS3 is a RuneScape 3 framework built with NIO-based networking events using the reactor pattern.
    ZRS3 was written from scratch by Emperor and myself, Expect to see so progress soon,
    We will most update the revision when its necessary. I.E Invention, a few other game updates coming.


    Revision: 862
    Information
    Treasure Hunter | Meteor Storm - News - RuneScape
    15 Year Anniversary Celebrations!





    • Game
      • Engine
      • Entity
        • Player
        • NPC
        • Render
      • World
        • Objects
        • Map
        • Movement
          • PathFinder
    • NIO-Networking
      • Event Producer
        • Ondemand
        • Handshake
        • Login
        • Game
      • IO-Event Handling
        • Write Events
          • Completed count: 6
          • In-progress count: 2
        • Read Events
          • Item Interactions
          • NPC Interactions
          • Object Interactions
    • LoginServer

    Note: Content will be listed when we have completed every packet completed.

    Media


    Example of code

    Code:
    package org.avior.network;
    
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.ServerSocketChannel;
    import java.util.Iterator;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    
    /**
     * Handles (NIO-based) networking events using the reactor pattern.
     * @author Emperor
     */
    public final class NioNetwork implements Runnable {
    	
    	/**
    	 * The executor service.
    	 */
    	private final ExecutorService service;
    
    	/**
    	 * The selector
    	 */
    	private Selector selector;
    	
    	/**
    	 * The socket channel.
    	 */
    	private ServerSocketChannel channel;
    	
    	/**
    	 * The I/O event handling instance.
    	 */
    	private final IoEventHandler eventHandler;
    	
    	/**
    	 * If the reactor is running.
    	 */
    	private boolean running;
    	
    	/**
    	 * Constructs a new {@code NioReactor}.
    	 * @param poolSize The pool size.
    	 */
    	private NioNetwork(int poolSize) {
    		this.service = Executors.newSingleThreadScheduledExecutor();
    		this.eventHandler = new IoEventHandler(Executors.newFixedThreadPool(poolSize));
    	}
    	
    	/**
    	 * Creates and configures a new {@code NioReactor} with a pool size of 1.
    	 * @param port The port.
    	 * @return The {@code NioReactor} {@code Object}.
    	 * @throws IOException When an I/O exception occurs.
    	 */
    	public static NioNetwork configure(int port) throws IOException {
    		return configure(port, 1);
    	}
    
    	/**
    	 * Creates and configures a new {@code NioReactor}.
    	 * @param port The port.
    	 * @param poolSize The amount of threads in the thread pool.
    	 * @return The {@code NioReactor} {@code Object}.
    	 * @throws IOException When an I/O exception occurs.
    	 */
    	public static NioNetwork configure(int port, int poolSize) throws IOException {
    		NioNetwork reactor = new NioNetwork(poolSize);
    		reactor.channel = ServerSocketChannel.open();
    		reactor.selector = Selector.open();
    		reactor.channel.bind(new InetSocketAddress(port));
    		reactor.channel.configureBlocking(false);
    		reactor.channel.register(reactor.selector, SelectionKey.OP_ACCEPT);
    		System.out.println("Server hosted on channel: " + reactor.channel.getLocalAddress());
    		return reactor;
    	}
    	
    	/**
    	 * Starts the reactor.
    	 */
    	public void start() {
    		running = true;
    		service.execute(this);
    	}
    	
    	@Override
    	public void run() {
    		while (running) {
    			try {
    				selector.select();
    			} catch (IOException e) {
    				e.printStackTrace();
    			}
    			Iterator<SelectionKey> iterator = selector.selectedKeys().iterator();
    			while (iterator.hasNext()) {
    				SelectionKey key = iterator.next();
    				iterator.remove();
    				if (!key.isValid()) {
    					key.cancel();
    					continue;
    				}
    				try {
    					if (key.isAcceptable()) {
    						eventHandler.accept(key, selector);
    					}
    					if (key.isReadable()) {
    						eventHandler.read(key);
    					}
    					else if (key.isWritable()) {
    						eventHandler.write(key);
    					}
    				} catch (Throwable t) {
    					eventHandler.disconnect(key, t);
    				}
    			}
    		}
    	}
    	
    	/**
    	 * Terminates the reactor (once it's done processing current I/O events).
    	 */
    	public void terminate() {
    		running = false;
    	}
    	
    }
    Code:
    package org.avior.network.packet.exec.modules;
    
    import org.avior.game.entity.player.Player;
    import org.avior.game.world.SceneGraph;
    import org.avior.network.packet.IoBuffer;
    import org.avior.network.packet.PacketHeader;
    import org.avior.network.packet.exec.WritablePacket;
    
    /**
     * @author James
     */
    public class SceneGraphPacket implements WritablePacket<SceneGraph> {
    	
    	@Override
    	public IoBuffer write(Player player, SceneGraph sceneGraph) {
    		IoBuffer buffer = new IoBuffer(77, PacketHeader.SHORT);
    		if (sceneGraph.isSendGPI()) {
    			sceneGraph.loadGlobalPlayers(buffer);
    			sceneGraph.setSendGPI(false);
    		}
    		buffer.putS(0);
    		buffer.put(9);
    		buffer.putShort(player.getLocation().getChunkY());
    		buffer.putLEShortA(player.getLocation().getChunkX());
    		buffer.putC(1);
    		return buffer;
    	}
    }
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Registered Member
    Actuvas's Avatar
    Join Date
    May 2013
    Age
    26
    Posts
    1,275
    Thanks given
    91
    Thanks received
    250
    Rep Power
    603
    Good luck James
    Reply With Quote  
     

  4. #3  
    Donator

    Join Date
    Feb 2013
    Age
    24
    Posts
    137
    Thanks given
    41
    Thanks received
    21
    Rep Power
    20
    Wow was instantly attracted by the thread layout...good luck man!
    Attached image
    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    Jan 2016
    Posts
    6
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    James, you mean Invention right? rofl.
    Not - Intention which means:
    the thing that you plan to do or achieve : an aim or purpose
    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    Registered Member

    Join Date
    Feb 2013
    Posts
    1,682
    Thanks given
    401
    Thanks received
    402
    Rep Power
    446
    Will follow like I did for Avior and Zrs3
    good luck James
    Reply With Quote  
     

  8. #6  
    Member ZRS3 Reborn Market Banned

    James™'s Avatar
    Join Date
    Nov 2007
    Age
    29
    Posts
    2,467
    Thanks given
    280
    Thanks received
    298
    Rep Power
    497


    Having some fun with the client
    also login is completed player updating and npc updating completed
    Reply With Quote  
     

  9. Thankful user:


  10. #7  
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    27
    Posts
    1,457
    Thanks given
    248
    Thanks received
    187
    Rep Power
    578
    Really nice, this project will go far I smell it!
    Reply With Quote  
     

  11. #8  
    Member ZRS3 Reborn Market Banned

    James™'s Avatar
    Join Date
    Nov 2007
    Age
    29
    Posts
    2,467
    Thanks given
    280
    Thanks received
    298
    Rep Power
    497
    I really want to find a few people who actually wanna learn, people that have self morals and respect other people and their different opinions, knowledge level and willing to teach someone help the other person doesnt understand well.

    I want a team about 5 Including emperor and myself, By February/March you will be able to convert our from one revision to another.
    This stuff includes
    • Packet indentifcation
    • Writing the packets server side
    • able to located what you need, i.e dumps from rs, classes ect


    An all around helping each-other server.
    Reply With Quote  
     

  12. Thankful user:


  13. #9  
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    27
    Posts
    1,457
    Thanks given
    248
    Thanks received
    187
    Rep Power
    578
    Quote Originally Posted by James™ View Post
    I really want to find a few people who actually wanna learn, people that have self morals and respect other people and their different opinions, knowledge level and willing to teach someone help the other person doesnt understand well.

    I want a team about 5 Including emperor and myself, By February/March you will be able to convert our from one revision to another.
    This stuff includes
    • Packet indentifcation
    • Writing the packets server side
    • able to located what you need, i.e dumps from rs, classes ect


    An all around helping each-other server.
    I am really interested in this, I've never done that before, this could help me a lot
    Reply With Quote  
     

  14. #10  
    Extreme Donator


    Join Date
    Jul 2009
    Age
    27
    Posts
    4,351
    Thanks given
    826
    Thanks received
    1,239
    Rep Power
    1781
    "NioNetwork.java" I'd reconsider a more logical name.. Also I'm going to assume you're using the packet read/write system I made, if so I'd like credits.

    OT: Good luck.
    Reply With Quote  
     

  15. Thankful users:


Page 1 of 3 123 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. Project eclipse UTX REBORN
    By T-Sex in forum Downloads
    Replies: 6
    Last Post: 07-26-2008, 09:24 PM
  2. Super-pkz REBORN
    By rsrulesfff in forum RS2 Server
    Replies: 10
    Last Post: 07-14-2008, 03:56 AM
  3. Dodian Reborn
    By Diljot in forum Downloads
    Replies: 23
    Last Post: 07-06-2008, 02:00 AM
  4. Elionscape reborn, Open for beta.
    By Jukk in forum RS2 Server
    Replies: 18
    Last Post: 11-17-2007, 01:58 AM
  5. Lonelyisle Reborn
    By SandyBridge in forum RS2 Server
    Replies: 0
    Last Post: 09-07-2007, 03:14 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
  •