Contributor Hello Terasology!

Mehul Ahuja

New Member
Contributor
Name - Mehul Ahuja
From - India, doing majors in Computer Engineering(Hons. in Machine Learning and Data Analytics)
Skills/tools - Java, Android, C++, C, C#, node.js, socket.io.
Found via - Google Summer of Code
Interests - I love gaining knowledge about computers in general, and thats the sole reason I'm here. Specifically I love developing apps for Android(though it hasn't been much time), Competitive Coding, gaming, Learning different data structures and algorithms.

Extra-
I wanted to contribute to open source, but the problem is there was no one to guide me, thats why I was waiting for GSoC to help me getting a project of my choice and help me learn in a structured way. And thats when I found Terasology and the issue #929, developing an app for Mobile Server Management. To be honest, I don't know exactly what I'll have to do but I'm sure I'll do it if I get guidance from you. This is my first major open source project and I'll surely do my best to meet your standards.
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Hey @Mehul Ahuja and welcome the forum :)

Don't worry about getting started with open source projects, it's easier than you might think. Good to have your here!
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Welcome @Mehul Ahuja ! Are you by chance "Qinusty" on GitHub? That user mentioned interest on issue 929 there. Edit: Nope, just two students interested in the same topic.

Plenty of open source projects like ours will be happy to help you learn even without GSOC active :)

The mobile server management item probably will be a three part project at the moment
  1. Enhance the game server with a REST api. This will likely be by plugging in some new library - not writing it from scratch. We just need a way to expose a URL endpoint that is bound to a particular Java method inside the server. For example an endpoint you send a player name to that the server then kicks if online. Naturally we need to use some sort of authentication for that too.
  2. Probably (easier for testing) build a simple web management utility to exercise the calls to the REST api. Alternatively maybe this could just be added to the game launcher. Point is that it'll likely be easier to test this way than start on Android, and then we can use this as another management option as well, when not mobile :)
  3. Write the Android app that exercises the REST calls from a nice UI there.
Have you worked with a REST api setup before? That might be the first thing to look at some. You could even build a mock game server that's just a standard REST server setup replying with canned data to see how it works and even start triggering via web/launcher/Android.

Another thing to look at would be existing mobile management utilities, maybe there are some open source frameworks for it out there. Perhaps even to help manage headless game servers like this. Minecraft utilities and mappers could also be interesting to look at :)
 
Last edited:

Mehul Ahuja

New Member
Contributor
Thanks for the reply! @Cervator @Skaldarnar
Yeah last summer me and my friends worked on an E-commerce site and my work was to write a RESTful API in PHP using SLIM framework.
This is really interesting and has a lot of potential. I actually looked up some apps for inspiration which let you manage your linux server through an android phone.... What those apps are doing is that they let you log in to the server via SSH and access the server's command line. I hope thay there is some library out there because then the main work which'll be left to do will be giving it a nice user interface. I'll start working as soon as possible, its 5:00am here and I have an exam in 3 hours -_- .
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Excellent! But yeah sleep and exams come first :D

I'd put the quality of the actual UI near the end. First up we just need to even be able to manage a server remotely, which can start out just being an experimental/ugly setup.

Maybe one small issue to take a look at would be https://github.com/MovingBlocks/Terasology/issues/1375 - last I checked if you try to use the kick command in the console it actually crashes the game. That would be one of the natural things we'd want to have the option to manage remotely so for that it needs to work first :D

I'm not sure what is keeping the command broken, it may or may not be simple, but just figuring out where the command is and how it works would probably be a good first thing to learn.
 

Mehul Ahuja

