Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[v83] MapleSolaxia Server Source

Joined
Aug 10, 2008
Messages
858
Reaction score
516
Well no offense to the coders or anything, I mean, I love this source.
but... "elegant way of handling commands"?

Don't think the team changed anything with the commands off the top of my head. The command system is pretty much vanilla Moople (probably as an adaption of whatever source it was based off), so nothing really unique there.
 
Experienced Elementalist
Joined
Mar 12, 2015
Messages
238
Reaction score
43
Thats what I meant, nothing special. Out of all the things he could have said they changed, he chose the one thing that they barely touched.
 
Newbie Spellweaver
Joined
Apr 10, 2012
Messages
31
Reaction score
2
Lol I took a quick look at it and I liked what I saw.
Code:
"static {
		gotomaps.put("gmmap", 180000000);
		gotomaps.put("southperry", 60000);
		gotomaps.put("amherst", 1010000);
..."
and
Code:
"private static HashMap<String, Integer> gotomaps = new HashMap<String, Integer>();

	private static String[] tips = {
		"Please only use @gm in emergencies or to report somebody.",
		"To report a bug or make a suggestion, use the forum.",
		"Please do not use @gm to ask if a GM is online.",
		"Do not ask if you can receive help, just state your issue.",
		"Do not say 'I have a bug to report', just state it.",
	};
..."

Just looks quite good and with the switch instead of the ugly if elses (my version of moople still had if elses, not sure if the current one does).

I'm sure there's much as to what I've seen right now, since I haven't really looked much into the code yet. I've seen the sql queries integrated with maplebit database/website and stuff like the previously mentioned mai's quests and the off-beginner island animation was just really surprising for me that it's all in this release. I expected much less is what I'm trying to say basically. I've been in game more than coding right now so my previous comment was more of a quick impression than an overall review.
 
Interesting...
Loyal Member
Joined
Oct 25, 2008
Messages
1,372
Reaction score
604
Lol I took a quick look at it and I liked what I saw.
Code:
"static {
		gotomaps.put("gmmap", 180000000);
		gotomaps.put("southperry", 60000);
		gotomaps.put("amherst", 1010000);
..."
and
Code:
"private static HashMap<String, Integer> gotomaps = new HashMap<String, Integer>();

	private static String[] tips = {
		"Please only use @gm in emergencies or to report somebody.",
		"To report a bug or make a suggestion, use the forum.",
		"Please do not use @gm to ask if a GM is online.",
		"Do not ask if you can receive help, just state your issue.",
		"Do not say 'I have a bug to report', just state it.",
	};
..."

Just looks quite good and with the switch instead of the ugly if elses (my version of moople still had if elses, not sure if the current one does).

I'm sure there's much as to what I've seen right now, since I haven't really looked much into the code yet. I've seen the sql queries integrated with maplebit database/website and stuff like the previously mentioned mai's quests and the off-beginner island animation was just really surprising for me that it's all in this release. I expected much less is what I'm trying to say basically. I've been in game more than coding right now so my previous comment was more of a quick impression than an overall review.

Moople is really strange. Its player and admin commands are handled via switch cases but their GM commands are else ifs. Ain't nobody got time to unify the two. Maybe you should take care of that. ;)

As for that @ goto command, I copy and pasted it from some 5-year old RZ thread until I realized how dumb it was that an entire hash map was being initialized every single time, just to be used a single time, then garbage collected, hence it was made to initialize only once.
 
Newbie Spellweaver
Joined
Apr 10, 2012
Messages
31
Reaction score
2
Moople is really strange. Its player and admin commands are handled via switch cases but their GM commands are else ifs. Ain't nobody got time to unify the two. Maybe you should take care of that. ;)

As for that @ goto command, I copy and pasted it from some 5-year old RZ thread until I realized how dumb it was that an entire hash map was being initialized every single time, just to be used a single time, then garbage collected, hence it was made to initialize only once.

I had a quick thought of making a command an object instead of a string only. The idea came to mind while playing another v83 server for inspiration. There was a starter map on which you couldn't use some standard commands (for security purposes I suppose), since it was a restricted map to only allow players lower than 50 RBs to enter. By security purposes I mean they might have a goto command which could mess the restriction up and such. Things like that could be solved by adding a boolean isAllowedInMap(mapID) or something like that.
But that's quite detailed for the stage I'm in currently. I've just gotten started (again, after a couple of years) and still setting up a linux server with a (secured) apache2 webserver.

Edit:
Chainball is quite fun lol.
 
