Mopar Weekly (#5)

[size=24pt]News (for the week 29/06/2015)[/size]

[size=18pt]General Discussion[/size]

[size=14pt]US Same-Sex Marriage Legal Nationwide (by Rodgerwilco)[/size]
In recent news, the U.S. federal government decided to legalise same-sex marriage throughout! Make sure you contribute to the discussion we have been having at some point.
Some feel like it’s a decision that should not have been taken by the federal government but rather on a state-by-state basis.

[hr]

[size=18pt]Game Development[/size]

[size=14pt]Blackwake (by Frell)[/size]
Frell has been working on his game for a while now and implied in a post that it should be included in the news, so why not! His thread gets updated often so make sure you keep up if you aren’t already. His game is a pirate PVP multiplayer, one with ship battle and weapon physics - it sums up to some really entertaining and unique gameplay.

[hr]

[size=18pt]Server and Client Development Showoff[/size]

[size=14pt]Mopar - Emulation Framework (by sini)[/size]
Sini has been working on a separate official server from David for a while which you might have caught a glimpse of on the last member feature.
He has done enough to be able to show off the code now. Make sure you check out the design because it seems to show some promise and sini is definitely proud of it! He has recently finished up the cache updating and thus a cache library which you can find on github.

[size=14pt]Skarred Lands (by sk8rdude461)[/size]
Sk8rdude has been making consistent progress on his server for months now, so it’s definitely worth a mention. He suggested that it was far off a beta stage however he has plenty of updates to read through.

[hr]

[size=18pt]Web Design/Development[/size]

[size=14pt]An Introduction to PHP (by EcoPS GM)[/size]
Wow a full tutorial! It’s still being redesigned but Eco did a wonderful job on the basics to PHP. This is definitely recommended to new programmers who want to dabble in a bit of server-sided stuff. It’s quite thorough and easy to follow.

[size=14pt]Extending JavaScript using sweet.js (by justaguy)[/size]
Never fear it’s here!! Make sure you check out the syntactical “sugar” of sweet.js shown off by justaguy! It makes your stay with JS much more pleasant :wink:

[hr]

[size=18pt]Senior Member Feature - t4[/size]
This week we have managed to get a hold of t4 - a competent veteran programmer among our ranks.

Initiating dialogue like a true autist using secure TLS handshake

ur being drafted for the moparscape news ~~~ ~~~ ok

The “before” MoparScape?
I hung out on SwiftIRC with a few RuneScape clans, this was back in 2005 or so. Around that time i got slightly bored of the grind and felt like cheating.
I remember trying different software like SCAR and some other bad color detection bots. That didn’t work out too well. After a while I gave up and found private servers, I lurked MoparScape and other related forums and eventually got my own going.
At that point I started to learn Java already haven worked with children’s languages like QBASIC. Then around (I think) 2008 I decided to register on MITB. Hence me being here now!

What was the appeal of RuneScape to you? It was clearly powerful enough to motivate you to learn to program.
A lot of my friends at school used to play and we would compete against each other for wealth and stats. I was probably one of the last to abandon ship because I got the farthest.
I played from about 2003 to 2011 or so with large breaks between. Near the end it was just me proving to myself I could accomplish the prestige (and by that time I had written custom private bots with some help).
It was a curiosity that fuelled my endeavors of how far could I push by the botting method before getting banned. The game became more about botting than playing the game. A meta-game if you will.

What were the first things you did on MoparScape?
If I recall I mostly talked in the debate, general and operating systems child boards of MITB. I wasn’t as competent a programmer as I am now and I knew I would get my ass wrecked by some of the older members.
I tried starting a MITB linux group (LUG). I was very fond of learning about linux and systems engineering stuff back then.

How did you end up on IRC?
I jumped on IRC around the time I registered on the forums, it seemed like the best way to become a part of the MITB community.

What are you known for in MoparScape now?
Don’t know really, most people probably think I’m an asshole. To answer the question more directly, probably my posts in the general programming child board. I’d post more, but the forum has been a little dead in those sections. :frowning: . I’d love to see those sections turn into a stackoverflow.

What kind of work have you done regarding RSPS (public or private)? I know you had documented some of the 377 protocol, etc.
I’ve written a few server bases in the past and was a big fan of using Netty for Java. I’ve written some basic proof of concept C servers, but never bothered releasing any.
The only thing that saw the light of day that has any sort of impact is my work documenting the 377 protocol (one of my favorite revisions). An older member, whom I’m not sure wants to be mention, was kind enough to supply me with a near completely refactored 377 client.
I also recall writing a deobfuscator for J-Shrink (lol). It was always fun running that on the shitty Java botnets kids used to distribute here.

Could you elaborate on your programming prowess, since you haven’t displayed it too much on the forums?
I’ve been programming in Java for a long time and as I already mentioned had an early start with procedural languages. Shortly after Java I picked up on Python, C, and C++ and around that time enrolled in a Computer Science program at university.
Since then I have completed the degree. Over the years I have seen many different technologies, languages, and paradigms that I can’t even begin to list. Some academic favorites include Haskell, x86 and MIPS assembly, algorithms, and operating systems design.
I’ve also held many internships positions at various international companies. I am currently employed full time post-graduation on a research and development team.
I specialize mostly with C and C++ programming on Linux platforms and am known to be anal about code correctness, documentation, and optimization.
If you are interesting in picking up C and C++ the right way, I highly recommend reading K&R C and Effective C++.

How is your personal life going, you mentioned you got a degree recently? etc
Great, I’ve got my own place, a few cars, great entertainment system that spans the whole house, etc. I love work.
I love the people there and the stuff I am able to work on (a lot of super scalale C++ server software that span many nodes and is able to eat hexa-core CPUs and hundreds of gigabytes of memory). I also love the benefits of being a software engineer.

May you expand on these benefits? Surely that includes playboy bunnies?
Comfortable work environment, freedom to go out to lunch, to come in/leave when I want, to take off when I want, and of course the pay. The stipulation is of course you need to deliver

What is your advice to newcomers, particularly those who want to learn how to code?
Don’t try learning from RSPS. It’s okay for it to spark your interest, but I suggest learning software architecting and a language before you sit down and go for the gold.
There is a lot involved in creating scalable, efficient, and readable software. Hacking the client doesn’t lend itself to the aforementioned pitfall, so I’d recommend checking that out. There’s a lot to learn there and you just might spark interest in other members.

Do you have any advice to programmers relating specifically to RSPS? i.e. a cool design pattern you saw somewhere or a nifty library?
A trick for developing a C++ server would be using the select() system call to allow for a non-blocking accept/recv loop (meaning you can accept new player connections and read incoming data from existing players synchronously).
How select() works is it tells you when a given socket is ready. So you could pass the socket (file descriptor) to an event callback to produce a design similar to Netty.
Combine that with some sexy C++11 features like threading and atomic variables and you’re well on your way to do some asynchronous processing (like player updating, server events, etc). If you’re interested in POSIX networking I highly suggest checking out this.

You could use Protobuf to declare language independent structure that get sent over the network (packets, like one of the login blocks).
There is an official tutorial/guide provided by Google for C++, Java, and Python.

Sini has been working on a separate official server from David for a while which you might have caught on the last member feature.
It's not separate. It's the same 'project', sinisoul is just trying to create a new core for it.

t4 taking tips from me to use protobuf

I TOLD YOU ALL SO

Good idea confirmed.

Senior Member Feature should be renamed to “irc user feature”

you should interview Limits :^)

