Commit Graph

1082 Commits

Author SHA1 Message Date
Collin Smith
088cde3b9e Ranamed SafeUnsigned to UnsafeNarrowing 2020-08-11 17:56:40 -07:00
Collin Smith
d8679e34e1 Committing BitUtils and SafeUnsigned 2020-08-11 01:07:35 -07:00
Collin Smith
e3fc03f240 Adjusted documentation and added ByteInput#readString(int,boolean) 2020-08-11 01:03:05 -07:00
Collin Smith
efce34ef8a Renamed len to maxLen 2020-08-11 00:55:04 -07:00
Collin Smith
8b31ee02a1 Bugfix 2020-08-11 00:28:59 -07:00
Collin Smith
e7ab37c01c Added methods to safely read unsigned values in their java signed limits 2020-08-11 00:24:53 -07:00
Collin Smith
871cadaa2b Moved BitConstraints#isUnsigned to BitUtils 2020-08-10 21:22:26 -07:00
Collin Smith
90564f39a3 Committing JUnit tests for BitOutput and interoperability 2020-08-10 18:43:01 -07:00
Collin Smith
9b0a3cf498 Filled remaining methods and changed write methods to support chaining 2020-08-10 18:35:45 -07:00
Collin Smith
8941ceee6e Implemented BitOutput#skipBits(long) and ByteOutput#skipBytes(int) 2020-08-10 18:34:54 -07:00
Collin Smith
984a0864ea Implemented writeString(CharSequence,int) 2020-08-10 18:34:12 -07:00
Collin Smith
2433fac1fe Implemented writeBoolean(boolean) and write1(int) methods to write a single bit 2020-08-10 18:33:40 -07:00
Collin Smith
4a00f0207f Relaxed requirements to allow writing 0 bits (a no-op) 2020-08-10 18:32:57 -07:00
Collin Smith
043e032ec5 Added getter for ByteInput ByteBuf for testing 2020-08-10 18:32:13 -07:00
Collin Smith
43b2eda1c6 Added method chaining support 2020-08-10 17:35:22 -07:00
Collin Smith
74d980319a Cleaned up flush and align methods
flush write cache and then erases it
align performs a flush and returns ByteOutput view
Reduced visibility of writeSigned and writeUnsigned
Implemented write signed methods
Implemented writeRaw method
Added getters for bitsCached and cache fields with package visibility
2020-08-10 01:49:36 -07:00
Collin Smith
66840f94d7 Refactored _writeUnsigned with _writeRaw with unsigned bit limits 2020-08-09 23:11:48 -07:00
Collin Smith
f901989e14 Implemented _writeRaw(long,int) 2020-08-09 23:05:38 -07:00
Collin Smith
11555397e3 Created ByteOutput and BitOutput 2020-08-09 20:06:06 -07:00
Collin Smith
4e2cd665cd Made bitsToAdd final 2020-08-09 20:05:44 -07:00
Collin Smith
f62c038ffe Added BYTE_MASK const (0xFF) 2020-08-09 20:05:31 -07:00
Collin Smith
97ebbb1dbb Additional assertion to validate invariants 2020-08-09 12:51:02 -07:00
Collin Smith
1b51043d7d Moved UBITS consts to BitConstants 2020-08-09 12:48:33 -07:00
Collin Smith
a9d33c2de8 Pulled unsigned masks out to BitConstants class 2020-08-08 23:06:36 -07:00
Collin Smith
c2ce0a3179 Added string reason for shift assertion failure 2020-08-08 17:53:50 -07:00
Collin Smith
7ed92b1f49 Replaced com.riiablo.io classes with com.riiablo.io.nio classes 2020-08-08 14:49:23 -07:00
Collin Smith
c8b74fccbf Commented out comments -- linter was thinking this class was deprecated 2020-08-08 14:46:32 -07:00
Collin Smith
acdbace5ea Deprecated and removed multi-byte read methods from BitInput
Unaligned multi-byte read operations shouldn't align stream
Implementing unaligned multi-byte read support is required
2020-08-08 14:40:11 -07:00
Collin Smith
7006ce9dc0 Added ByteBuf read-only invariant 2020-08-08 14:29:33 -07:00
Collin Smith
683d592c55 Created placeholder documentation to document relationship between input classes 2020-08-08 14:26:25 -07:00
Collin Smith
83ead2a990 Reduced #bitInput() method visibility -- unalign should be used instead outside of package 2020-08-08 14:24:47 -07:00
Collin Smith
f7a38d5e15 Documented ByteInput#bitInput(BitInput) invariants 2020-08-08 14:18:33 -07:00
Collin Smith
75ac29d698 Created bitInput() accessor to manage BitInput initialization and access 2020-08-08 14:15:51 -07:00
Collin Smith
20ae623fe7 Tightened up field visibility
Tightened up field visibility
ByteInput#bitInput set via bitInput(BitInput) which enforces invariants
2020-08-08 14:08:26 -07:00
Collin Smith
afd7bafa12 Fixed skipBits multi-byte using unaligned bit stream 2020-08-08 13:17:59 -07:00
Collin Smith
e62d3ec383 ByteInput#skipBytes now increments bitsRead 2020-08-08 12:04:51 -07:00
Collin Smith
99f0c11064 Created static factory method for constructing a BitInput from a byte array 2020-08-08 11:50:59 -07:00
Collin Smith
a244fbd09d Changed access to private 2020-08-08 11:48:01 -07:00
Collin Smith
f5ababed84 Renamed discard methods to skip 2020-08-08 11:45:37 -07:00
Collin Smith
f71d32bc51 Removed interfaces and added documentation to BitInput and ByteInput directly 2020-08-08 11:44:26 -07:00
Collin Smith
3e31869417 Fixed NPE caused by lazily initializing BitInput 2020-08-08 10:51:50 -07:00
Collin Smith
1868a8c089 Renamed discard methods to more explicit ByteInput#discardBytes and BitInput#discardBits 2020-08-08 03:49:36 -07:00
Collin Smith
3e6e2c05ce Changed ByteInput to lazily allocate BitInput object
BitInput not always required, mostly only ByteInput is used
Removed specialized BitInput constructors from ByteInput
ByteInput#unalign will allocate a BitInput of readableBytes size
BitInput#readSlice will allocate a BitInput of specified size
2020-08-08 03:47:36 -07:00
Collin Smith
673b437c61 Committing com.riiablo.io.nio experiment
Replaces com.riiablo.io if I decide to go this route
2020-08-08 01:07:28 -07:00
Collin Smith
dd1444ad9a Created com.riiablo.io with BitInput
Version 1 without full functionality
2020-08-07 12:17:54 -07:00
Collin Smith
cfb2850d92 Created more robust BitStream implementation
Pending validation, will deprecate and replace com.riiablo.codec.util.BitStream
2020-08-05 19:57:54 -07:00
Collin Smith
84748c56a3 Implemented skipUntil function to allow recovery attempts
skipUntil will align the bit stream to next byte and search for a 2 byte signature
2020-08-03 20:21:46 -07:00
Collin Smith
294f74dde3 Added warnf without Throwable arg 2020-08-03 20:17:28 -07:00
Collin Smith
65a8dee1eb Removed readU8 and replaced with equivalent appropriate substitutions 2020-08-03 16:29:21 -07:00
Collin Smith
0050720249 Implemented some use-cases for readRaw
Implemented some use-cases for readRaw and readU63
Replaced some Java primitive size consts with actual bit sizes according to d2 spec
2020-08-03 16:22:28 -07:00
Collin Smith
a0a46dc481 Changed DCC outsizeCoded from int to long to ensure it can hold a u32 2020-08-03 16:20:32 -07:00
Collin Smith
af480bdfc3 Created readRaw(int) and added support for correctly reading signed 64 bits 2020-08-03 16:12:52 -07:00
Collin Smith
d1ee547530 Created BitStream#readU63(int) 2020-08-03 16:11:59 -07:00
Collin Smith
55d1f18463 Renamed readUnsigned8OrLess to readU8 2020-08-03 16:06:05 -07:00
Collin Smith
8c9d51ee03 Renamed readUnsigned31OrLess to readU31 2020-08-03 16:04:46 -07:00
Collin Smith
10f8945ddb Renamed readUnsigned15OrLess to readU15 2020-08-03 16:03:45 -07:00
Collin Smith
70200c5521 Renamed readUnsigned7OrLess to readU7 2020-08-03 16:02:56 -07:00
Collin Smith
a8e2402a19 Disabled skipping of item byte stream signature
ItemSerializer will process and validate item signature
Implemented far more robust logging to ItemSerializer
2020-08-02 11:11:59 -07:00
Collin Smith
e8f359ffa2 Changed return type of readSigned from sign extended int to long 2020-07-28 04:59:49 -07:00
Collin Smith
5f2c2ca999 Removed read*BitsOrLess and replaced with casted readUnsigned 2020-07-28 04:54:28 -07:00
Collin Smith
940addbca1 Improved assertion messages 2020-07-28 04:46:34 -07:00
Collin Smith
fa2594048c Function ordering 2020-07-28 04:38:36 -07:00
Collin Smith
148a8e108e Validate bit args, formatting and removed read0Bits function 2020-07-28 04:36:58 -07:00
Collin Smith
25b428cb04 Rolled CTX functions into Log 2020-07-26 02:12:51 -07:00
Collin Smith
8067e6fec3 Added support for full mode output for MDC layout 2020-07-25 18:31:06 -07:00
Collin Smith
d18885b17c Marked writeEntry with OrderedMap as deprecated 2020-07-25 18:22:50 -07:00
Collin Smith
4eed3a819e Deprecated OrderedMap impl -- only a decorator for ThreadContext map methods 2020-07-25 18:18:44 -07:00
Collin Smith
c56431b57f Replaced CTX impl with ThreadContext impl 2020-07-25 18:16:08 -07:00
Collin Smith
29ea674060 OrderedMap impl of ThreadContextMap -- deprecated but may be of use later 2020-07-25 17:35:36 -07:00
Collin Smith
f52d47c235 Added Log4J2 as a dependency (see #88)
Created log package with wrappers on top of Log4J
2020-07-25 14:35:38 -07:00
Collin Smith
1d78fb5844 Fixed formatting 2020-07-24 02:24:23 -07:00
Collin Smith
e90ed609aa Fixed formatting 2020-07-24 02:23:00 -07:00
Collin Smith
fcd49c337b Fixed format 2020-07-22 01:31:11 -07:00
Collin Smith
a171783286 Improved support for printList
Adding ability to print all values in-line
If padEnd doesn't pad any chars, will append a single space char
2020-07-20 14:26:10 -07:00
Collin Smith
7bb5110f82 Added suggester for connect command to auto write localhost ip address 2020-07-20 04:50:14 -07:00
Collin Smith
4ca93620b5 Partial decoupling of Item from UI code
Moved Actor-related fields to ItemWrapper
ItemWrapper unfortunately remains a field within Item (see #91)
Renamed INSTORE and created Item#flags2 field to track riiablo item flags
2020-07-19 05:52:05 -07:00
Collin Smith
ebac0a1a6c Fixed network crash -- todo stub out vendor generation when networked #89 2020-07-19 05:37:37 -07:00
Collin Smith
f0a1cdfdb5 Moved helper functions from ItemUtils to Item 2020-07-19 01:38:08 -07:00
Collin Smith
b6c21abbf7 Fixed deserialization bug and appended additional fields to Item#toString 2020-07-18 02:39:52 -07:00
Collin Smith
47d96abde4 Implemented dispose 2020-07-18 02:08:34 -07:00
Collin Smith
6a23fde852 Changed qualification of RareQualityData 2020-07-18 02:06:16 -07:00
Collin Smith
0306c60850 Created ItemWrapper class which is an Actor that wraps an Item
Added static util methods to ItemUtils
This is experimental to play with simplifying Item class
2020-07-18 02:05:48 -07:00
Collin Smith
90971e57b8 Extracted RunewordData and RareQualityData to upper level 2020-07-18 02:03:23 -07:00
Collin Smith
2db28a4c4f Added ethereal alpha const 2020-07-18 02:02:25 -07:00
Collin Smith
c066cb5627 Added convenience methods for checking identified and ethereal flags 2020-07-18 02:01:59 -07:00
Collin Smith
36a7ab73d1 Experimentation with decoupled Item class hierarchy 2020-07-17 18:06:38 -07:00
Collin Smith
b62d397c2e Fixed bug where item data initialization would read data outside bounds 2020-07-16 19:31:08 -07:00
Collin Smith
623859681b Removed QUEST flag declaration -- appears incorrect 2020-07-14 15:40:54 -07:00
Collin Smith
0bd809ef2d Changed visibility of flag consts to public 2020-07-14 13:48:18 -07:00
Collin Smith
30d574a537 Blocked UI events for items that have INSTORE flag set 2020-07-13 19:06:45 -07:00
Collin Smith
417347e4e9 VendorGenerator sets INSTORE flag and item display will show the item's 'cost' in details 2020-07-13 18:05:21 -07:00
Collin Smith
cfcf709ec3 Filled out some basic item generation
Filled out some basic item generation
Disabled until item generation progresses more
2020-07-13 17:53:48 -07:00
Collin Smith
a57ce99e5e Added gemsockets column to ItemEntry and improved MaxSock support in ItemTypes 2020-07-13 15:56:23 -07:00
Collin Smith
61ec4e821a Added basic check to prevent invalid magic items from generation 2020-07-12 18:30:18 -07:00
Collin Smith
b9f0b25765 Disabled debug mode for VendorPanel 2020-07-12 18:27:45 -07:00
Collin Smith
e161df36b8 Added rows for other acts 2020-07-12 18:26:54 -07:00
Collin Smith
2e774fd953 Added support for distinct vendor inventories
Added support for distinct vendor inventories
No inventory component yet -- generated each time vendor loaded
Moved VendorPanel inventory management to Npc for time being (from UI to a system)
Modified VendorPanel#config signature to include inventory item list
Created VendorGenerator#generate(String) to generate an inventory for a specified vendor
Added ItemGenerator and VendorGenerator systems to various engines
2020-07-12 17:11:05 -07:00
Collin Smith
bda2b7152b VendorGrid#drain clears children 2020-07-12 16:56:29 -07:00
Collin Smith
fe863584a4 Fixed layout bugs with two items occupying same bounds and not fitting within grid area 2020-07-12 16:55:29 -07:00
Collin Smith
be0d08698b Empty vendor tabs will be hidden 2020-07-12 16:17:03 -07:00
Collin Smith
3c7b35bc5d Added support for generating items for vendor inventory
Created vendor generator which uses reflection to access item data and generate items
Added stub item generation for armor and weapons
Changed visibility of ItemGrid#addItem to protected (from public)
ItemGrid#addItem vis will revert when drain function is moved up class hierarchy
Modified signatures of VendorGrid#place* methods and function
VendorGrid#place* now returns boolean if the item can be placed
VendorGrid#place* stores available coords in input coords parameter
Added columns for base item vendor entries and noted issue with hratli
Added Excel#getEntryClass to retrieve the entry class type via reflection
VendorPanel populates tabs using "akara" columns
2020-07-12 16:11:28 -07:00
Collin Smith
ad7e1431d0 Added condition for max y placement 2020-07-12 12:29:14 -07:00
Collin Smith
c8b69868b5 Added todo comment for excel column feature 2020-07-12 00:43:41 -07:00
Collin Smith
19a7f10766 Added basic support for VendorPanel VendorGrid items
Added basic support for VendorPanel VendorGrid items
Added very basic ItemGenerator class to create Item instances
VendorPanel tabs now support distinct grid objects
VendorPanel will display the grid for the active tab
Added basic sort and layout function in VendorGrid to place items
VendorPanel MISC tab has sample data injected
2020-07-11 14:09:51 -07:00
Collin Smith
518ce4fb2e Fixes #87 2020-07-10 22:18:45 -07:00
Collin Smith
d81740bd23 Changed toString 'type' field to 'code' 2020-07-10 16:21:41 -07:00
Collin Smith
91e2dd8851 Created an item version code for riiablo, anticipating serialization incompatibility 2020-07-10 16:14:16 -07:00
Collin Smith
c6e9929f88 Created constants for item version codes 2020-07-10 16:13:30 -07:00
Collin Smith
f1f64fca24 Exposed item flags to package visibility 2020-07-10 16:12:49 -07:00
Collin Smith
faf5354276 Added reference to item type2 entry and aggregated type to be logical oring of type and type2 bits 2020-07-10 15:54:33 -07:00
Collin Smith
3b958f3afa Renamed typeCode to code
Renamed typeCode to code (was confusing with type and type2)
Changed EAR flag to automatically set code to 'ear'
2020-07-10 15:42:22 -07:00
Collin Smith
101c6c2b0a Added support for aggregating multiple types
Added support for aggregating multiple types
Included pre-defined types for the cartesian products of gem types and qualities
2020-07-09 04:04:29 -07:00
Collin Smith
ee23568f2b Added index for 'none' item type 2020-07-09 04:03:15 -07:00
Collin Smith
5dd1122c0d Added getHexString to return hex representation of set bits 2020-07-09 02:18:42 -07:00
Collin Smith
ce886d1031 Moved toString method to getOrdinalString and made toString delegate 2020-07-09 02:17:43 -07:00
Collin Smith
c39f3e47b7 Changed default numBits to 0x7F (127) 2020-07-09 02:12:27 -07:00
Collin Smith
ed17dfda20 Renamed UNK3 -> GROUND 2020-07-08 00:30:31 -07:00
Collin Smith
9bb02ec9ac Added consts for Item modes (unused) 2020-07-07 12:08:52 -07:00
Collin Smith
eb06205951 Renamed Location UNK3 -> GROUND 2020-07-07 12:08:15 -07:00
Collin Smith
2e2eae85bc Updated item flags 2020-07-07 12:07:31 -07:00
Collin Smith
31a181ec1f Added additional material types 2020-07-05 01:41:39 -07:00
Collin Smith
31c24a054e Added support for playing footstep sounds for client's player
Added Map#material(int,int) and Map#material(Vector2)
FootstepEmitter uses internal trigger frames instead of AnimationListener
Only works for Riiablo.game.player entity
This should be a good starting point for adding support for other entities
2020-07-05 01:33:44 -07:00
Collin Smith
596c430a15 Added function in Map.Zone to retrieve material type for tiles 2020-07-05 00:31:26 -07:00
Collin Smith
311c06b3ab Refactored DT1Materials to Material and aggregated functionality 2020-07-04 23:49:32 -07:00
Collin Smith
5166988466 Added parameter to addStateListener to control initialization
Param `init` tells whether or not StateListener#onLoaded is called
2020-07-04 18:45:25 -07:00
Collin Smith
ed0db89720 Added support for debugging tile materials within renderer 2020-07-04 17:08:48 -07:00
Collin Smith
3970e649ab Fixed issue with resetting cursor on mobile 2020-07-04 12:02:22 -07:00
Collin Smith
59c0f5ab11 Implemented support for buy, sell and repair cursors 2020-07-04 11:20:40 -07:00
Collin Smith
eeea7adde3 Improved cursor features
Added support for hotspot offset
Added methods that support setting a cursor with a specific page in a DC
Setting cursor to predefined cursor DC automatically applies hotspot
2020-07-04 11:20:19 -07:00
Collin Smith
9bf83e683a Buy, sell and repair buttons are now managed by a button group 2020-07-04 10:21:50 -07:00
Collin Smith
eff7d8cdd8 Reset buy/sell to unchecked state when config called 2020-07-04 02:41:20 -07:00
Collin Smith
dfbd3a3e6f Changed buy/sell buttons to be mutually exclusive 2020-07-04 02:40:47 -07:00
Collin Smith
9e56ff51db Removed clicklistener for blank buttons 2020-07-04 02:39:01 -07:00
Collin Smith
0b38050429 Added support for using VendorPanel for gambling
Added support for using VendorPanel for gambling
TBD if this will require any major modifications
2020-07-04 02:32:26 -07:00
Collin Smith
0af512b3f4 Interacting with NPC menus will now show the vendor panel
Interacting with NPC menus will now show the vendor panel
Added support for configuring panel buttons using flags
Added blank buttons for each vendor action (even if unused)
2020-07-04 02:28:15 -07:00
Collin Smith
8a2be22c20 Created VendorGrid impl of ItemGrid
VendorGrid blocks all grid actions and accepts no items
Added showFill field to ItemGrid to draw background for cursor item
2020-07-04 01:46:27 -07:00
Collin Smith
92673c0da9 Created VendorPanel 2020-07-04 01:35:14 -07:00
Collin Smith
fba74adb74 Added i18n factory method to create instances with resolved string id 2020-07-04 01:18:08 -07:00
Collin Smith
475018e6f6 Fixed invgold position and size 2020-07-04 01:17:34 -07:00
Collin Smith
1977b0e93a Rolled back change on func check for dsc2line 2020-07-03 20:04:37 -07:00
Collin Smith
6e2ded3550 Improved layout of spell details text 2020-07-03 19:56:49 -07:00
Collin Smith
76643ef2a9 Changed SpellsPanel to support event-based updating
SpellsPanel is now a CharData.SkillListener and is event based
SpellsPanel no longer statically generates it's data when created
Created SpellsPanel.SpellButton impl which wraps each class-specific spell
SpellsPanel.SpellButton has an update method to be called whenever the wrapped spell changes
Label for spell button level moved to child of button and relative to button location
Added Label(LabelStyle) constructor for labels that are defaulted to empty
2020-07-03 15:40:04 -07:00
Collin Smith
8e4c4a5154 Added support for animated cursor 2020-07-03 01:34:09 -07:00
Collin Smith
f8e0c62646 Documented reasoning for deprecation 2020-07-02 18:47:31 -07:00
Collin Smith
fc6d8b0039 Added basic toString implementation 2020-07-02 18:34:49 -07:00
Collin Smith
b47a021679 Moved impl netty code to server:netty module 2020-06-30 10:30:34 -07:00
Collin Smith
03ae8f103c Added SocketAddress from parameter to packet callbacks
from paramter will be either TCP channel remote address or UDP packet sender
2020-06-27 15:58:25 -07:00
Collin Smith
3906fbdf4c Added support for reversing Animation direction 2020-06-27 01:29:01 -07:00
Collin Smith
1781e46724 Created experimental Netty impl of a TCP D2GS server
Created experimental Netty impl of a TCP D2GS server
Added salt field to Netty Connection fbs
Created ConnectionState for Connection fbs
2020-06-27 00:30:15 -07:00
Collin Smith
127186f385 Updated comment note 2020-06-26 18:56:42 -07:00
Collin Smith
d1270b1a75 Created UnicastEndpoint interface on top of Endpoint
Allows sending a message and letting the Endpoint figure out where it should go
Will only be used for client-side endpoints
2020-06-26 13:53:54 -07:00
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
9c586f90d0 Fix to prevent profiler activation key from triggering when console is open 2020-06-25 19:37:51 -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
57a8c1167e Fixed debug logging for inbound messages 2020-06-25 14:47:28 -07:00
Collin Smith
17d257b2b0 Improved memory usage metrics and created #80 2020-06-25 13:32:09 -07:00
Collin Smith
b9bf27d2f6 Added heap usage to display 2020-06-25 13:04:46 -07:00
Collin Smith
31af776e42 exceptionCaught will log the error and close the connection -- will add proper pipeline later 2020-06-25 12:44: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
24eb6f1c9b Fixed bug and missing dependency preventing MapViewer from running correctly 2020-06-23 18:41:45 -07:00
Collin Smith
d13fb953d5 Added comments explaining the need for some buffer position manipulations 2020-06-20 14:29:48 -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
a8fe6bc732 Removed Header table from fbs and inlined fields within the Netty table 2020-06-20 00:21:04 -07:00
Collin Smith
101cc92be4 Added protocol field to netty packet header 2020-06-19 15:01:01 -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
eda10f1da9 Small optimization 2020-06-13 17:45:36 -07:00
Collin Smith
07d98015fd Fixed code formatting and removed fully qualified com.riiablo.codec.COF references 2020-06-13 01:25:19 -07:00
Collin Smith
6be70a3667 Changed parameters for hits ObjectSet -- libgdx changed the parameter check an doesn't allow 1.0f load factor 2020-06-12 22:28:34 -07:00
Collin Smith
eb2d672ac1 Improved accuracy of networking ping calculation #77 2020-06-12 20:08:58 -07:00
Collin Smith
cbfae0f702 Cleaned formatting and alignment 2020-06-12 19:22:50 -07:00
Collin Smith
97b1a3d2d3 Removed static methods and management structs from SystemProfiler
Created ProfilerManager passive system to act as a manager and factory for SystemProfiler instances
Changed SystemProfiler static functions to be a ProfilerManager instance via injection
Fixed some UI bugs within SystemProfiler GUI including incorrect width
Added reference to ProfilerSystem within CursorMovementSystem to block input events when profiler GUI is open
Removed ProfilerSystem#dispose() -- ProfilerManager has it's own dispose method
Reduced visibility of SystemProfiler constructors -- instances should only be created by ProfilerManager
SystemProfiler#initialize() will no longer add the instances to a struct -- automatically added when created by ProfilerManager factory
2020-06-12 17:47:05 -07:00
Collin Smith
8f04cb5c94 Removed dependency on net.mostlyoriginal.artemis-odb:contrib-plugin-profiler
Replaced with com.riiablo.profiler
Copied contrib-plugin-profiler GUI skin to internal assets
2020-06-12 16:04:05 -07:00
Collin Smith
42ff871f38 Removed unneed code 2020-06-12 15:52:43 -07:00
Collin Smith
1c920b461c Created profilers for ping and rtt metrics #77
Implemented averaging of network latency samples via NetworkProfiler
NetworkProfiler handles the interfacing between Profiler plugin and Pinger system
Created IntervalBaseSystem which is a copy of IntervalSystem without dependency on any Aspect
Added support for a PacketListener for Pinger system (receives callbacks for received ping packets)
2020-06-12 15:51:56 -07:00
Collin Smith
2e9e3f2b1f Created a SystemProfiler for CPU and CPU parts of a frame
Created actual SystemProfiler instances for sampling CPU and GPU frame times
CPU and GPU frame times are now graphed with each system (adding them should give total frame time)
Added sample field to SystemProfiler to store value of last call to SystemProfiler#sample(long)
Removed CPU and GPU profiling from ProfilerSystem
2020-06-11 18:39:43 -07:00
Collin Smith
fcd4fa607f Created metrics for tracking CPU and GPU time
Rewrote artemis-odb-contrib/contrib-plugin-profiler
Profiler was too restrictive and privated many useful fields and had static methods, yuk
Profiler plugin will always run and the key will only hide the UI (and set it as GPU system)
Profiler plugin will maybe be modified in the future to be more extensible
Extended profiler plugin to support tagging systems as GPU systems
I'd like to know which systems are slow and track CPU/GPU bottlenecks on mobile
2020-06-11 01:19:49 -07:00
Collin Smith
b1a3411073 Created Metrics class and moved metric fields to it
Metrics will have more metric fields added as we go
2020-06-10 00:32:14 -07:00
Collin Smith
3c08bfbf04 Added RTT field to Pinger 2020-06-09 22:36:48 -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
da152ff5c6 Created constants for Client.Display.DrawFPS values 2020-06-06 22:53:28 -07:00
Collin Smith
da53dabad6 Aggregated Connection and Disconnect fbs into Networking fbs
Removed old individual fbs for Connection and Disconnect
Reordered D2GSData to group Networking packets
2020-06-06 18:17:21 -07:00
Collin Smith
ff34dea994 Created PlayerController flatbuffer spec file
Removed individual fbs for player movement packet definitions
Changed (Walk|Run)ToEntity packets from id to entityId
2020-06-06 18:06:16 -07:00
Collin Smith
d6e973f2f2 Fixed GroundToCursor code to use client-side entity id and pass along server-side entity id 2020-06-05 13:28:38 -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
013b22a169 Added local and server entity id to entity debug info 2020-06-05 13:16:58 -07:00
Collin Smith
4bef27052c Disabled optimize imports on the fly for the specified classes
Flatbuffers files were being modified by IntelliJ before committing
2020-06-04 20:16:02 -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
7301c483ca Posting Deleted component 2020-06-04 19:24:33 -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
7aa3f448ee Removed extra logging 2020-06-03 20:29:21 -07:00
Collin Smith
faf8743a75 Fixed an issue where picking up networked item wasn't loading assets
ClientEntityFactory#createItem now calls Item#load()
Cursor will run Item#checkLoaded on cursor item and attempt setting cursor when loaded
2020-06-03 17:35:59 -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
829eb608a7 Workaround for #75 2020-06-01 17:24:44 -07:00
Collin Smith
970073296c Created NetworkedClientItemManager subclass of ClientItemManager
Changed ClientItemManager to delegate to Riiablo.charData
NetworkedClientItemManager posts item management requests to the client's socket
2020-05-31 23:55:33 -07:00
Collin Smith
3723e4dc2e Created packets for item management (DropItem and PickupItem are now deprecated and will be removed eventually) 2020-05-31 03:49:00 -07:00
Collin Smith
921fdfd2e2 Changed ClientItemManager to delegate to a certain ItemController 2020-05-31 03:22:39 -07:00
Collin Smith
206875d2a0 Introduced ItemController interface and ClientItemManager
ItemController created to allow swappable interfacing between CharData and ClientItemManager
ClientItemManager engine system added (defers to Riiablo.charData temporarily)
Added dependency injection for ItemController to allow wiring
Changed item management panels to use ItemController injection instead of Riiablo.charData directly
2020-05-31 01:00:46 -07:00
Collin Smith
94e2b379e7 Removed unneeded annotation 2020-05-30 20:36:39 -07:00
Collin Smith
2cecdccdd9 Added additional debug logging for CharData item management calls 2020-05-30 20:21:35 -07:00
Collin Smith
b798645f02 Fixed issue where dropping an item wasn't removing it from ItemData 2020-05-30 20:15:08 -07:00
Collin Smith
46581d11e1 Renamed item pickup and drop functions to more closely match other item functions
pickup -> groundToCursor
drop -> cursorToGround
2020-05-30 16:49:40 -07:00
Collin Smith
24d0a07cea Added support for picking up items from ground 2020-05-30 16:46:49 -07:00
Collin Smith
7336c2a3b0 Moved ItemData#drop and added ItemManager#dropCursor 2020-05-30 16:35:37 -07:00
Collin Smith
6280e89d8b Added support for dropping cursor item to ground 2020-05-30 16:30:02 -07:00
Collin Smith
d910a6026a Removed qualification from INVALID_ITEM within ItemData 2020-05-30 16:22:01 -07:00
Collin Smith
c6468eb788 Created ItemManager system to interface char data item events with engine 2020-05-30 16:17:50 -07:00
Collin Smith
e1443d0acf Renamed ItemManager to ItemEffectManager 2020-05-30 16:16:51 -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
c4d2bc58a5 Extended new char data API
Added some additional load methods and util functions
Added some backwards compat functions to grab item index, etc
D2S#copyTo(CharData) calls D2S#loadRemaining automatically
Added CharData#obtain to return an uninitialized (possibly dirty) CharData
Added CharData#preloadItems which loads player and merc items
CharData#load(D2S) will set CharData to managed
2020-02-03 15:25:00 -08:00
Collin Smith
63c46de6bf Added notification to subscribers when skills changed via item update 2020-01-18 19:19:15 -08:00
Collin Smith
caef08f56a Refactored line order 2020-01-18 19:15:41 -08:00
Collin Smith
2d4b2a72a9 Added support for updating stats
Implemented support for updating items, item stats, and applying stats to ItemData attributes field
Added reference to CharStats.Entry to ItemData -- this may be removed when hireling stats are implemented more thoroughly
Added clear method in CharData to support chaining CharData reset methods clear().load(D2S)
Added empty base stats for hireling -- fixes issues with applying hireling stats to their own Attributes
2020-01-18 15:10:44 -08:00
Collin Smith
f5552947dc Added sets parameter to Item#update
Passed sets map should correspond to any set-counting entity (player or hireling)
Added fix to ignore CharStats.Entry field in Attributes#op if null (for hirelings)
2020-01-18 15:03:54 -08:00
Collin Smith
b5303828a9 Changed Item#update(CharData) to Item#update(Attributes,CharStats.Entry)
This is intended to decouple CharData from Attributes application for hirelings
2020-01-18 02:54:24 -08:00
Collin Smith
a8999db873 Fixes crash when opening HirelingPanel before items have finished loading 2020-01-18 02:52:39 -08:00
Collin Smith
d8ff97e4a5 Added LocationListener to subscribe to item location changes (specifically for belt and possibly cursor as well) 2020-01-17 03:16:35 -08:00
Collin Smith
57589f7312 Moved pickup and store methods to ItemData
Added support for store listeners
CharData store methods are now simple calls up to player ItemData reference
2020-01-16 16:17:54 -08:00
Collin Smith
d20f8fcab4 Renamed location methods to store since they are placing items in store locations 2020-01-16 15:58:45 -08:00
Collin Smith
3055ccccd5 Added update listener
CharData now implemented Pool.Poolable interface for future Pooling support
Changed CharData to implement factory pattern for pooling
2020-01-16 02:04:11 -08:00
Collin Smith
1666c528e7 Moved AlternateListener to ItemData 2020-01-11 17:15:40 -08:00
Collin Smith
0c48569120 Moved alternate field to ItemData
Removed some ItemData related methods from CharData for the time being
Moved initial stat assignments to reset method since only set at initialize
Started implementing stat tracking in ItemData instead of CharData
Above change needed because merc stats should track differently than player
Changed initial value for cursor field to INVALID_ITEM for consistency
2020-01-11 15:10:17 -08:00
Collin Smith
62bee72c93 Added equip and unequip support to ItemData
Equip and unequip manage equipped enum map and set counter updates
Changed EquipListener onChanged to onEquip and onUnequip
Removed support for swapping equip items within a single call (swapping is an aggregate now)
UpdateSets changed to updateSet that will add or remove item based on add parameter
Added Attributes field to ItemData constructor -- items will apply attrs to this field
2020-01-11 02:03:39 -08:00
Collin Smith
6cbea53c19 Moved alternate listener to separate CharData.AlternateListener class
This change removed need for EquipAdapter
2020-01-10 19:22:39 -08:00
Collin Smith
997c57ad5e Committing first iteration of CharData redesign
Changed API to work with item indexes (should simplify networking code)
Created ItemData abstraction to separate player and merc items
Moved set item fields to ItemData since they should eventually be distinct
Created EnumIntMap as a better primitive container for enum ordinals
D2S is now a container for saves, not the operational data itself
D2S CharData changes are intended to decouple them both and make D2S specifically to serialize and deserialize the data
2020-01-10 17:48:58 -08:00
Collin Smith
9b78c010e9 Added CharData to Item#update() parameters -- cannot rely on Riiablo.charData in multiplayer cases 2020-01-07 14:07:59 -08:00
Collin Smith
23376c4bdc Closes #72 2020-01-07 02:22:36 -08:00
Collin Smith
f685184c3c Changed some method names
Renamed getEquipped to getSlot since this returns the equipped item at the specified slot
Renamed getEquipped2 to getEquipped since this will return the item at the properly alternated slot (the equipped item)
2020-01-07 01:09:27 -08:00
Collin Smith
ec63e6806d Added constants for difficulties 2020-01-07 00:46:20 -08:00
Collin Smith
1cb5e160d2 Resolved todo -- replaced static NUM_DIFFS field with pointer to Riiablo.MAX_DIFFS 2020-01-06 17:25:22 -08: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
b534fed719 Created engine consts for acts and diffs 2020-01-06 14:09:31 -08:00
Collin Smith
c9a5e50a1c Renamed charClass to classId 2020-01-06 01:35:05 -08:00
Collin Smith
0768b5b8cc Renamed getSkill to getAction 2020-01-04 14:54:48 -08:00
Collin Smith
dc1aff5b4a Fixed log tag error 2020-01-04 02:10:56 -08:00
Collin Smith
a1bca12d62 Defer item inv file finish loading to future frame 2020-01-01 03:20:44 -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
f5179bbaaa Changed CofAlphas packet from float32 to uint8 (fixed point) 2019-12-30 02:39:57 -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
25e057c08a Only send connection packets to unconnected players -- prevents flooding until sync packets aggregated 2019-12-28 22:45:42 -08:00