Interesting...
Loyal Member
Joined
Oct 25, 2008
Messages
1,372
Reaction score
604
I had a quick thought of making a command an object instead of a string only. The idea came to mind while playing another v83 server for inspiration. There was a starter map on which you couldn't use some standard commands (for security purposes I suppose), since it was a restricted map to only allow players lower than 50 RBs to enter. By security purposes I mean they might have a goto command which could mess the restriction up and such. Things like that could be solved by adding a boolean isAllowedInMap(mapID) or something like that.
But that's quite detailed for the stage I'm in currently. I've just gotten started (again, after a couple of years) and still setting up a linux server with a (secured) apache2 webserver.

Edit:
Chainball is quite fun lol.

I forgot what source it was (Astral?), but it had something close to what you have in mind. They handled commands with a map where the key was the string, and the value was an object with a method that executed the command code. Some people prefer each command to have its own class, and others like it all in one file. All comes down to preference I guess.

Thanks haha :thumbup1:
 
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
I had a quick thought of making a command an object instead of a string only. The idea came to mind while playing another v83 server for inspiration. There was a starter map on which you couldn't use some standard commands (for security purposes I suppose), since it was a restricted map to only allow players lower than 50 RBs to enter. By security purposes I mean they might have a goto command which could mess the restriction up and such. Things like that could be solved by adding a boolean isAllowedInMap(mapID) or something like that.
But that's quite detailed for the stage I'm in currently. I've just gotten started (again, after a couple of years) and still setting up a linux server with a (secured) apache2 webserver.

Edit:
Chainball is quite fun lol.

abstract class Command {

string name;
string parameters;
void execute(MapleCharacter chr, String[] args);
}

class WarpCommand implements Comamnd {

return "warp"
return "[id / name] {destination}"
override void execute(MapleCharacter chr, String[] args)
{
chr.warp(int.parse(args[0]);
}
}
 
Newbie Spellweaver
Joined
Apr 10, 2012
Messages
31
Reaction score
2
I forgot what source it was (Astral?), but it had something close to what you have in mind. They handled commands with a map where the key was the string, and the value was an object with a method that executed the command code. Some people prefer each command to have its own class, and others like it all in one file. All comes down to preference I guess.

Thanks haha :thumbup1:

I was thinking something more generic. Like, every command has it's own instance of the class Command. But then again, that's far ahead for the stage I'm currently in like I mentioned before :):



abstract class Command {

string name;
string parameters;
void execute(MapleCharacter chr, String[] args);
}

class WarpCommand implements Comamnd {

return "warp"
return "[id / name] {destination}"
override void execute(MapleCharacter chr, String[] args)
{
chr.warp(int.parse(args[0]);
}
}

Well w/e let's get specific then xd. I'm improvising here, and probably overkilling on the documentation, but I'm planning to get some JavaDoc of all classes later on, so why not start right here.

Code:
public class Command {
    /**
     * Actual typed string
     */
    private String content;
    /**
     * onMap map the player is on
     */
    private Map m;
    /**
     * chr player who sent the command
     */
    private Character chr;

    /**
     * Is the command allowed to be executed?
     * [USER=850422]return[/USER] true or false depending on wether it's allowed or not
     */
    private boolean isAllowed() {
        // todo: formulas
        throw new NotImplementedException();
    }

    public Command(String content, Map m, Character chr) {
        this.content = content;
        this.m = m;
        this.chr = chr;
    }

    public void execute() {
        if (isAllowed()) {
            // todo: execution part
        }
    }

    /**
     * Basically !, @, #, etc.
     */
    public enum PrefixType {
        PLAYER,
        DONOR,
        GM,
        SUPERGM,
        ADMIN
    }
}
 
Interesting...
Loyal Member
Joined
Oct 25, 2008
Messages
1,372
Reaction score
604
I was thinking something more generic. Like, every command has it's own instance of the class Command. But then again, that's far ahead for the stage I'm currently in like I mentioned before :):





Well w/e let's get specific then xd. I'm improvising here, and probably overkilling on the documentation, but I'm planning to get some JavaDoc of all classes later on, so why not start right here.

Code:
public class Command {
    /**
     * Actual typed string
     */
    private String content;
    /**
     * onMap map the player is on
     */
    private Map m;
    /**
     * chr player who sent the command
     */
    private Character chr;

    /**
     * Is the command allowed to be executed?
     * [USER=850422]return[/USER] true or false depending on wether it's allowed or not
     */
    private boolean isAllowed() {
        // todo: formulas
        throw new NotImplementedException();
    }

    public Command(String content, Map m, Character chr) {
        this.content = content;
        this.m = m;
        this.chr = chr;
    }

