15.09.2016, 01:08
I have lots of code piece like that;
enum myarray_init{SQLID,mystring[50],myint,myint2,myarint[10],myarint2[50],...}
new myarray[10000][myarray_init],myarraycount;
Im getting datas from sql and set it to myarray.
But i dont set everything on init. im adding new datas if system needs it.
Its something like; set when player connects and remove when player disconnetcs. But its not player based. So the limits in this example 10000 different array data. And maybe more....
So right now im doing this;
loaditbecausesystemneeds(){
//get data from db
//set data to myarray[myarraycount]
//increase myarraycount (+1)
}
searchdata(something){ //This function makes lots of load on server.
//search an SQLID,myint,myarint etc.
//return myarray KEY
}
somefunc(){
//test=searchdata(something);
//do what you want with data as myarray[test][someotherthing];
}
i have myarraycount because of performance issues.
But i have 10-15 different code piece like that. they are so similar to this.
Is that method correct? Or how can make better one? (With svars maybe. idk.)
Actually i was searching an option like streamers;
streamer_SetArrayData and streamer_GetArrayData functions. (And a search method on it too)
(something like that maybe; https://sampforum.blast.hk/showthread.php?tid=238844 I didnt use that because there is no developer on that work right now.)
Sorry for my poor english. thank you for reading.
enum myarray_init{SQLID,mystring[50],myint,myint2,myarint[10],myarint2[50],...}
new myarray[10000][myarray_init],myarraycount;
Im getting datas from sql and set it to myarray.
But i dont set everything on init. im adding new datas if system needs it.
Its something like; set when player connects and remove when player disconnetcs. But its not player based. So the limits in this example 10000 different array data. And maybe more....
So right now im doing this;
loaditbecausesystemneeds(){
//get data from db
//set data to myarray[myarraycount]
//increase myarraycount (+1)
}
searchdata(something){ //This function makes lots of load on server.
//search an SQLID,myint,myarint etc.
//return myarray KEY
}
somefunc(){
//test=searchdata(something);
//do what you want with data as myarray[test][someotherthing];
}
i have myarraycount because of performance issues.
But i have 10-15 different code piece like that. they are so similar to this.
Is that method correct? Or how can make better one? (With svars maybe. idk.)
Actually i was searching an option like streamers;
streamer_SetArrayData and streamer_GetArrayData functions. (And a search method on it too)
(something like that maybe; https://sampforum.blast.hk/showthread.php?tid=238844 I didnt use that because there is no developer on that work right now.)
Sorry for my poor english. thank you for reading.