Shadowss / TravianZ

Travian T3.6 , BEST VERSION EVER | Server restarted ! Speed 50x , Troops 50x.
GNU General Public License v3.0
205 stars 126 forks source link

maybe this can be refactored? #57

Open 221V opened 1 week ago

221V commented 1 week ago

hello!

question about this sh*t --

why do not scream? https://github.com/Shadowss/TravianZ/blob/f8e3f81bba1fdd1c4712f4eb685ce84d3f0db9ff/GameEngine/Database.php#L3605-L3871

for what there needs IN(.. constructions ? we have only single value in that field(s) -- so we can rewrite this IN(.. constructions as = only this is the first moment

second -- we can rewrite TB_PREFIX.'fdata table from horizontal table rows like now -- to vertical table rows like village_id + place_id + buildingtype + building lvl

and got easy select and easy update, also store only real data -- no 0 for wasting disc/memory for no buildings on place ..

why not?


second question about db optimizations -- not use DELETE requsts -- replace this with UPDATE status = deleted

deleting is ok for once by daemon in week/month in night -- but not all time -- this is not best way for db perf ..

thank you :)

221V commented 1 week ago

also php not search in 'strings with single quotes' variables for replace it with its values -- so 'strings with single quotes' has a bit better perf then "double quotes strings" in php ...

221V commented 1 week ago

also there are prepared statement with mysqli and PDO that can be switched from mariaDB to Postgresql in php ..

also nice moment will be to add WebSockets ..

also we can use memcached instead current f*cking with files (locks and other, including store session's data in files)

this script needs so much work ((

221V commented 5 days ago

there are no reason for that if(...) with the same sql request ... https://github.com/Shadowss/TravianZ/blob/f8e3f81bba1fdd1c4712f4eb685ce84d3f0db9ff/Templates/Alliance/attacks.tpl#L84-L88