New Member
Contributor
Hey again! @Cervator
I just wanted a little bit of explanation... I dived in the code and got familiar with the methods for the above issue (#1375). Whenever theres an activity like kicking or joining a gamer 'update()' is called. After 'update' being called in the 'NetworkSystemImpl.java', it calls a method named processPendingDisconnects(), and for each of the disconnected player this method is calling processRemovedClient(). Till this the code the code is working fine according to the logs. Now the method named 'deactivatePlayer()' is called.
My doubt is that what this method is actually doing?
If I guess, it stores the current game and removes the info of that current client. As you also said that game gets saves and after reload it works fine. BUT according to the logs processRemovedClient() is called twice. I guess may be this is why null pointer exception is there because when it calls it next time, it again calls deactivatePlayer() but this time 'client' is null.

Please tell me if I'm going wrong somewhere and what should I do ahead. I'll do my best!
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
@Mehul Ahuja as far as I can tell you're doing the correct detective work to help figure that out :)

It looks like deactivatePlayer queues the player object for final storage at the next world save which makes sense. The log snippet in the ticket might be a little out of date though, it looks like we've renamed at least one of the classes. If you have an updated log snippet / stack trace feel free to post it in the issue :)

If you see something get called twice the yes that could very well be the problem! Dig deeper, post some logs, and you're probably almost there already :)
 

Mehul Ahuja

New Member
Contributor
I'll actually have to wait until tomorrow, our college has blocked most of the gaming sites and servers so I'm not even able to compile the code :( . I'll be at home tomorrow so hopefully I'll try it tomorrow itself.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I'll actually have to wait until tomorrow, our college has blocked most of the gaming sites and servers so I'm not even able to compile the code :( . I'll be at home tomorrow so hopefully I'll try it tomorrow itself.
No problem, no rush, take your time :)
 

Mehul Ahuja

New Member
Contributor
Hey there! @Cervator
Just fixed the bug and made a pull request :) . The issue was exactly what we were discussing. But I started digging deeper and found another method which was the actual reason.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Merged and badged! Thank you :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I would look for more bugs and small enhancements for the command system and other "obvious" spots we'd want to eventually wrap external managing options around. Getting to know that code better should help :)

Checking real quick (can look some more after I sleep) I found a few that might be interesting:

Another option would be looking for a library we can use to wrap the REST API around the server when running headless, so we can issue commands to it that way :)

Alright, sleepy time! Talk more later.
 

Mehul Ahuja

New Member
Contributor
Hey ! @Cervator
I was working 1661, and used regex to return whole words rather that using the contain function but now if a user will try to search, lets suppose "fuse", it'll return 0 matches. But there are 2 fuses fuseshort and fuselong and that can be returned only when I use contain function... What do you think?
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I'm a little confused, 1661 is about placing blocks, how does the search/regex factor into that? :)

Is something wrong with the search command? Or are you trying to do auto-completion of some sort on what kind of block to place? The fuses count as non-placeable items, thus my confusion :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Oh I'm sorry, its 1619. :p
Hehe okay, that makes a difference. Although I'm still not sure where the RegEx comes in. Sorry about me being dense :)

1619 is about commands not working, but fuses are items. I thought the solution there was just having the commands in a System registered the right way. Or does it have something to do with scanning for commands?
 

Mehul Ahuja

New Member
Contributor
I really don't know how I did this but somehow I wrote the wrong issue again, I'm working on 3 issues right now and I got confused writing that, really sorry about that.
The issue 1619 is about command not working... I fixed this issue and will make a PR today.
Its issue 2174 in which the giveblock command is returning an illegalargumentexception and we need a better message. In the end you also asked is there a better way so that search command returns whole words and this is what I did using regex BUT the problem is as I stated.
If I fix this that we can easily give a better message to the user stating the correct items/blocks.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Alright, that's fine, now all the confusion is gone :D

Any better message is OK, even if it can't give full suggestions. If that's too much hassle I wouldn't worry about it :)
 

Mehul Ahuja

New Member
Contributor
Hey @Cervator !
I have sessional exams starting off Monday so I will be busy until Saturday. I thought I should convey it to you, because I made a PR recently but still I’ll try to work in between :).
 
Top