Need modders input (Account system data ACS)

General discussion of the port and Doom-related chat.
Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

Need modders input (Account system data ACS)

#1

Post by Watermelon » Fri Feb 08, 2013 4:30 pm

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

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Need modders input (Account system data ACS)

#2

Post by ibm5155 » Fri Feb 08, 2013 8:33 pm

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
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: Need modders input (Account system data ACS)

#3

Post by Watermelon » Fri Feb 08, 2013 9:01 pm

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

Neewbie
Forum Regular
Posts: 140
Joined: Sat Jun 23, 2012 11:10 am

RE: Need modders input (Account system data ACS)

#4

Post by Neewbie » Fri Feb 08, 2013 9:38 pm

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

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: Need modders input (Account system data ACS)

#5

Post by Watermelon » Fri Feb 08, 2013 10:12 pm

Yes there can be a global save (0 to the server).
Possibly -1 for a bad player number wouldn't save anything.

User avatar
NachtIntellect
Forum Regular
Posts: 480
Joined: Mon Jun 11, 2012 9:20 am
Location: Bienenstock, Germany

RE: Need modders input (Account system data ACS)

#6

Post by NachtIntellect » Fri Feb 08, 2013 10:57 pm

An Acs account system? This will be handy for someone I know who is having trouble making a ranking system for his mod.
Did you just bite me? Come here, I will bite you back bastard.

Blzut3
Developer
Posts: 306
Joined: Thu May 24, 2012 9:37 pm

RE: Need modders input (Account system data ACS)

#7

Post by Blzut3 » Fri Feb 08, 2013 11:18 pm

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.

Catastrophe
Retired Staff / Community Team Member
Posts: 2565
Joined: Sat Jun 02, 2012 2:44 am

RE: Need modders input (Account system data ACS)

#8

Post by Catastrophe » Fri Feb 08, 2013 11:18 pm

This looks great, also congratulations on surviving the horrors of amneisa

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Need modders input (Account system data ACS)

#9

Post by Ijon Tichy » Fri Feb 08, 2013 11:22 pm

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.

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: Need modders input (Account system data ACS)

#10

Post by Watermelon » Sat Feb 09, 2013 2:06 am

Catastrophe wrote: This looks great, also congratulations on surviving the horrors of amneisa
Thank you :cool:
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!
Last edited by Watermelon on Sat Feb 09, 2013 2:07 am, edited 1 time in total.

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

RE: Need modders input (Account system data ACS)

#11

Post by ibm5155 » Wed Feb 13, 2013 1:22 pm

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
Last edited by ibm5155 on Wed Feb 13, 2013 1:24 pm, edited 1 time in total.
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

RE: Need modders input (Account system data ACS)

#12

Post by ZZYZX » Wed Feb 13, 2013 1:45 pm

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.

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Need modders input (Account system data ACS)

#13

Post by Ijon Tichy » Wed Feb 13, 2013 7:47 pm

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.
Last edited by Ijon Tichy on Wed Feb 13, 2013 7:54 pm, edited 1 time in total.

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Need modders input (Account system data ACS)

#14

Post by Lollipop » Sat Mar 09, 2013 6:01 pm

I didnt bother to overread all the posts, but if data is stored in the ini file, its easy to hack that information :V
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Reach Term
Forum Regular
Posts: 323
Joined: Fri Jun 15, 2012 7:45 pm

RE: Need modders input (Account system data ACS)

#15

Post by Reach Term » Sat Mar 09, 2013 6:09 pm

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.

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Need modders input (Account system data ACS)

#16

Post by Lollipop » Thu Mar 14, 2013 3:44 pm

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
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

XCOPY
 
Posts: 64
Joined: Wed Dec 05, 2012 11:52 pm
Contact:

RE: Need modders input (Account system data ACS)

#17

Post by XCOPY » Thu Mar 14, 2013 4:47 pm

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.
----===|SOUTH AMERICA RULES|===----

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Need modders input (Account system data ACS)

#18

Post by Lollipop » Sat Mar 16, 2013 9:24 am

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.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

User avatar
Balrog
Forum Regular
Posts: 215
Joined: Fri Aug 10, 2012 11:16 am

RE: Need modders input (Account system data ACS)

#19

Post by Balrog » Sat Mar 16, 2013 5:30 pm

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.)
Last edited by Balrog on Sat Mar 16, 2013 5:31 pm, edited 1 time in total.

Code: Select all

[15:53:14] balrog: one day, the original mm8bdm devteam from mfggu and i will meet in valhalla and we will be friends

Code: Select all

<ijon>well fuk
<ijon>guess I gotta suck dicks now

Code: Select all

(18:13:17)<Mayrine>i dont have to learnt anything about ACS

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Need modders input (Account system data ACS)

#20

Post by Ijon Tichy » Sat Mar 16, 2013 5:42 pm

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.
Last edited by Ijon Tichy on Sat Mar 16, 2013 5:44 pm, edited 1 time in total.

Post Reply