[quote=“sini, post:3, topic:552241”]t4 taking tips from me to use protobuf

I TOLD YOU ALL SO

Good idea confirmed.[/quote]I noticed how it coincided with your idea which was pretty cool.

[quote=“Davidi2, post:2, topic:552241”][quote]Sini has been working on a separate official server from David for a while which you might have caught on the last member feature.[/quote]It’s not separate. It’s the same ‘project’, sinisoul is just trying to create a new core for it.[/quote]idk seems like a whole different thing

[quote=“Davidi2, post:4, topic:552241”]Senior Member Feature should be renamed to “irc user feature”

you should interview Limits :^)[/quote]I think that most senior/interesting people are on IRC. The interesting people on the forums I imagine I cannot get a hold off (since the forum is kinda dead in that regard).

[quote=“sini, post:3, topic:552241”]t4 taking tips from me to use protobuf

I TOLD YOU ALL SO

Good idea confirmed.[/quote]
I had no idea you were using protobuf, gj

I have just updated this with some web development stuff, if you notify me regarding missing content I do take suggestions.

+1 for Scott Meyers’ C++ books.

[quote=“justaguy, post:8, topic:552241”][quote author=Pure_ link=topic=671157.msg4488291#msg4488291 date=1435701627]
and Effective C++.
[/quote]

+1 for Scott Meyers’ C++ books.[/quote]
It’s the only reason I like the language

[quote=“Davidi2, post:4, topic:552241”]Senior Member Feature should be renamed to “irc user feature”

you should interview Limits :^)[/quote]
#mopar has the real senior members

