aboutsummaryrefslogtreecommitdiff
path: root/src/network/serverpackethandler.cpp
Commit message (Expand)AuthorAge
* Fix password changing getting stuck if wrong password is entered oncesfan52022-05-14
* Apply disallow_empty_password to password changes toosfan52022-05-14
* Fix race condition in registration leading to duplicate create_auth callssfan52022-05-14
* Clean up ClientReady packet handlingsfan52022-05-14
* Don't call on_dieplayer callback two times (#11874)savilli2022-01-15
* Restore pass-through of direction keys (#11924)sfan52022-01-09
* Fix check that denies new clients from a singleplayer sessionsavilli2021-12-28
* Fix number of tool uses being off by 1..32767 (#11110)Wuzzy2021-10-31
* Fix item duplication if player dies during interact callback (alternative) (#...sfan52021-10-25
* Fix player HP desync between client and serversavilli2021-10-12
* Dynamic_Add_Media v2 (#11550)sfan52021-09-09
* Remove redundant on_dieplayer callssavilli2021-08-28
* Joystick sensitivity for player movement (#11262)NeroBurner2021-08-27
* Block & report player self-interaction (#11137)Lars Müller2021-03-30
* Check for duplicate login in TOSERVER_INIT handler (#11017)Elias Fleckenstein2021-03-19
* Protect dropping from far node inventoriesSmallJoker2021-03-07
* Protect per-player detached inventory actionsSmallJoker2021-03-07
* Server-side authority for attached players (#10952)SmallJoker2021-02-15
* Encode high codepoints as surrogates to safely transport wchar_t over networksfan52021-02-02
* Drop wide/narrow conversion functionssfan52021-02-02
* Server GotBlocks(): Lock clients to avoid multithreading issuesSmallJoker2021-02-02
* Cache client IP in RemoteClient so it can always be retrieved (#10887)sfan52021-01-31
* Fix some minor code issues all over the placesfan52020-12-24
* serverpackethandler: Minor log message fixessfan52020-11-12
* Fix object interaction distance not being checked (#10547)rubenwardy2020-11-09
* Inventory: Protect Craft and Drop actions (#10353)SmallJoker2020-09-07
* Prevent interacting with items out of the hotbar (#10359)Lejo2020-09-04
* [2] Code cleanup in serverpackethandler (#9349)HybridDog2020-09-01
* Prevent players accessing inventories of other players (#10341)Lars Müller2020-08-29
* Allow binding dig, place actions to keys; remove LMB/RMB hardcodingANAND2020-08-15
* Exposing the zoom key to Lua API (#9903)Lars Müller2020-06-13
* Add on_authplayer callback and 'last_login' to on_joinplayer (#9574)sorcerykid2020-05-23
* Log protocol ver on mismatched client connect toosfan52020-05-16
* Server class code cleanups (#9769)Loïc Blot2020-05-07
* Server: Improve some log messages (#9820)sfan52020-05-05
* Add server side translations capability (#9733)EvidenceB Kidscode2020-04-25
* serverpackethandler: Reduce pkt->getPeerId() invocations and more (#9689)HybridDog2020-04-18
* Move PlayerSAO to dedicated filesLoic Blot2020-04-11
* Fixes around ServerActiveObject on_punch handlingsfan52020-03-05
* Call on_secondary_use when object is right-clickedsfan52019-11-10
* Fix broken buildsfan52019-09-23
* Punchwear (improved) (#8959)sfan52019-09-22
* Wieldhand: Specify which ItemStack to use (#8961)SmallJoker2019-09-21
* Remove incorrect MutexAutoLocksfan52019-09-19
* Send ActiveObjects once right after Init2ANAND2019-09-14
* Formspecs: Introduce formspec_version to modsSmallJoker2019-09-14
* Send cumulated inventory changes only each step (#8856)SmallJoker2019-09-09
* Inventory: Send dirty lists where appropriate (#8742)SmallJoker2019-08-24
* Merge pull request #8776 from osjc/FixGetNodeJozef Behran2019-08-10
* Client::Interact: Use InteractAction enum instead of numeric constantsANAND2019-08-07
opt">(u32 bound); s32 range(s32 min, s32 max); void bytes(void *out, size_t len); s32 randNormalDist(s32 min, s32 max, int num_trials=6); private: u64 m_state; u64 m_inc; }; #define NOISE_FLAG_DEFAULTS 0x01 #define NOISE_FLAG_EASED 0x02 #define NOISE_FLAG_ABSVALUE 0x04 //// TODO(hmmmm): implement these! #define NOISE_FLAG_POINTBUFFER 0x08 #define NOISE_FLAG_SIMPLEX 0x10 struct NoiseParams { float offset = 0.0f; float scale = 1.0f; v3f spread = v3f(250, 250, 250); s32 seed = 12345; u16 octaves = 3; float persist = 0.6f; float lacunarity = 2.0f; u32 flags = NOISE_FLAG_DEFAULTS; NoiseParams() = default; NoiseParams(float offset_, float scale_, const v3f &spread_, s32 seed_, u16 octaves_, float persist_, float lacunarity_, u32 flags_=NOISE_FLAG_DEFAULTS) { offset = offset_; scale = scale_; spread = spread_; seed = seed_; octaves = octaves_; persist = persist_; lacunarity = lacunarity_; flags = flags_; } }; class Noise { public: NoiseParams np; s32 seed; u32 sx; u32 sy; u32 sz; float *noise_buf = nullptr; float *gradient_buf = nullptr; float *persist_buf = nullptr; float *result = nullptr; Noise(const NoiseParams *np, s32 seed, u32 sx, u32 sy, u32 sz=1); ~Noise(); void setSize(u32 sx, u32 sy, u32 sz=1); void setSpreadFactor(v3f spread); void setOctaves(int octaves); void gradientMap2D( float x, float y, float step_x, float step_y, s32 seed); void gradientMap3D( float x, float y, float z, float step_x, float step_y, float step_z, s32 seed); float *perlinMap2D(float x, float y, float *persistence_map=NULL); float *perlinMap3D(float x, float y, float z, float *persistence_map=NULL); inline float *perlinMap2D_PO(float x, float xoff, float y, float yoff, float *persistence_map=NULL) { return perlinMap2D( x + xoff * np.spread.X, y + yoff * np.spread.Y, persistence_map); } inline float *perlinMap3D_PO(float x, float xoff, float y, float yoff, float z, float zoff, float *persistence_map=NULL) { return perlinMap3D( x + xoff * np.spread.X, y + yoff * np.spread.Y, z + zoff * np.spread.Z, persistence_map); } private: void allocBuffers(); void resizeNoiseBuf(bool is3d); void updateResults(float g, float *gmap, const float *persistence_map, size_t bufsize); }; float NoisePerlin2D(const NoiseParams *np, float x, float y, s32 seed); float NoisePerlin3D(const NoiseParams *np, float x, float y, float z, s32 seed); inline float NoisePerlin2D_PO(NoiseParams *np, float x, float xoff, float y, float yoff, s32 seed) { return NoisePerlin2D(np, x + xoff * np->spread.X, y + yoff * np->spread.Y, seed); } inline float NoisePerlin3D_PO(NoiseParams *np, float x, float xoff, float y, float yoff, float z, float zoff, s32 seed) { return NoisePerlin3D(np, x + xoff * np->spread.X, y + yoff * np->spread.Y, z + zoff * np->spread.Z, seed); } // Return value: -1 ... 1 float noise2d(int x, int y, s32 seed); float noise3d(int x, int y, int z, s32 seed); float noise2d_gradient(float x, float y, s32 seed, bool eased=true); float noise3d_gradient(float x, float y, float z, s32 seed, bool eased=false); float noise2d_perlin(float x, float y, s32 seed, int octaves, float persistence, bool eased=true); float noise2d_perlin_abs(float x, float y, s32 seed, int octaves, float persistence, bool eased=true); float noise3d_perlin(float x, float y, float z, s32 seed, int octaves, float persistence, bool eased=false); float noise3d_perlin_abs(float x, float y, float z, s32 seed, int octaves, float persistence, bool eased=false); inline float easeCurve(float t) { return t * t * t * (t * (6.f * t - 15.f) + 10.f); } float contour(float v);