Page 1 of 2
Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 4:30 pm
by Watermelon
If you haven't read this, see here:
http://zandronum.com/forum/showthread.php?tid=2060
One idea I was toying around with is when we get the account system, most people will want to use it to start storing data on their players. So far the only way I'd be doing it is modifying the binary to do some of my dirty work. But this is sort of beyond the realm of most people, and what if you wanted it hosted on BE or GV where you can't access the server binary?
Therefore I was thinking of making an ACS plugin that allows mods to store information for the players. It would be very simple, and be integer driven.
Let us use some gun game for example, I envision it as follows:
ACS addons:
// Gets the index from the main database of their login number (each account has a single login number associated with it)
GetPlayerLoginID(int playerNumber);
// Don't know what to call this, but retrieves a string from a file you write to
GetData(int playerID, str dataName);
// Writes the data to a file on the host machine
WriteData(int playerID, str dataName, int value);
So for example, if your mod saves money, you could run a script like this:
Code: Select all
script 123 (void) {
int loginID = GetPlayerLoginID(PlayerNumber()); // Made this two lines for easy reading
WriteData(loginID, "money", moneyVariableHere);
}
On your machine it'd just be stored like an .ini file
Code: Select all
[1]
money=158234
kills=12
deaths=666
[5]
money=182385
[1235]
money=153
kills=-1
Haven't thought it fully through yet, but if anyone has suggestions on what could possibly be available via ACS or such, you may just shape the future of this
possibly added feature
RE: Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 8:33 pm
by ibm5155
acs acount system O_o
If acs suport objects it would be great *__*
they problem i think with scripts are if the mod have the same number script?
the only problem I see on it is it would be easy to change...
I think it would be better a c modification then acs, then it would send the player information to the master server :D
Well if you need some help, I can try something in acs
RE: Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 9:01 pm
by Watermelon
Since these would be going on main servers that store data, if multiple mods wanted to be used on the server, then the mod users would have to prove with their source that they only modify variables for them only
Example:
aow_kills
gvh_frags
zh_achievement1unlocked
sf_monsterskilled
duel_whatever
RE: Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 9:38 pm
by Neewbie
I wan dis!!!1!111
It's exactly like i imagined it. It's just nice, the data is kept in the ini even when the server crash.
Btw i would like to request something :
Watermelon wrote:// Don't know what to call this, but retrieves a string from a file you write to
GetData(int playerID, str dataName);
// Writes the data to a file on the host machine
WriteData(int playerID, str dataName, int value);
Could we use a sort of exception ID like the ID 0 to save server stuff only ?
For exemple in zh there are server stats and we could save it to the ID 0 instead of saving it in a random player ID
RE: Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 10:12 pm
by Watermelon
Yes there can be a global save (0 to the server).
Possibly -1 for a bad player number wouldn't save anything.
RE: Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 10:57 pm
by NachtIntellect
An Acs account system? This will be handy for someone I know who is having trouble making a ranking system for his mod.
RE: Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 11:18 pm
by Blzut3
So AlexMax brought the topic up on IRC. I personally don't think allowing mods to have persistent data (without a modified server binary anyway) is a good idea. Now my opinion doesn't necessarily count there, but essentially there is potentially some problems relating to security that we don't have to worry about in the current sand boxed environment. Beyond that ACS isn't really designed to be reading/writing persistent data which is why getcvar/consolecommand are horrible ideas. You argue that this should be available to mods since you can't run custom binaries on a public server, which in a way brings the same problem that comes with storing the data on the client. Orphaned data and properly separating data between mods. Basically I don't think the BE server admins would be too happy if people could host a mod that spews gigabytes of data on the hard drive. If the server admin has to approve the custom binary for running, then this won't likely happen.
But for those of you that aren't going to hear any of that. Perhaps the solution is to have a global variable dump file? Zandronum could add a parameter "-globalstore filename.dat" which saves the state of all of the global variables. (Optionally an ACS chunk could be added to allow which variables to restore be specified manually.) The command line option ensures that the option to store persistent data is left to the user (similar to logfile). Furthermore by dumping the globals, it would require no changes to the ACS API and could realistically be added to ZDoom as well.
RE: Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 11:18 pm
by Catastrophe
This looks great, also congratulations on surviving the horrors of amneisa
RE: Need modders input (Account system data ACS)
Posted: Fri Feb 08, 2013 11:22 pm
by Ijon Tichy
This would be more useful if strings weren't half-broken online. StrParam strings never work, and strings passed to ACS functions don't work. I say fuck the string table.
After that, yeah, RPG mods, stat tracking, admin mode triggers, saving weapon states, cool shit.
RE: Need modders input (Account system data ACS)
Posted: Sat Feb 09, 2013 2:06 am
by Watermelon
Catastrophe wrote:
This looks great, also congratulations on surviving the horrors of amneisa
Thank you
Ijon Tichy wrote:
This would be more useful if strings weren't half-broken online. StrParam strings never work, and strings passed to ACS functions don't work. I say fuck the string table.
After that, yeah, RPG mods, stat tracking, admin mode triggers, saving weapon states, cool shit.
That's another major problem. I may have to add in pseudo-string support to ACS. Randy was supposed to get String's properly added after 2.6.0 but hasn't yet. I think Dusk made something that returns/handles strings properly, but I have no idea if it'd work for this.
Blzut3 wrote:
So AlexMax brought the topic up on IRC. I personally don't think allowing mods to have persistent data (without a modified server binary anyway) is a good idea. Now my opinion doesn't necessarily count there, but essentially there is potentially some problems relating to security that we don't have to worry about in the current sand boxed environment. Beyond that ACS isn't really designed to be reading/writing persistent data which is why getcvar/consolecommand are horrible ideas. You argue that this should be available to mods since you can't run custom binaries on a public server, which in a way brings the same problem that comes with storing the data on the client. Orphaned data and properly separating data between mods. Basically I don't think the BE server admins would be too happy if people could host a mod that spews gigabytes of data on the hard drive. If the server admin has to approve the custom binary for running, then this won't likely happen.
Ideally it shouldn't go up to gigabytes, there could be a limit set on how many commands are allowed to be issued, or size restrictions on the database. That way if someone wants to extend the hardcoded limits they'd need a modified binary.
Currently even without this implementation, there's already a way to overload someones hard drive using ConsoleCommand, but that is in there, an that can affect clients anywhere at any time, whereas this would only affect the server. I even think Apothem proved you could delete someone's files on their computer with ACS somehow.
But for those of you that aren't going to hear any of that. Perhaps the solution is to have a global variable dump file? Zandronum could add a parameter "-globalstore filename.dat" which saves the state of all of the global variables. (Optionally an ACS chunk could be added to allow which variables to restore be specified manually.) The command line option ensures that the option to store persistent data is left to the user (similar to logfile). Furthermore by dumping the globals, it would require no changes to the ACS API and could realistically be added to ZDoom as well.
This is also another possible idea!
RE: Need modders input (Account system data ACS)
Posted: Wed Feb 13, 2013 1:22 pm
by ibm5155
and does a vector char work?
like int char[10];
you could manually use it as a string (but it would require some special functions for speed up the project)
Ah the security, I think maybe that would be the problem, everyone could see the name/password string "unless someone invent a mehtod to encrypt the string...")...
I think it would be better a binary modify, you would lose too much ram storing all the data
RE: Need modders input (Account system data ACS)
Posted: Wed Feb 13, 2013 1:45 pm
by ZZYZX
Basically I don't think the BE server admins would be too happy if people could host a mod that spews gigabytes of data on the hard drive. If the server admin has to approve the custom binary for running, then this won't likely happen.
Good way to circumvent this is disabling ConsoleCommand, then adding a CVar that controls maximum file size for persistent storage (for example, 20kb total, 2kb per single wad). Without disabling ConsoleCommand, this new CVar should be filtered so a mod still can't set the size.
RE: Need modders input (Account system data ACS)
Posted: Wed Feb 13, 2013 7:47 pm
by Ijon Tichy
Circunei Z wrote:
Basically I don't think the BE server admins would be too happy if people could host a mod that spews gigabytes of data on the hard drive. If the server admin has to approve the custom binary for running, then this won't likely happen.
Good way to circumvent this is disabling ConsoleCommand, then adding a CVar that controls maximum file size for persistent storage (for example, 20kb total, 2kb per single wad). Without disabling ConsoleCommand, this new CVar should be filtered so a mod still can't set the size.
Two kilobytes is 512 integers, and much less if you give them names; you could only store 170 integers if each one gets 8 bytes to store a name. That is simply not enough for a server that wants to store various (hell, even one) stats per player.
Also, 2KB was a drop in the bucket in 1995. Nowadays, each mod could have 1MB and there'd be no trouble; it'd take a thousand mods to use up one gigabyte, and these days, 1GB is the new drop in the bucket, costing less than 10 cents. Don't strangle the only persistent storage a mod would get.
RE: Need modders input (Account system data ACS)
Posted: Sat Mar 09, 2013 6:01 pm
by Lollipop
I didnt bother to overread all the posts, but if data is stored in the ini file, its easy to hack that information :V
RE: Need modders input (Account system data ACS)
Posted: Sat Mar 09, 2013 6:09 pm
by Reach Term
Lollipop wrote:
I didnt bother to overread all the posts, but if data is stored in the ini file, its easy to hack that information :V
That's only if it's store client side... Pretty sure this would be server side. You should read before you post. It's not that hard.
RE: Need modders input (Account system data ACS)
Posted: Thu Mar 14, 2013 3:44 pm
by Lollipop
Im pretty sure to have read the word ini file, wich is client side, no?
If not, its just me being stupid again, not knowing enough yet :V
RE: Need modders input (Account system data ACS)
Posted: Thu Mar 14, 2013 4:47 pm
by XCOPY
Man seriously, we need an actual scripting language for real men and drop ACS support, or just choose a way so ACS can live with another language properly. Like, Python, LUA, LISP(?)... That would be one huge coding but at least we would have better support for server interaction.
RE: Need modders input (Account system data ACS)
Posted: Sat Mar 16, 2013 9:24 am
by Lollipop
I got a better idea xcopy, forget trying to make those new script langueges fit with doom maps and just use the ACS script language, wich we know Works proberly and is aleready defined.
RE: Need modders input (Account system data ACS)
Posted: Sat Mar 16, 2013 5:30 pm
by Balrog
XCOPY wrote:
Man seriously, we need an actual scripting language for real men and drop ACS support, or just choose a way so ACS can live with another language properly. Like, Python, LUA, LISP(?)... That would be one huge coding but at least we would have better support for server interaction.
This is not Quake. You either use ACS/DECORATE, DEH or GTFO. (And DoomScript, about 5000 years from now when you can program computers with your mind.)
RE: Need modders input (Account system data ACS)
Posted: Sat Mar 16, 2013 5:42 pm
by Ijon Tichy
None of those handle keybindings well at all. None of them have decent access to the console. None of them can save data between games. His point is valid.
Lollipop wrote:
I got a better idea xcopy, forget trying to make those new script langueges fit with doom maps and just use the ACS script language, wich we know Works proberly and is aleready defined.
ACS works properly? I dunno, I know of quite a few ways it doesn't (nested #includes, dynamic strings online, handling over 19 vars in a script, to begin). It's also a shitty imitation of C, and, save a major internal overhaul (starting with proper primitives and data structures), will always be a shitty imitation of C.