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!

Exporting data by making an API system on the server

Newbie Spellweaver
Joined
Jul 11, 2014
Messages
7
Reaction score
2
I was thinking, why not make an API system to get data outside the game directly from the server, one of the uses could be Direct Trading from a website or a phone app, instead of going in-game to trade the items you want to trade, for example, after getting an offer on a market forum sale, you could simply make a web-trade (like in Steam). On maybe giving proof to people when you are bidding. Then why not directly access the server's database? What if you want to host the website on a different host but are unwilling to open the MySQL with the game data to external access? You can make access token based and each token will be able to do only certain actions.

Maybe make the API service run as a separate process on the server and make it in a faster language instead of Java...

There would be a lot of security measures you'll have to take care of (like limiting the amount of requests per period of time to avoid overflowing). But this problem exists either way...

Hard to explain, but I think it could be really useful. Too bad I'm so lazy :D
 
Newbie Spellweaver
Joined
Apr 25, 2016
Messages
8
Reaction score
0
It can be done easily but if you want it to be secured, it would require a lot of changes to how the server get and uses data.
Most sources (all public sources actually) make a single request to the database server upon logging into an account and then once again to retrieve character data.

To reduce db overhead and response time of getting the data, it stores it in an object, now this is the tricky part.
This leaves you with an open for dupes and other undesired exploits because you manipulate a data that has already change, whenever you do this on say a website, you get your data from the Database but this data may have already changed in the game server and is still stored in an object and not applied to the database (saveToDB() function for example, not sure when exactly it is called in Odin but the server doesn't manipulate the data and save it immediately).

The reason most websites (i.e. MapleBit) tells you to log off when you vote, is because of this very issue.
Some servers change the way they load the NX amount, MaplePoints and VotePoints to being directly called from the database every time, because the performance impact is negligible (fetching data from a single row for each user, from only 4 columns or so with an average sized integer), whereas doing the same for the entire data will result in an overhead that will most definitely crash the average database in a single day (in some cases, even an hour).

This is a very interesting idea though, perhaps making this API service connect the game server, or make it a part of the game server will be wiser, because then you could manipulate the data stored in session objects directly.
 
Upvote 0
Newbie Spellweaver
Joined
Jul 11, 2014
Messages
7
Reaction score
2
It can be done easily but if you want it to be secured, it would require a lot of changes to how the server get and uses data.
Most sources (all public sources actually) make a single request to the database server upon logging into an account and then once again to retrieve character data.

To reduce db overhead and response time of getting the data, it stores it in an object, now this is the tricky part.
This leaves you with an open for dupes and other undesired exploits because you manipulate a data that has already change, whenever you do this on say a website, you get your data from the Database but this data may have already changed in the game server and is still stored in an object and not applied to the database (saveToDB() function for example, not sure when exactly it is called in Odin but the server doesn't manipulate the data and save it immediately).

The reason most websites (i.e. MapleBit) tells you to log off when you vote, is because of this very issue.
Some servers change the way they load the NX amount, MaplePoints and VotePoints to being directly called from the database every time, because the performance impact is negligible (fetching data from a single row for each user, from only 4 columns or so with an average sized integer), whereas doing the same for the entire data will result in an overhead that will most definitely crash the average database in a single day (in some cases, even an hour).

This is a very interesting idea though, perhaps making this API service connect the game server, or make it a part of the game server will be wiser, because then you could manipulate the data stored in session objects directly.

Doing what you recommended would be much harder to write in a way that every source would be able to easily integrate it... If it was in the earlier days when you had a really small community of developers... Oh wait... the community is quite dried up now lol.

If it was 5 years ago, I'd probably take initiative to make my own server and integrate it into my systems.
But nowadays I can't find any motivation to code MapleStory stuff...
 
Upvote 0
Newbie Spellweaver
Joined
Apr 25, 2016
Messages
8
Reaction score
0
Doing what you recommended would be much harder to write in a way that every source would be able to easily integrate it... If it was in the earlier days when you had a really small community of developers... Oh wait... the community is quite dried up now lol.

If it was 5 years ago, I'd probably take initiative to make my own server and integrate it into my systems.
But nowadays I can't find any motivation to code MapleStory stuff...
Lol, my point is.. if you want it to be secured, you'd need to integrate it manually with each and every source because each source is written in it's own way, without following "best practice" and coding standards, there's no universal implementation in this case because each source is different from the other in the parts that such a service would need to interact with.
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
Lol, my point is.. if you want it to be secured, you'd need to integrate it manually with each and every source because each source is written in it's own way, without following "best practice" and coding standards, there's no universal implementation in this case because each source is different from the other in the parts that such a service would need to interact with.

Actually, I'm not sure if you're referring to MapleStory emulator sources here or not, but if you are, no source here is written "in it's own way". Every public MapleStory Java Emulator follows OdinMS structure (the networking libraries, the database libraries, the base in general). The only difference is the removal of RMI in sources like MoopleDEV and Lithium, but otherwise it is just new add-ons like Cash Shop and handlers for new class skills. Other than that, every source in the MapleStory section here would follow the same implementation for the most part. Yes, you'd need to configure everything differently. I agree also with the DB exploiting, happens all the time! Voting systems that people use are done poorly, hence why vote exploiting is so easy to do.

@OP An API for the server seems kind of useless for those things and for only one server. I guess personally I don't see online marketing and trading like your example as a feature worth implementing an API for. However, maybe if you had a network full of servers and you were to trade items from one server to another or handle voting and other things like that, then I would see it to be a nifty feature to work on and implement.

Oh, and as for voting, there's so many better ways it could be handled in general. It is just popularly used on websites because that's how it started as. Nobody else differs with it, they just stay that way. People still don't utilize things like GTOP's incentive voting system either, so anyone at any time can just click 'vote!' and not bother with the captcha for GTOP; they'll still get their points.
 
Upvote 0
Newbie Spellweaver
Joined
Apr 25, 2016
Messages
8
Reaction score
0
Actually, I'm not sure if you're referring to MapleStory emulator sources here or not, but if you are, no source here is written "in it's own way". Every public MapleStory Java Emulator follows OdinMS structure (the networking libraries, the database libraries, the base in general). The only difference is the removal of RMI in sources like MoopleDEV and Lithium, but otherwise it is just new add-ons like Cash Shop and handlers for new class skills. Other than that, every source in the MapleStory section here would follow the same implementation for the most part. Yes, you'd need to configure everything differently. I agree also with the DB exploiting, happens all the time! Voting systems that people use are done poorly, hence why vote exploiting is so easy to do.

@OP An API for the server seems kind of useless for those things and for only one server. I guess personally I don't see online marketing and trading like your example as a feature worth implementing an API for. However, maybe if you had a network full of servers and you were to trade items from one server to another or handle voting and other things like that, then I would see it to be a nifty feature to work on and implement.

Oh, and as for voting, there's so many better ways it could be handled in general. It is just popularly used on websites because that's how it started as. Nobody else differs with it, they just stay that way. People still don't utilize things like GTOP's incentive voting system either, so anyone at any time can just click 'vote!' and not bother with the captcha for GTOP; they'll still get their points.

I wasn't talking about the underlying core of the sources, which is mostly the same crap called Odin, I was talking about the implementation itself, the bridge between the game server and the actual API service. To add to that, the concept will be 100% the same for the vast majority of cases, however the actual bridge implementation would require different changes for each source.

What I'm trying to say is, for a service such as this, there cannot be a universal implementation that you could copy paste and get it done like this, you'd need to dive in and manually implement it to each source.
 
Upvote 0
Skilled Illusionist
Joined
Apr 26, 2015
Messages
302
Reaction score
77
You can easily create an API using Spring Boot..
Faster language than Java?
Let's write some rest apis in C++ :)
 
Upvote 0
Back
Top