Commit Graph

172 Commits

Author SHA1 Message Date
Collin Smith
143bfca048 Changed signature of PacketSender functions and prepended InetSocketAddress parameter for target 2020-06-26 13:31:47 -07:00
Collin Smith
ad78346c1e Added salt field to Netty fbs 2020-06-25 19:47:39 -07:00
Collin Smith
dac10467fa Changed signatures for packet processing calls from Channel to ChannelHandlerContext 2020-06-25 17:29:20 -07:00
Collin Smith
8a38fd7139 Added Channel field to processPacket callback to retrieve attributes and manage connection 2020-06-25 12:18:44 -07:00
Collin Smith
597ae213c5 Moved netty netcode from :server:netty to :core module 2020-06-25 10:08:00 -07:00
Collin Smith
fbdf50f646 Added additional methods to expose MessageChannel instances of ReliableEndpoint and ReliablePacketController instance of MessageChannel 2020-06-25 01:18:44 -07:00
Collin Smith
cf1fea539f Improved support for reliable UDP
Implemented PacketListener#onPacketTransmitted callback for sending messages and acks
Created PacketListener#onAckProcessed callback for received acks
Documented some unknown code related to copying outgoing bytebuf and prepending some data to it
Todo: add support for fragmented messages
2020-06-25 01:11:24 -07:00
Collin Smith
7b3827823d Added reliable udp packet receiving and partial sending 2020-06-24 22:20:26 -07:00
Collin Smith
bfe71c1031 Moved sequence manipulators to MessageChannel 2020-06-24 22:16:57 -07:00
Collin Smith
e36b832667 Added support for reliable UDP congestion control and packet resending -- no transcieve yet #78 2020-06-24 21:53:45 -07:00
Collin Smith
398f034755 Moved EventLoopGroup shutdown to Application#dispose 2020-06-24 21:48:36 -07:00
Collin Smith
3dc8136462 Moved exit function to catch block and removed sync which was blocking create thread and thus render loop 2020-06-24 20:15:48 -07:00
Collin Smith
8eee5fd8f3 Modified generics with API - endpoint should work with any Object as QoS param 2020-06-24 17:40:30 -07:00
Collin Smith
d328eff4d2 Refactored to send connection packet on main thread instead of through an extra handler attached to the pipeline 2020-06-24 16:29:49 -07:00
Collin Smith
b74e870e9b Abstracted networking further and implemented TCP implementation #78
Deprecated ReliableChannelHandler (succeeded by EndpointedChannelHandler)
Added basic test netty TCP client and server
2020-06-24 15:46:41 -07:00
Collin Smith
b832c89dcc Updated API 2020-06-24 15:27:58 -07:00
Collin Smith
271359cbca Fixed log messages 2020-06-24 15:22:18 -07:00
Collin Smith
725bbe4a01 Modified API slightly to improve extension 2020-06-24 13:43:07 -07:00
Collin Smith
2f066cbd0f Created PacketSender abstraction to send Flatbuffer data using any protocol 2020-06-24 12:19:31 -07:00
Collin Smith
919281e814 Refactored PacketProcessor to com.riiablo.net 2020-06-24 11:35:45 -07:00
Collin Smith
58a576dfc9 TestClient and TestServer now call ReliableEndpoint#update(float) every frame 2020-06-24 01:06:39 -07:00
Collin Smith
165459dd12 Changed delta from long millis to float seconds 2020-06-24 01:05:47 -07:00
Collin Smith
e07e6bd2ba Refactored changed time to delta where appropriate 2020-06-24 00:59:26 -07:00
Collin Smith
1426b87534 Filled in UnreliableOrderedMessageChannel 2020-06-23 21:45:06 -07:00
Collin Smith
53a1a6f117 Removed sequence from PacketProcessor#processPacket and PacketTransceiver#receivePacket interfaces
sequence was not used and should remain encapsulated beneath MessageChannel layer
2020-06-23 21:28:20 -07:00
Collin Smith
53ceea02a8 Added support for acking packets using a received packets header 2020-06-23 21:04:26 -07:00
Collin Smith
185bd6a73d Roughed out ReliablePacketController#sentAck 2020-06-23 20:41:32 -07:00
Collin Smith
c268d69ff9 Added time field 2020-06-23 20:33:05 -07:00
Collin Smith
cc1c43b7e6 Committing basic reliable UDP package 2020-06-23 18:40:59 -07:00
Collin Smith
3a79adcaae Removing previous iteration 2020-06-23 18:40:17 -07:00
Collin Smith
b19d61b8f2 Committing local changes from deprecated netty udp protocol 2020-06-23 18:39:14 -07:00
Collin Smith
fbc4019b23 Removed AckPacket and added writeAck function to SinglePacket 2020-06-22 12:27:11 -07:00
Collin Smith
990910393b Implemented headerSize and fragmentSize fields 2020-06-22 12:03:40 -07:00
Collin Smith
8f0f2b36c6 Fixed unsigned arithmetic 2020-06-22 02:13:14 -07:00
Collin Smith
e831ca09cd Added check to see if fragment packet header was invalid 2020-06-21 20:36:33 -07:00
Collin Smith
7e31a3a5dd Changed error handling style to be log-and-return based 2020-06-21 20:34:21 -07:00
Collin Smith
194fb0817f Adjusted API slightly to help with more common impl 2020-06-21 20:21:53 -07:00
Collin Smith
092a6c23fe Created com.riiablo.net.reliable and partial Java implementation of reliable.io UDP scheme #78 2020-06-21 19:41:08 -07:00
Collin Smith
3f51d1d503 Removed individual handlers for inbound and outbound traffic -- replaced with ReliableChannelHandler 2020-06-20 14:21:25 -07:00
Collin Smith
01888faac6 Implemented ReliableUtil and composite ByteBuf into ReliableChannelHandler
Implemented ReliableUtil and composite ByteBuf into ReliableChannelHandler
ReliableChannelHandler automatically replaces outbound message with composite
Removed size prefixing contract from Packet factory
Added ReliableUtil#createHeader to write data and set writer index passed header
2020-06-20 14:03:27 -07:00
Collin Smith
d672768495 Added finishNettyBuffer 2020-06-20 12:49:17 -07:00
Collin Smith
5c4c06d47e Created setContentSize method to support composite buffers
Created setContentSize method to support composite buffers
Removed UDP header fields from Netty fbs table
2020-06-20 12:47:31 -07:00
Collin Smith
26aebd5183 Created ReliableUtil class with utility methods to set and get header data encoded within a reliable UDP packet outside of fbs 2020-06-20 02:01:05 -07:00
Collin Smith
a8fe6bc732 Removed Header table from fbs and inlined fields within the Netty table 2020-06-20 00:21:04 -07:00
Collin Smith
510342e232 Implemented some basic reliable udp logic
Seq should increment and wrap around at 0xFFFF
Added special case for ack < 0 (init first packet)
Added netty packet creation functions to ReliableChannelHandler
Header creation is difficult because I can't mutate existing packets easily -- experimenting
2020-06-18 20:46:57 -07:00
Collin Smith
2b6d06f330 Rolled Client debugging outbound packet data logging into ReliableChannelHandler 2020-06-17 22:57:40 -07:00
Collin Smith
fb7377980b Created ReliableChannelHandler to try and accomplish ReliableInboundHandler and ReliableOutboundHandler with one ChannelHandler
Replaced implementations with ReliableChannelHandler
Removed ReliableInboundHandler and ReliableOutboundHandler
Removed propagation for caught exceptions within ReliableChannelHandler impls
2020-06-17 22:29:14 -07:00
Collin Smith
f1df48b468 Changed ServerHandler to be a subclass of PacketHandler -- replaced anon PacketHandler with ServerHandler impl 2020-06-17 22:02:33 -07:00
Collin Smith
573f4d1b4b Added reliable ChannelHandlers to server ChannelPipeline 2020-06-17 21:56:00 -07:00
Collin Smith
fc66d120d7 Filled in some of anonymous PacketHandler within Main to process some packet types 2020-06-17 21:54:08 -07:00
Collin Smith
02a6cd4b56 Created PacketHandler class to help with decoding fbs packet objects from netty channels 2020-06-17 21:33:34 -07:00
Collin Smith
ef94883dd7 Refactored name scheme 2020-06-17 21:16:04 -07:00
Collin Smith
a2000a6162 Fixed some initialization issues and created reliable ChannelHandler implementations to help deal with UDP reliability 2020-06-17 21:09:56 -07:00
Collin Smith
cad29c7b82 Created Header table in Netty fbs and sample packet 2020-06-16 02:40:39 -07:00
Collin Smith
f5454be03d Created test fbs packets 2020-06-14 20:59:27 -07:00
Collin Smith
cbd55ee164 Replaced StringEscapeUtils from apache commons-lang3 with commons-text
StringEscapeUtils from commons-lang3 was deprecated and should be using version from commons-text
Optimized imports
2020-06-14 12:35:15 -07:00
Collin Smith
dd54d11d9f Transitioned to UDP client/server 2020-06-13 21:13:11 -07:00
Collin Smith
4dcfe2ff00 Created netty module to try implementing UDP servers and move away from the LibGDX networking 2020-06-13 17:42:05 -07:00
Collin Smith
eb2d672ac1 Improved accuracy of networking ping calculation #77 2020-06-12 20:08:58 -07:00
Collin Smith
3390b544a6 Improved accuracy of ping calculation #77 2020-06-07 15:55:28 -07:00
Collin Smith
cdc73e12d6 Added support for Ping packet
Added Ping to Networking fbs
Created Riiablo.ping long to store current ping in ms
Changed Client draw fps to draw Riiablo.ping below fps
Created Pinger system which manages Riiablo.ping and sending and receiving Ping packets
Riiablo.ping is really more like RTT+frame_time and should be ironed out better
Created issue #77 related to the work done in this commit and deficiencies to be addressed
2020-06-07 00:23:00 -07:00
Collin Smith
ae00373f8a Added ServerItemManager which will handle item wrapper entity creation/deletion 2020-06-05 13:25:37 -07:00
Collin Smith
83a95e35fc Removed deprecated DropItem and PickupItem packets and related code 2020-06-04 19:46:42 -07:00
Collin Smith
e472514179 Rolled Deleted component implementation into a Flags component
Removed Deleted component and associated flatbuffers classes
Created Flags component along with added a bitflags field to EntitySync flatbuffers table
It seems plausible more flags will be needed in the future aside from marking an entity as deleted
2020-06-04 19:41:55 -07:00
Collin Smith
ffda38c9fd Fixed issue where packets might be sent to a disconnected client 2020-06-04 19:14:08 -07:00
Collin Smith
804e8373d5 Improved logging for D2GS packets
Added ability to disable logging for specified packet types (EntitySync was cluttering the log)
2020-06-04 17:05:15 -07:00
Collin Smith
7404ea63a6 First iteration of deleting networked entities
This iteration assumes removing Networked component implies deletion
Deletion is managed as a flag within the EntitySync packet header
2020-06-03 20:58:58 -07:00
Collin Smith
907688a1d2 Improved support for picking up and dropping items
ItemController interface changed to be an engine-operable interface
Removed ItemController interface from CharData
Changed ItemController#groundToCursor(Item) to #groundToCursor(int) to pick up an item wrapper entity
ItemManager now handles item entity creation/deletion (may change)
ClientItemManager changed to operate upon Riiablo.charData and is for clients
CursorMovementSystem now uses ItemController instead of handling item drop and packeting directly
Item wrapper entity deletion remains unhandled in multiplayer until support for networking entity deletion is added
2020-06-02 20:55:03 -07:00
Collin Smith
edb6de8df9 Added support to D2GS for a majority of ItemManager functions
Added support to D2GS for a majority of ItemManager functions
GroundToCursor remains unimplemented in this commit due to entity creation
2020-06-02 15:30:18 -07:00
Collin Smith
8f437ab037 Added ItemManager system to D2GS engine 2020-06-01 17:47:37 -07:00
Collin Smith
be70756aeb Added prototypes for item management packets 2020-05-31 21:30:53 -07:00
Collin Smith
6860d8cba1 Implemented improved CharData class
CharData has been fully replaced with a version that doesn't just wrap a D2S file
Added support for a more event-based action approach with the UI
Event systems still need to be added to engine to perform CharData item operations
Decoupled com.riiablo.Cursor from D2S cursor item management -- defers to Riiablo.charData instance
2020-05-28 13:07:24 -07:00
Collin Smith
f78a3a2d08 Moved D2S to com.riiablo.save 2020-01-06 15:26:00 -08:00
Collin Smith
361158a481 Moved some engine consts to Riiablo class 2020-01-06 15:18:28 -08:00
Collin Smith
ff7a27d334 Added support for serializing and synchronizing dropped items
Added support for serializing and synchronizing dropped items
Picking up items not supported yet -- requires API change
Added packet types for DropItem and PickupItem
Added ItemP component table and ItemSerializer
Added EntityFactory#createItem(Item,float,float)
Removed CharStats.BlockFactor from Stat.toblock item property -- should be applied on view stats and base character properties list
2019-12-31 02:46:34 -08:00
Collin Smith
acd6d1691f Changed alphas from float32 to ubyte8 (fixed point) 2019-12-30 02:20:48 -08:00
Collin Smith
ad9a0be434 Increased buffer size to 8192 to accommodate larger d2s streams 2019-12-30 00:48:08 -08:00
Collin Smith
65e58e8bbe Added D2S serialization to Connection packet 2019-12-30 00:14:48 -08:00
Collin Smith
83476f6a65 Changed Sync to EntitySync, SyncData to ComponentP, Sync.data to Sync.component
Changed Sync to EntitySync, SyncData to ComponentP, Sync.data to Sync.component
This should result in cleaner API readability
Adjusted API slightly within NetworkSynchronizer + added note for future change
2019-12-29 15:29:53 -08:00
Collin Smith
5d7ecce6d7 Changed from IteratingSystem to BaseEntitySystem 2019-12-29 01:54:28 -08:00
Collin Smith
25e057c08a Only send connection packets to unconnected players -- prevents flooding until sync packets aggregated 2019-12-28 22:45:42 -08:00
Collin Smith
dd6dbca0f6 Enabled AI stepping with basic velocity adder system
Enabled AI stepping with basic velocity adder system
Created ServerAudio implementation of Audio which ignores Riiablo.audio calls
2019-12-28 01:25:44 -08:00
Collin Smith
a49f73f6c4 Added networking for object entities
Added networking for object entities
Casted cof component in flatbuffers to ensure they are sign extended properly (0xFF was not becoming 0xFFFFFFFF which is a special value)
Added additional check in CofManager#setComponent to ignore change if redundant
Increased output packet queue to 1024 -- will eventually group all sync packets into a single packet
2019-12-27 00:47:26 -08:00
Collin Smith
d3825290ee Changed EntityFactory API to better support networking
EntityFactory API now uses excel entry ids and lookup ids instead of references
Removed huge reliance on passing map references and instead use internal injected map and generated references
Fixed a bug where MapManager was inserting invalid entity ids that were causing a crash when searching through component mappers
2019-12-26 15:00:48 -08:00
Collin Smith
df14e4c18f Moved D2GS.Packet to separate Packet class 2019-12-25 15:44:06 -08:00
Collin Smith
b8a5049adb Added networking support for monster entities
Added networking support for dynamic object entities
Fixed issues with multiple packets in stream by prepending packet size
Fixed connection protocol for clients to wait until response received
Created Box2DDisposer system to destroy box2d bodies when an entity has Box2DBody removed
Created EntitySystemAdapter to simplify systems which are aspect event based (insert, removed, etc)
Removed Entity reference from Connection and changed to entity id instead
Renamed transform and alpha flag variables to tFlags and aFlags to remain consistent with elsewhere
Added DS1ObjectWrapperP to network DS1 objects (DS1 object reference is needed only for server-side/host)
2019-12-24 02:22:50 -08:00
Collin Smith
6b729c4350 Fixed some issues with connecting players -- connection protocol needs to be cleaned up more
ClientNetworkReceiver is disabled until Connection response is received
ClientNetworkSynchronizer will block until Connection response is received and drop other packets
Added ClassSerializer and DS1ObjectWrapperSerializer to transfer entity type and object data
Disabled networking on dynamic entities while I can determine issues with packet transfer
Added fix for AIStepper to make renderer bounds check optional -- will come up with a better solution to remove this client-only code
2019-12-23 03:10:45 -08:00
Collin Smith
ea040c318e Added networking for dynamic objects
Added networking for dynamic objects
Fixed disconnecting players not being removed from player ids table
NetworkSynchronizer conditionally processes based on if any players are connected
Disabled AIStepper when game is connected to a socket
2019-12-22 17:38:16 -08:00
Collin Smith
5d51a1c160 Created packet serializers
Created packet serializers and moved serialization code from NetworkSynchronizer into SerializationManager
2019-12-22 04:24:43 -08:00
Collin Smith
786cd255ee Implemented map generation step along with entity creation 2019-12-22 03:32:35 -08:00
Collin Smith
cbec965eb1 Appended P to sync component tables to remove need to fully qualify packet tables against components 2019-12-22 00:32:45 -08:00
Collin Smith
0018ebd500 Added initializer for Riiablo.strings 2019-12-21 22:16:01 -08:00
Collin Smith
866cdc0504 Added interactor and pathfind support to D2GS
Added interactor and pathfind support to D2GS
Removed some special case code from pathfinder -- was forcing reliance on client code in what should be server-only code
2019-12-20 13:59:43 -08:00
Collin Smith
c677ca415d Added support to set DT1 class to headless loading mode 2019-12-16 05:36:13 -08:00
Collin Smith
3669ffc57b Added support for creating entities for preexisting characters on new client instances 2019-12-15 02:06:35 -08:00
Collin Smith
8c38af053a Added network synchronization for position, velocity and angle 2019-12-15 01:25:26 -08:00
Collin Smith
15687b71c6 Improved D2GS client implementation
D2GS clients are now indexed using a fixed-size array
Connecting clients will now use the first available slot
Disconnecting clients will now have their corresponding entity deleted
Shutting down server will now wait for client threads to end
Removed separate iteration method for broadcast packets -- I don't think this distinction is necessary
Refactored AtomicBoolean with volatile boolean
Debug logging has been significantly been improved to indicate clients / packet types / remote addresses
2019-12-14 03:55:23 -08:00
Collin Smith
34eebb41aa Added disconnect packet and support for entity state synchronization
Disconnecting clients will now have a corresponding disconnect packet
Changing a players items will result in the change also appearing on other players' instances
2019-12-13 15:29:17 -08:00
Collin Smith
d296c6c647 Added support for disconnecting clients and broadcasting entity deletion 2019-12-12 15:22:31 -08:00
Collin Smith
e4df005987 Rewrote engine and replaced Ashley with Artemis
Rewrote engine and replaced Ashley with Artemis
Added basic networking support for D2GS (handshake and sending initial player state to clients)
2019-12-11 02:07:55 -08:00