    public void execute() {
        if (isAllowed()) {
            // todo: execution part
        }
    }

    /**
     * Basically !, @, #, etc.
     */
    public enum PrefixType {
        PLAYER,
        DONOR,
        GM,
        SUPERGM,
        ADMIN
    }
}

Why the separate map variable if one could just do chr.getMap()?

Also, for your idea to work at all, you're going to have to use either an abstract class or an interface. An abstract class seems like the better option here though. You won't be able to differentiate between two different commands using just a single normal Command class unless you plan on including the giant switch case/else if stuff inside "execute", which in that case I guess this would work just fine.
 
Newbie Spellweaver
Joined
Apr 10, 2012
Messages
31
Reaction score
2
Why the separate map variable if one could just do chr.getMap()?

Also, for your idea to work at all, you're going to have to use either an abstract class or an interface. An abstract class seems like the better option here though. You won't be able to differentiate between two different commands using just a single normal Command class unless you plan on including the giant switch case/else if stuff inside "execute", which in that case I guess this would work just fine.

Yeah that's what I thought of in the bus this morning ;D.
I'd have to use a seperate class for each command after all, which isn't a big problem cause it'd just have a constructor and one method overriden basically. I haven't looked in the character class too much yet so I didn't know you could get the map from there, the map parameter is useless indeed. Also one of the reasons I'm gonna have to look into the source first and clean up to my likings before adding my own features.
 
Newbie Spellweaver
Joined
Apr 10, 2012
Messages
31
Reaction score
2
This source fix the quest item reward??

Kind of hard to answer such a vague question. Try to specify what item reward would be fixed in which particular quest.
As a guess I'll try to answer the question 'Do quest item rewards work?', well yes. You can complete most quests I guess.
 
Experienced Elementalist
Joined
Aug 14, 2008
Messages
211
Reaction score
4
How can I finx the quest notification icon above the players head? I can open it but cannot click anything to accept a quest or claim a quest reward.
 
Junior Spellweaver
Joined
Mar 19, 2016
Messages
100
Reaction score
0
How can I finx the quest notification icon above the players head? I can open it but cannot click anything to accept a quest or claim a quest reward.


Uh? If have a quest icon in the players head you need code the QUESTID.JS in script/quest
whats the quest active?
 
Experienced Elementalist
Joined
Aug 14, 2008
Messages
211
Reaction score
4
The quest works perfectly, if i manually goto the npc to turn it. Just having issues with accepting / finishing quests through the light bulb above the players head
 
Newbie Spellweaver
Joined
Apr 10, 2012
Messages
31
Reaction score
2
Option one is go download a wz edited quests.wz which removes the light bulb altogether. Option two is like Dorki described I guess. For option one just Google for the file, or download it from another server on the gtop100 list.

 
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
Option one is go download a wz edited quests.wz which removes the light bulb altogether. Option two is like Dorki described I guess. For option one just Google for the file, or download it from another server on the gtop100 list.

I think you misunderstand his issue ;p. His problem is that he wants quest bulbs to exist and work properly, but whenever he tries to accept or finish a quest by clicking the bulb above his head it won't work. The only way his quests complete is by walking to the npc which is a hastle along with the fact that some quests require to be accepted by bulb and if that doesn't work then you're kinda screwed lol.

and Jeffery, I'm not really sure the issue because I have never personally worked with Quests. I would assume however, that it is either a quest handler or script error on the server-side.
 
Newbie Spellweaver
Joined
Apr 10, 2012
Messages
31
Reaction score
2
I think you misunderstand his issue ;p. His problem is that he wants quest bulbs to exist and work properly, but whenever he tries to accept or finish a quest by clicking the bulb above his head it won't work. The only way his quests complete is by walking to the npc which is a hastle along with the fact that some quests require to be accepted by bulb and if that doesn't work then you're kinda screwed lol.

and Jeffery, I'm not really sure the issue because I have never personally worked with Quests. I would assume however, that it is either a quest handler or script error on the server-side.
That's exactly what I understood lol [emoji1]. The wz edit removes the bulb kind of as a last resort. I gave it as a second option to the first one mentioned before me. The quest will still work with the wz edit, the bulb will just be gone if I understand the bulb edit correctly.

 
Experienced Elementalist
Joined
Aug 14, 2008
Messages
211
Reaction score
4
I've looked at several other sources to try to find it where I can just c/p but maybe I was looking in the wrong area? idk.

Where should I look to find it?



Ive noticed that the quest icon does work and i can accept only a few quests. How do I get it to work for the rest?
 
Back
Top