summaryrefslogtreecommitdiff
path: root/src/network/networkpacket.h
Commit message (Collapse)AuthorAge
* Rework packet receiving in ServerThreadsfan52019-11-19
| | | | | Notably it tries to receive all queued packets between server steps, not just one.
* Fix serialization of std::time_t by casting to u64 first (#8353)rubenwardy2019-03-10
| | | Fixes #8332
* Add session_t typedef + remove unused functions (#6470)Loïc Blot2017-09-27
| | | | | | * Add session_t typedef + remove unused functions u16 peer_id is used everywhere, to be more consistent and permit some evolutions on this type in the future (i'm working on a PoC), uniformize u16 peer_id to SessionId peer_id
* Network cleanup (#6310)Loïc Blot2017-08-25
| | | | | | | | | | | | | | * Move Connection threads to dedicated files + various cleanups * ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types * Various code style fixes * Code style with clang-format * Various SharedBuffer copy removal * SharedBuffer cannot be copied anymore using Buffer * Fix many SharedBuffer copy (thanks to delete operator)
* Network cleanup (#6302)Loïc Blot2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | * Cleanup network headers * Move peerhandler to a specific header to reduce compilation times * Move socket.cpp/h to network folder * More work * Network code cleanups * Move socket.{cpp,h} to network folder * Move Address object to network/address.{cpp,h} * Move network exceptions to network/networkexceptions.h * Client: use unique_ptr for Connection * Server/ClientIface: use shared_ptr for Connection * Format fixes * Remove socket.cpp socket.h from clang-format whitelist * Also fix NetworkPacket code style & make it under clang-format
* Fix OSX builds (closes #6289, fixes #6270) (#6306)Pavel Puchkin2017-08-24
| | | | Of course, this is not ideal solution, but we want our users to be happy in the first place, right?
* Code modernization: subfolders (#6283)Loïc Blot2017-08-19
| | | | | | | | | | | | | * Code modernization: subfolders Modernize various code on subfolders client, network, script, threading, unittests, util * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Make connection.cpp readable in a pointed place + typo
* Add missing ctime include (#6269)adrido2017-08-18
|
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
| | | | * Migrate cpp headers to pragma once
* Cleanup various headers to reduce compilation times (#6255)Loïc Blot2017-08-16
| | | | * Cleanup various headers to reduce compilation times
* Chat protocol rewrite (#5117)Loïc Blot2017-07-16
| | | | | | | | | | | | | * New TOCLIENT_CHAT_MESSAGE packet * Rename old packet to TOCLIENT_CHAT_MESSAGE_OLD for compat * Handle TOCLIENT_CHAT_MESSAGE new structure client side * Client chat queue should use a specific object * SendChatMessage: use the right packet depending on protocol version (not complete yet) * Add chatmessage(type) objects and handle them client side (partially) * Use ChatMessage instead of std::wstring server side * Update with timestamp support
* C++11 cleanup on constructors dir network (#6021)Vincent Glize2017-06-21
| | | | * C++11 cleanup on constructors dir network
* NetworkPacket: don't copy push std::string and std::wstringLoic Blot2017-04-14
|
* Add particle animation, glowsfan52017-01-18
| | | | | This is implemented by reusing and extending the TileAnimation code for the methods used by particles.
* Add control information to player interacts (#4685)raymoo2016-11-12
|
* Fix critical vulnerabilities and bugs with NetworkPacketkwolekr2015-08-06
|
* Make early protocol auth mechanism generic, and add SRPest312015-05-11
| | | | | | | Adds everything needed for SRP (and everything works too), but still deactivated, as protocol v25 init packets aren't final yet. Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25 inside networkprotocol.h.
* Stop NetworkPacket methods from producing bloated packetsJay Arndt2015-05-05
|
* NetworkPacket: reading outside packet is now clearer.Loic Blot2015-04-01
| | | | Use a common function to check the reading offset
* Connection::Receive(): receive Network Packet instead of SharedBuffer<u8>.Loic Blot2015-03-31
| | | | | | | Because we get a Buffer<u8> from ConnectionEvent, don't convert it to SharedBuffer<u8> and return it to Server/Client::Receive which will convert it to NetworkPacket Instead, put the Buffer<u8> directly to NetworkPacket and return it to packet processing This remove a long existing memory copy Also check the packet size directly into Connection::Receive instead of packet processing
* Remove unused ConnectionCommand::sendToAll function. ↵Loic Blot2015-03-22
| | | | | | NetworkPacket::oldForgePacket returns Buffer instead of SharedBuffer and is used in ConnectionCommand instead of Connection::Send This remove the NetworkPacket buffer => SharedBuffer => Buffer copy. Now NetworkPacket => Buffer
* [Patch 2/4] Network rework: packet writing, sending and cleanupsLoic Blot2015-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetworkPacket.cpp: * Remove some deprecated functions, we must use streaming interface * m_data converted from u8* to std::vector<u8> * Add an exporter to forge packet to Connection object * implement operator << std::wstring. n * implement operator << std::string * dynamic resize when write packet content. * fix string writing and performances. * create ServerCommandFactory, used by client to get useful informations about packet processing (sending). * Reliability * Transmit channel * Implement putRawString for some ugly char (_INIT packet), and use it. * Many packet read and write migrated * Implement oldForgePacket to interface writing with current connection * fix U8/char/bool writing * fix string writing and performances. * add some missing functions * Use v3s16 read instead of reading x,y,z separately * Add irr::video::SColor support into packets * Add some missing handlers * Add a template function to increase offset * Throw a serialization error on packet reading (must be improved) PacketFactories: * Create ServerCommandFactory, used by client to get useful informations about packet processing (sending). * Create ClientCommandFactory, used by server to get useful informations about packet processing (sending). Client.cpp: * implement NetworkPacket ::Send interface. * Move packet handlers to a dedicated file * Remove Client::Send(SharedBuffer) Server.cpp: * implement NetworkPacket ::Send interface. * Rewrite all packets using NetworkPacket * Move packet handlers to a dedicated file * Remove Server::Send(SharedBuffer) ClientIface.cpp: * Remove sendToAll(SharedBuffer<u8>) Connection.hpp rework: * Remove duplicate include * Remove duplicate negation * Remove a useless variable * Improve code performance by using a m_peers_list instead of scanning m_peers map * Remove Connection::Send(SharedBuffer) * Fix useafterfree into NetworkPacket Sending * Remove unused Connection::sendToAll Test.cpp: * Remove dead code * Update tests to use NetworkPackets Misc: * add new wrappers to Send packets in client, using NetworkPacket * Add NetworkPacket methods for Connection * coding style fix * dead code since changes cleanup * Use v3s16 read instead of reading x,y,z separately in some packets * Use different files to handle packets received by client and server * Cleanup: Remove useless includes ok @Zeno- Tested by @Zeno- @VanessaE and @nerzhul on running servers
* Network Layer 7 rework (Packet handling)Loic Blot2015-02-10
* Move networkcode to a dedicated directory * Rename clientserver.h to network/networkprotocol.h (Better name) and sanitize some includes * Create object NetworkPacket * It stores command (opcode) and data separated * It also stores peer_id * Data reading can be done by using a streaming interface * Change packet routing analysis * Remove old conditional analysis * Now uses function pointed analysis and add connection state ({Client,Server}::handlers) * Connection state permit to categorize condition to handle before analyze packets * Create a handler for depreciated messages, instead of duplicating code