Info Saving System
#1

Background

I've been out of the SA-MP scene for about two years. Prior to that I had accumulated a few years worth of scripting knowledge. I still know the basics of Pawn and scripting like the back of my hand, but I am trying to find what aspects of SA-MP have improved during my absence (such as command processors, etc.).

The Question

In this case, I am wondering what the best information (aka "file", don't really like using file though) management system is currently for SA-MP. When I was around I remember Djson vs. MySQL being a pretty heated rivalry. Is this still the case? I will be developing a sever very shortly that will be getting a large amount of traffic. For the sake of efficiency, I would like to focus my efforts on the system which will give me the most efficient return.

One other parameter: a User CP will likely be implemented for this script. That being said, what information management system would you use if you were in my place?
Reply
#2

MySQL is better compared to other systems.
Reason:
It doesn't affect your code a lot in terms of efficiency

You just do the query on the script and the rest adding,removing,changing are done by the external MySQL thread.
Whereas INI Systems,File Saving,etc cause a lag since the server program is single threaded, the rest of the work of the scripts will not be done until this saving,writing,reading from the files is done.
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
If I were you I would forget about things like low-level information management systems, and focus on high-level code. Things like user systems have been done to death and there is ZERO reason to write your own when you can download one and have it running inside an hour! Writing your own, debugging it, securing it etc can take weeks of time better spent elsewhere.

In fact this is true of MANY things - you want a language system, download it; you want a houses system, download it; you want an object editor, download it! Even if they don't have the features you want or some bugs, modifying them will a) STILL be faster than writing your own and b) benefit everyone else too! You could have a decent server set up in a matter of hours with all the mature systems out there now, most of them developed to the point where it barely even matters what backend they are on (but you can still base a decision of which to use on that information).
Oooh-******. I just remembered I have a quick question about y_commands when I saw your name. Kind of off topic, but I'll go for it.

I was reading up on y_commands and saw your built-in permission system..

Код:
Command_SetPlayerNamed(command[], playerid, set)
When I tried looking around for some example code of y_commands to get a feel for it, I saw many people neglecting this built-in permission system and instead reverting to calling on Player data within the command itself,
such as:

Код:
CMD:hi(playerid, params[], help)
{
      if(pInfo[playerid][Admin] > 1)
      {
              SendClientMessage(playerid, WHITE, "Hello!");
      }
}
Pardon the poor example.

My question is, does the built-in permissions in y_commands actually result in greater efficiency? Or is it just a tool for ease of access.
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
Well the internal permissions are checked regardless of what other code is in the command, so yes they're more efficient simply because not using them is just more code. However, even if that were not the case I've seen commands with multiple checks for all sort of different conditions " is in one of seven teams", "is an admin" etc, which are all wrapped up in to a single check when using the inbuilt permissions.
Okay, great. I personally prefer the built-in permissions. One more question - and you don't need to answer it if you're too busy, I can see how I add permissions to an individual, but when I'm looking to add a failure message would you then recommend using Command_GetPlayerNamed? I'm just a little confused about Command_GetPlayerNamed, does it return a Boolean?

In other words, would you use it like:

Код:
if(Command_GetPlayerNamed(hi, playerid)) == 0) return SendClientMessage(playerid, RED, "Bye.");
Or is it necessary to use it under the command itself?

Sorry for barraging you with question - like I said if you're busy don't bother but I really appreciate the help. I'm more than capable of using y_commands, I just want to gain a better understanding of its internal features to be able to use it more efficiently. I've checked out a few tutorials and still have yet to find one using the internal permissions.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)