summaryrefslogtreecommitdiff
path: root/src/client.cpp
Commit message (Expand)AuthorAge
* Fix memory leaks due to messed up memory handling for particles as well as th...sapier2015-01-09
* NodeResolver: Perform callback immediately if node registration phase finishedkwolekr2015-01-04
* More consistent progress bar from 0-100 on startupsapier2015-01-02
* Fix missing call to std::ostringstream::strShadowNinja2014-12-12
* Use std::string::empty() instead of size() where applicableAnton2014-12-12
* Fix lighting artifacts (Issue #1887).RealBadAngel2014-12-08
* Performance of main client loop up to 2x faster In places, up to 3 times fasterCraig Robbins2014-12-07
* Fix node 0,0,0 being highlighted when enable_node_highlighting == falseCraig Robbins2014-12-01
* Implement proper font handlingsapier2014-11-30
* Fix client "double saving" simple singleplayer local mapsCraig Robbins2014-11-26
* Add (optional) client-side saving of server map to disksfan52014-11-19
* Speed up removing a node (less block mesh updates).RealBadAngel2014-11-08
* Recalculate normals for cached meshes.RealBadAngel2014-10-21
* Various uninitialised variable fixesCraig Robbins2014-10-19
* Add meshnode drawtype.RealBadAngel2014-10-18
* Simplify player modification checksShadowNinja2014-10-01
* Split settings into seperate source and header filesShadowNinja2014-09-21
* Allow taking screenshots of formspecs and move message to chatBlockMen2014-09-21
* Node highlighting.RealBadAngel2014-09-17
* Move #includes from version.h to version.cppKahrl2014-08-10
* Add support for Android 2.3+sapier2014-06-29
* Unite nodes shaders.RealBadAngel2014-06-15
* Add support for interlaced polarized 3d screenssapier2014-05-18
* Send max number of characters instead of asserting in case of too long chat m...sapier2014-05-11
* Fix invalid cast fix resulting in chat messages beeing limited to 256 bytessapier2014-05-11
* Fix heart + bubble bar size on different texture packssapier2014-05-07
* Add hack to avoid 2s startup delay on local gamessapier2014-05-02
* Add download rate to media progress bar (non http mode only!)sapier2014-04-29
* Use integers instead of float valuesBlockMen2014-04-12
* Add player:set_eye_offset() by @MirceaKitsune and clean upBlockMen2014-04-12
* Add third person viewBlockMen2014-04-12
* Add support for named threads (atm linux only)sapier2014-04-09
* Cleanup client init states by bumping protocol versionsapier2014-04-08
* Pass arguments by referenceSelat2014-03-12
* Fix rendering glitches when far from the center of the mapNovatux2014-03-04
* Remove lots of dead codesapier2014-02-07
* Add player:override_day_night_ratio() for arbitrarily controlling sunlight br...Perttu Ahola2014-02-01
* Add player:set_sky() with simple skybox supportPerttu Ahola2014-02-01
* Add propper client initializationsapier2014-01-31
* New HUD element - waypoint.RealBadAngel2014-01-26
* Allow vertical axis particle rotation constraintkhonkhortisan2014-01-13
* Fixed minetest reliable udp implementation (compatible to old clients)sapier2014-01-10
* Make MutexQueue use jsemaphore for signalingsapier2014-01-10
* Create new instance of mesh every time it's required (Solves #703)Perttu Ahola2014-01-06
* Remove an unused function and include from client.cppPilzAdam2013-12-15
* Replace SimpleThread by JThread now implementing same featuressapier2013-12-15
* Rewrite client media download and support hash-based remote downloadKahrl2013-12-13
* Cleanup jthread and fix win32 buildsapier2013-12-01
* Add minetest.swap_nodeNovatux2013-11-30
* Correct useragent in http queriesproller2013-11-06
="size["..(form_x+edge_x)..","..(form_z+edge_z).."]" local lbl={} for x,itx in pairs(itm_cache) do if x>=minx and x<=maxx then for z,y in pairs(itx) do if z>=minz and z<=maxz then local adn=advtrains.detector.get({x=x, y=y, z=z}) local color="gray" if adn then color="red" lbl[sid(adn)]={x=x, z=z} end form=form.."box["..(edge_x*(x-minx))..","..(form_z-(edge_z*(z-minz)))..";"..len_x..","..len_z..";"..color.."]" end end end end for t_id, xz in pairs(lbl) do form=form.."label["..(edge_x*(xz.x-minx))..","..(form_x-(edge_z*(xz.z-minz)))..";"..t_id.."]" end return form end local function cache_ndb() itm_cache={} local ndb_nodes=advtrains.ndb.get_nodes() for y, xzt in pairs(ndb_nodes) do for x, zt in pairs(xzt) do for z, _ in pairs(zt) do if not itm_cache[x] then itm_cache[x]={} end itm_cache[x][z]=y end end end end minetest.register_chatcommand("itm", { params="[x1 z1 x2 z2] or [mdef]", description="Display advtrains train map of given area.\nFirst form:[x1 z1 x2 z2] - specify area directly.\nSecond form:[mdef] - Use a predefined map background(see init.lua)\nThird form: No parameters - use WorldEdit position markers.", privs={itm=true}, func = function(name, param) local mdef=string.match(param, "^(%S+)$") if mdef then local d=map_def[mdef] if not d then return false, "Map definiton not found: "..mdef end itm_pdata[name]=map_def[mdef] minetest.show_formspec(name, "itrainmap", create_map_form(d)) return true, "Showing train map: "..mdef end local x1, z1, x2, z2=string.match(param, "^(%S+) (%S+) (%S+) (%S+)$") if not (x1 and z1 and x2 and z2) then if worldedit then local wep1, wep2=worldedit.pos1[name], worldedit.pos2[name] if wep1 and wep2 then x1, z1, x2, z2=wep1.x, wep1.z, wep2.x, wep2.z end end end if not (x1 and z1 and x2 and z2) then return false, "Invalid parameters and no WE positions set" end local d={p1x=x1, p1z=z1, p2x=x2, p2z=z2} itm_pdata[name]=d minetest.show_formspec(name, "itrainmap", create_map_form(d)) return true, "Showing ("..x1..","..z1..")-("..x2..","..z2..")" end, }) minetest.register_chatcommand("itm_cache_ndb", { params="", description="Cache advtrains node database again. Run when tracks changed.", privs={itm=true}, func = function(name, param) cache_ndb() return true, "Done caching node database." end, }) local timer=0 function advtrains_itm_mainloop(dtime) timer=timer-math.min(dtime, 0.1) if timer<=0 then for pname,d in pairs(itm_pdata) do minetest.show_formspec(pname, "itrainmap", create_map_form(d)) end timer=2 end end minetest.register_on_player_receive_fields(function(player, formname, fields) if formname=="itrainmap" and fields.quit then itm_pdata[player:get_player_name()]=nil end end) function advtrains_itm_init() --automatically run itm_cache_ndb minetest.after(2, cache_ndb) end