Interview me, interview me.

Describe the Donatello incident

[quote=“sini, post:12, topic:552241”][quote author=Lothy link=topic=671157.msg4488527#msg4488527 date=1435841966]
Interview me, interview me.
[/quote]

Describe the Donatello incident[/quote]
Maybe when I give my interview answers!

ok

idk if ppl read this shit but

A trick for developing a C++ server would be using the select() system call to allow for a non-blocking accept/recv loop (meaning you can accept new player connections and read incoming data from existing players synchronously). How select() works is it tells you when a given socket is ready. So you could pass the socket (file descriptor) to an event callback to produce a design similar to Netty.

select() scaling is poor, most C/C++ networking libs use it as a fall back if more sophisticated mechanisms do not exist (e.g. epoll() on l00nix, IOCP for win). i like libuv (https://github.com/libuv/libuv) as a “portable” wrapper for all that shit and wish that it had existed when i cared about rsps

[quote=“s1gma, post:15, topic:552241”]idk if ppl read this shit but

[quote]A trick for developing a C++ server would be using the select() system call to allow for a non-blocking accept/recv loop (meaning you can accept new player connections and read incoming data from existing players synchronously).
How select() works is it tells you when a given socket is ready. So you could pass the socket (file descriptor) to an event callback to produce a design similar to Netty.[/quote]

select() scaling is poor, most C/C++ networking libs use it as a fall back if more sophisticated mechanisms do not exist (e.g. epoll() on l00nix, IOCP for win). i like libuv (https://github.com/libuv/libuv) as a “portable” wrapper for all that shit and wish that it had existed when i cared about rsps[/quote]
you’re completely correct. select is kind of bad because you must do an o(n) operation to scan through the file descriptors everytime an event is ready. however, select is much easier to use and a good starting place for moparscapers. besides, runescape is hard bound at 2k players afaik… good luck getting that many people on a rsps in 2015.

[quote=“t4, post:16, topic:552241”][quote author=s1gma link=topic=671157.msg4493861#msg4493861 date=1440202253]
idk if ppl read this shit but

[quote]A trick for developing a C++ server would be using the select() system call to allow for a non-blocking accept/recv loop (meaning you can accept new player connections and read incoming data from existing players synchronously).
How select() works is it tells you when a given socket is ready. So you could pass the socket (file descriptor) to an event callback to produce a design similar to Netty.[/quote]

select() scaling is poor, most C/C++ networking libs use it as a fall back if more sophisticated mechanisms do not exist (e.g. epoll() on l00nix, IOCP for win). i like libuv (https://github.com/libuv/libuv) as a “portable” wrapper for all that shit and wish that it had existed when i cared about rsps
[/quote]
you’re completely correct. select is kind of bad because you must do an o(n) operation to scan through the file descriptors everytime an event is ready. however, select is much easier to use and a good starting place for moparscapers. besides, runescape is hard bound at 2k players afaik… good luck getting that many people on a rsps in 2015.[/quote]
I’d recommend poll() if you want something simpler than epoll (and more portable). It’s similar to select() but fixes a few of its problems.