Commit graph

47 commits

Author SHA1 Message Date
Haselnussbomber
c93f04f0e4
Code cleanup (#2439)
* Use new Lock objects

* Fix CA1513: Use ObjectDisposedException.ThrowIf

* Fix CA1860: Avoid using 'Enumerable.Any()' extension method

* Fix IDE0028: Use collection initializers or expressions

* Fix CA2263: Prefer generic overload when type is known

* Fix CA1862: Use the 'StringComparison' method overloads to perform case-insensitive string comparisons

* Fix IDE0270: Null check can be simplified

* Fix IDE0280: Use 'nameof'

* Fix IDE0009: Add '.this'

* Fix IDE0007: Use 'var' instead of explicit type

* Fix IDE0062: Make local function static

* Fix CA1859: Use concrete types when possible for improved performance

* Fix IDE0066: Use switch expression

Only applied to where it doesn't look horrendous.

* Use is over switch

* Fix CA1847: Use String.Contains(char) instead of String.Contains(string) with single characters

* Fix SYSLIB1045: Use 'GeneratedRegexAttribute' to generate the regular expression implementation at compile-time.

* Fix CA1866: Use 'string.EndsWith(char)' instead of 'string.EndsWith(string)' when you have a string with a single char

* Fix IDE0057: Substring can be simplified

* Fix IDE0059: Remove unnecessary value assignment

* Fix CA1510: Use ArgumentNullException throw helper

* Fix IDE0300: Use collection expression for array

* Fix IDE0250: Struct can be made 'readonly'

* Fix IDE0018: Inline variable declaration

* Fix CA1850: Prefer static HashData method over ComputeHash

* Fi CA1872: Prefer 'Convert.ToHexString' and 'Convert.ToHexStringLower' over call chains based on 'BitConverter.ToString'

* Update ModuleLog instantiations

* Organize usings
2026-01-06 08:36:55 -08:00
Haselnussbomber
64d4f7061a
Rename namespace PlayerState to Player 2025-11-17 19:29:48 +01:00
Haselnussbomber
4422622e1e
Add IPlayerState service 2025-10-05 13:49:25 +02:00
Kaz Wolfe
ff36f08d0c
bump cs, fix warnings 2025-08-04 21:11:06 -07:00
goaaats
731d7e0f6e Un-whether-or-not the codebase 2025-04-25 22:49:05 +02:00
Kaz Wolfe
2176b32219
chore: Bump ClientStructs and make it build again 2025-03-24 13:25:13 -07:00
Haselnussbomber
f98da094f4
Fetch market board uploader info from main thread (#2158) 2024-12-26 16:39:54 +01:00
KazWolfe
097f85eff6
Move more things to ClientStructs (#2080)
* GameGui uses CS methods now

Co-authored-by: Infi <infiziert@protonmail.ch>

* Shove even more things over to CS

* Clean up NetworkHandlers too

* bump cs so things build at least

---------

Co-authored-by: Infi <infiziert@protonmail.ch>
2024-11-14 08:29:28 -08:00
Infi
8668ea0d59
Fix universalis upload with itemId 0 (#2077) 2024-11-13 13:43:42 -08:00
Asriel Camora
0b9af0e3f4
Update to Lumina 5 (new Excel parsing) (#2022)
* Refactor and upgrade to new excel design

* Obsolete ExcelResolver<T> and use only RowRef<T>

* Better benchmarking for Lumina

* Add custom game-supported RSV provider

* Refactor and move Lazy<T> and nullable/cached row objects to RowRefs

* Convert IRSVProvider to delegate, resolve strings by default

* Split IExcelRow into IExcelSubrow

* Extra lumina documentation

* Minor RSV CS fixes

* Fix UIGlowPayload warning

* Fix rebase

* Update to Lumina 5
2024-10-20 19:59:03 -07:00
Infi
a4c234c4fa
Fix MarketBoardItemRequest & Universalis upload (#1888) 2024-07-03 18:36:18 +02:00
Kaz Wolfe
28ff62e488
fix errors/warnings 2024-06-16 16:45:18 -07:00
Blair
e160746d42
Add MarketBoard service and associated interfaces, test and data widget (#1822)
* Add MarketBoard service and associated interfaces, test and data widget
* Dispose of events properly
* Make listings readonly lists + provide internal list for internal use
* Rename CatalogId to ItemId on interfaces, have kept CatalogId internally as it's technically correct
* Removed RetainerOwnerId from the public interface
* Removed NextCatalogId from the public interface
* Updated test text
* Null events in scoped service disposal
2024-06-16 10:40:48 -07:00
goat
448b0d16ea
Add "loading dialog" for service init, unify blocking logic (#1779)
* wip

* hacky fix for overlapping event text in profiler

* move IsResumeGameAfterPluginLoad logic to PluginManager

* fix some warnings

* handle exceptions properly

* remove ability to cancel, rename button to "hide" instead

* undo Dalamud.Service refactor for now

* warnings

* add explainer, show which plugins are still loading

* add some text if loading takes more than 3 minutes

* undo wrong CS merge
2024-04-21 17:28:37 +02:00
Soreepeong
7f5ef03917 Use EarlyLoadedService for anything that is not mandatory for kicking off plugin loader 2024-04-07 21:53:23 +09:00
srkizer
87b9edb448
Add IInternal/PublicDisposableService (#1696)
* Add IInternal/PublicDisposableService

Plugins are exposed interfaces that are not inherited from
`IDisposable`, but services implementing plugin interfaces often
implement `IDisposable`. Some plugins may try to call
`IDisposable.Dispose` on everything provided, and it also is possible to
use `using` clause too eagerly while working on Dalamud itself, such as
writing `using var smth = await Service<SomeService>.GetAsync();`. Such
behaviors often lead to a difficult-to-debug errors, and making those
services either not an `IDisposable` or making `IDisposable.Dispose` do
nothing if the object has been loaded would prevent such errors. As
`ServiceManager` must be the only class dealing with construction and
disposal of services, `IInternalDisposableService` has been added to
limit who can dispose the object. `IPublicDisposableService` also has
been added to classes that can be constructed and accessed directly by
plugins; for those, `Dispose` will be ignored if the instance is a
service instance, and only `DisposeService` will respond.

In addition, `DalamudPluginInterface` and `UiBuilder` also have been
changed so that their `IDisposable.Dispose` no longer respond, and
instead, internal functions have been added to only allow disposal from
Dalamud.

* Cleanup

* Postmerge fixes

* More explanation on RunOnFrameworkThread(ClearHooks)

* Mark ReliableFileStorage public ctor obsolete

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-03-16 15:58:05 +00:00
Asriel Camora
2cdc1f0171
Fix duty pop chat message italics (#1697) 2024-03-05 17:13:43 +00:00
srkizer
b66be84b93
Better Service dependency handling (#1535) 2023-11-28 22:20:16 +01:00
KazWolfe
2083ccda00
Remove internal dependencies on opcodes (#1464)
- Removes the opcode lists from internal API entirely
- Move NetworkHandlers to use packet handler sigs
- Remove opcode data from NetworkMonitorWidget
2023-10-05 17:01:03 +00:00
MidoriKami
b742abe77f
Add ClientStatePluginScoped (#1384)
* Add ClientStatePluginScoped

* Restore InvokeSafely

* Add InvokeSafely for basic Action types.

* Set delegates to null to prevent leaking memory

* Resolve Merge
2023-09-21 21:55:16 -07:00
karashiiro
00f3ecc143 fix: Correctly handle MB pages with 0 listings 2023-02-22 07:45:41 -08:00
karashiiro
3b891e9e8d feat: Run network callbacks on the ThreadPool 2023-02-20 09:16:33 -08:00
karashiiro
20b3a75fc6 fix(network): Ensure correct MB history packets are being bundled
This injects the start packet into the history observable to
use it for validating the item ID in the history packets. Also
adds back some other validation as a safeguard.
2023-02-19 08:12:23 -08:00
karashiiro
90fda3a81b fix(network): use Observable.Create instead of Subject
http://introtorx.com/Content/v1.0.10621.0/04_CreatingObservableSequences.html
2023-02-17 11:31:56 -08:00
karashiiro
93fbd69530 feat(network): Send market board listings/sales in one request
This also removes a ton of state-management code that used to
make it difficult to express this logic cleanly.
2023-02-16 19:51:00 -08:00
karashiiro
6c8ed5c8d4 chore(network): Remove redundant ShouldUpload check 2023-02-15 22:48:46 -08:00
karashiiro
0f3a63420b feat(network): Combine purchase request and response event streams 2023-02-15 18:30:24 -08:00
karashiiro
ecf039a200 fix(network): Handle exceptions during observer streams 2023-02-15 18:09:31 -08:00
karashiiro
a5f0fe422a feat(network): use Rx.NET to refactor message handlers
This rephrases network messages as observables of data, which
handlers subscribe to in order to receive strongly-typed data.
This breaks up the massive network message handler into an
event stream, which should make it more maintainable in the
future.
2023-02-15 09:29:25 -08:00
goat
987ff8dc8f
chore: convert Dalamud to file-scoped namespaces 2022-10-29 15:23:22 +02:00
Stanley Dimant
2317d28b39 naming adjustments 2022-09-01 21:40:23 +02:00
Stanley Dimant
652b357341 add exception handling for some event delegates 2022-09-01 21:25:20 +02:00
Aireil
62f2531e18
fix: CfPop duty offset (#975) 2022-08-24 21:37:42 +02:00
kizer
716736f022
Improvements (#903) 2022-06-29 11:51:40 +02:00
kizer
3369f569fb
Add call-on-services-ready attribute for service methods, and fix scene nullability (#900) 2022-06-26 18:49:34 +02:00
kizer
8e7f370ddd
Load services asynchronously whenever possible (#893) 2022-06-24 22:12:51 +02:00
goaaats
040a96e36b
chore: fix defaults for Universalis 2022-04-05 18:14:15 +02:00
goaaats
0c9fd95478
feat: add mb collect checkbox to general settings 2022-04-03 03:07:28 +02:00
goaaats
a44e7210bc
fix: update MarketTaxRates, check category, add sharlayan 2021-12-03 14:28:24 +01:00
goat
1561fbac00
Revert "refactor(Dalamud): switch to file-scoped namespaces"
This reverts commit b5f34c3199.
2021-11-18 15:23:40 +01:00
goat
b5f34c3199
refactor(Dalamud): switch to file-scoped namespaces 2021-11-17 19:42:32 +01:00
Raymond
042558aa5e Cleanup, log with continuation tasks 2021-11-10 20:24:36 -05:00
Raymond
6c1b50174a Pull MBStart into a read method 2021-11-10 20:24:07 -05:00
Raymond
45520657fc HandleCfPop 2021-11-10 20:23:42 -05:00
Raymond
cd314529ae Update all the places 2021-09-03 23:20:49 -04:00
Raymond
ff1d7f2829 Implement service locator 2021-08-21 14:03:06 -04:00
Raymond
cb73a8f4b4 Move Game/Network files to the appropriate internal namespaces
Replace WebClient with HttpClient
2021-08-09 10:48:48 -04:00
Renamed from Dalamud/Game/Network/NetworkHandlers.cs (Browse further)