RSPS Library

The idea of this “RSPS Library” is to simplify the core and content creation of private servers as well as make it easy. and I started on this hoping that I could one day see multiple programmers using this API for their servers. Unfortunately, I don’t believe I can do this alone. I would really like other programmer’s help in getting opinions and suggestions over this entire source. I would like it if everything didn’t think I’ve gotten my hopes up on this and would really like some motivation from encouragement.

I realize I don’t have much for commenting, but I can go back and do that as I go. Any way, why not just have a look at some of the things being worked on?

[size=14pt]GitHub Repository:[/size]
https://github.com/tehnewb/Simplicity-Server-Library

https://github.com/tehnewb/RSPS-Library/tree/master/src/com/game/coordinates

lol

okay after looking at it, here is my advice

-> use Maven (scrap ./dependencies/)

-> don’t upload binary files to git (./dependencies/ , ./bin/)

-> split up your project into different modules, examples should not be in the main source code

-> know when to handle exceptions and when to throw them up in order to let the user handle them

-> the whole “module” thing, essentially just Java plugins, with the way it’s currently designed doesn’t really seem all that useful. take for example, the Event API within Bukkit

public final class MyPlayerListener implements Listener { @EventHandler public void onLogin(PlayerLoginEvent event) { // Your code here... } }

it follows a somewhat similar design to your module system but the key difference is you can forward various events to these plugins. so you can have something like

[code=java]public final class FiremakingPlugin implements Module {

public void onEvent(ItemOnItemEvent evt) {
    // handle using tinderbox on inventory logs...
}

public void onEvent(ItemOnFloorItemEvent evt) {
   // handle using tinderbox on floor logs
}

public void onEvent(ClickFloorItemEvent evt) {
   // handle right click "light" logs option
}

 ...

}[/code]

and it becomes really nice because all of the code for firemaking is in one place, all of the code for fishing is in one place, etc. etc. event-driven content is the best content

i also don’t really think module is a good name for plugins, the two words aren’t interchangeable. when someone says “module” you usually think of something much larger than a small plugin

-> you dumped the whole snakeyaml library into this instead of just adding three lines to a Maven pom.xml file? even if you don’t want to use Maven, why didn’t you just download the snakeyaml JAR?

-> this is unnecessary, just use a logging framework like log4j2

-> this is unnecessary as implementations vary greatly across different servers

-> this multithreaded action system design really isn’t ideal imo, even with fibers. dunno why anyone would want to write some super complex system when you can write a synchronous action system that runs on the game thread and uses virtually no resources. there was a small dicsussion about it on rs if you’re interested http://www.rune-server.org/runescape-development/rs2-server/projects/619478-build-103-a-2.html#post5067641

-> https://github.com/tehnewb/RSPS-Library/tree/master/src/com/core/tickable not thread safe, whoever wrote that isn’t properly synchronizing over the collection. just use ConcurrentLinkedQueue

I’m not gonna lie, I’m really glad you told me all of that. It definitely puts everything in perspective for me and allows me to evaluate my ignorance to multiple things needed in a server. Also, it is very useful :wink:

don’t get discouraged at all bro keep improving it

Alright, so certain things have been revised.

So, explaining the Module System:

[left][i]Modules are jarred projects loaded by the ModuleLoader class. They are to separate certain features from the core project so we do not implement classes that will be unwanted or changed in the future. They are not meant for specific creation of certain things. Modules are literally just class files loaded into the VM from a jar and are not Scripts.

For example, if I implement a combat system inside of the core project, I will most likely write around the core project’s files, which I don’t want. If I separate the system to a Module, then it will not effect the core and I can disconnect it from the module loader if I wish to remove or change the combat system to something entirely new.

This is aside from a script or content system, but can definitely help with it.[/i][/left]

Also, it has nothing to do with the Event System (@lare69). I had just noticed you were referring to that. Basically, we can program on multiple different projects using the core project as a referenced library, package all of those separate projects into multiple jars, and load them into the server if need be. If we had a collection of modules that are meant purely for a pk server and we wanted a pure pk server, then we would package all of the pk modules inside of the modules folder, remove all of the previous modules, and wallah! We have a pk server, but we still have our previous economy server modules waiting if we want to use them later.

I have removed the Action system and I will write a synchronized system. I have re-written the Tickable system only slightly and it’s not on the 600ms timing because I don’t necessarily believe we have to emulate that part.

[quote=“wildskiller, post:6, topic:554989”]Alright, so certain things have been revised.

So, explaining the Module System:

[left][i]Modules are jarred projects loaded by the ModuleLoader class. They are to separate certain features from the core project so we do not implement classes that will be unwanted or changed in the future. They are not meant for specific creation of certain things. Modules are literally just class files loaded into the VM from a jar and are not Scripts.

For example, if I implement a combat system inside of the core project, I will most likely write around the core project’s files, which I don’t want. If I separate the system to a Module, then it will not effect the core and I can disconnect it from the module loader if I wish to remove or change the combat system to something entirely new.

This is aside from a script or content system, but can definitely help with it.[/i][/left]

Also, it has nothing to do with the Event System (@lare69). I had just noticed you were referring to that. Basically, we can program on multiple different projects using the core project as a referenced library, package all of those separate projects into multiple jars, and load them into the server if need be. If we had a collection of modules that are meant purely for a pk server and we wanted a pure pk server, then we would package all of the pk modules inside of the modules folder, remove all of the previous modules, and wallah! We have a pk server, but we still have our previous economy server modules waiting if we want to use them later.[/quote]
that makes a lot more sense. i was under the impression otherwise because of the documentation (in it, you refer to the modules as plugins) so you should probably rewrite it to make it a bit easier to understand

[quote=“lare69, post:7, topic:554989”][quote author=wildskiller link=topic=673914.msg4505933#msg4505933 date=1458521088]
Alright, so certain things have been revised.

So, explaining the Module System:

[left][i]Modules are jarred projects loaded by the ModuleLoader class. They are to separate certain features from the core project so we do not implement classes that will be unwanted or changed in the future. They are not meant for specific creation of certain things. Modules are literally just class files loaded into the VM from a jar and are not Scripts.

For example, if I implement a combat system inside of the core project, I will most likely write around the core project’s files, which I don’t want. If I separate the system to a Module, then it will not effect the core and I can disconnect it from the module loader if I wish to remove or change the combat system to something entirely new.

This is aside from a script or content system, but can definitely help with it.[/i][/left]

Also, it has nothing to do with the Event System (@lare69). I had just noticed you were referring to that. Basically, we can program on multiple different projects using the core project as a referenced library, package all of those separate projects into multiple jars, and load them into the server if need be. If we had a collection of modules that are meant purely for a pk server and we wanted a pure pk server, then we would package all of the pk modules inside of the modules folder, remove all of the previous modules, and wallah! We have a pk server, but we still have our previous economy server modules waiting if we want to use them later.
[/quote]
that makes a lot more sense. i was under the impression otherwise because of the documentation (in it, you refer to the modules as plugins) so you should probably rewrite it to make it a bit easier to understand[/quote]
Every once in a while I’m going to scan through the source and document every undocumented piece of code. I’m really glad you took the time to give me opinion over things by the way :slight_smile:

Wow! Really amazing. But, as I’m a newbie on RSPS development, sorry for this questions.

Can we use this like a API?
Can we full compile into a single .jar and use it on my IDE?
Once running, this representates a server that a client uses to work?
Looking for your library we able to start creating scripts of a skill, for example?
For the scripts tests can we use any compatible* client? *If yes, what’s the version expected to this code?

Currently I’m getting some knowledge about these concepts. Thank for support in advance! :slight_smile:

Some parts are too verbose for what they are/do.

I had a similar idea a while back but realized there were 2 problems

  1. people won’t use it because…

  2. the microsystems of an rsps are usually based on one another. developpers cant swap one part of their code out without it undermining all the rest of the system.
    this means they have to pick between your content framework or their own. I have yet to see people use an external lib for an rsps other than for networking and parsing data to/from files

I have re-written pretty much everything. I still need to upload a lot of files that I’m re-writing and I still need to re-document and comment on everything

https://github.com/tehnewb/Simplicity-Server-Library/blob/master/src/index/IndexList.java

Really?

ayy
dont be rude
david
i
2

[quote=“Davidi2, post:12, topic:554989”]https://github.com/tehnewb/Simplicity-Server-Library/blob/master/src/index/IndexList.java

Really?[/quote]
Why is it you never explain the redundancy you find in my code? I’m more than glad to change my code based on reasonable opinions.

I haven’t documented the code enough for someone to understand, but what exactly do you think I wrote that class for? I wrote it for things like an EntityList that Graham had written a long time ago, and anything that has an index. This is probably the fastest way for a list to be searched or modified that I know of.

Find yourself a better project to be honest. Anything for Runescape is so domain specific and so niche’d that whatever you write will see little to no use anywhere.
You’ll learn more doing something else.

[quote=“Lothy, post:15, topic:554989”]Find yourself a better project to be honest. Anything for Runescape is so domain specific and so niche’d that whatever you write will see little to no use anywhere.
You’ll learn more doing something else.[/quote]
As much as I can agree that it may seem that way, what if I write this and end up having a couple of programmers releasing sources with my library used for referencing? I know it wont be much, but I believe it would be pretty neat. I’m still doing this just for fun and it’s not the only project I’m focusing on at all.

Currently, this is all you need to do to for the handshake to get to the point of login. Whether you disagree with the design or not, it is still very short code and does just fine for stability. It also supports multiple revisions ;). So doesn’t is seem like an interesting concept? If anyone doesn’t like the code I have written, then I would love it if they told me what they think is wrong or suggested a different approach.

public class ServerTest {
	public static void main(String[] args) {
		RuneScapeServer server = new RuneScapeServer(43594);
		HandshakeManager.registerEncoder(637, new HandshakeEncoder() {
			@Override
			public ByteBuf encodeUpdate() throws Exception {
				int[] data = { 56, 79325, 55568, 46770, 24563, 
						299978, 44375, 0, 4176, 3589, 109125, 
						604031, 176138, 292288, 350498, 686783, 
						18008, 20836, 16339, 1244, 8142, 743, 
						119, 699632, 932831, 3931, 2974 };
				ByteBuf buffer = Unpooled.buffer(data.length + 1);
				buffer.writeByte(0);
				for (int a : data)
					buffer.writeInt(a);
				return buffer;
			}

			@Override
			public ByteBuf encodeLogin(ByteBuf in, int state) throws Exception {
				return null;
			}

		});
		server.start();
	}
}

[quote=“wildskiller, post:14, topic:554989”][quote author=Davidi2 link=topic=673914.msg4509917#msg4509917 date=1466618967]
https://github.com/tehnewb/Simplicity-Server-Library/blob/master/src/index/IndexList.java

Really?
[/quote]
Why is it you never explain the redundancy you find in my code? I’m more than glad to change my code based on reasonable opinions.[/quote]because he knows that if he states his opinion explicitly he’ll expose his inner moron, so prefers to just make sarcastic comments to show his superiority

Look into scrum because this is horrible in all sorts of ways.

Explain?

[quote=“wildskiller, post:19, topic:554989”][quote author=my-swagger link=topic=673914.msg4509936#msg4509936 date=1466683847]
Look into scrum because this is horrible in all sorts of ways.
[/quote]
Explain?[/quote]
Development does not seem structured and it does not seem like you’re putting a lot of effort into making this good. Split tasks and take your time with each part. Perfect each section before continuing.

Did you do any predesigns or idea mapping?