Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Development
Sadie: A clean code Habbo emulator
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="habtard" data-source="post: 481407" data-attributes="member: 90778"><p>Thanks! ADO.NET which I've tried to abstract down with a base class etc (see <a href="https://i.imgur.com/FnH2aSM.png" target="_blank">here</a> & <a href="https://imgur.com/UJymHXS" target="_blank">here</a>), its very verbose, something like <a href="https://github.com/DapperLib/Dapper" target="_blank">Dapper</a> or maybe even entity framework could really help with not writing so much code for that.</p><p></p><p>Yep, adding parsers was one step to reducing the coupling so eventually I can seperate the responsibilities like you describe.</p><p></p><p>Also yeah, using something like reflection to recursively register the events would be much easier as its an ever growing complexity otherwise, will look into this soon.</p><p></p><p>It's good to see people being constructive.</p><p>[automerge]1711880244[/automerge]</p><p>Few more updates</p><p></p><p>Did some work on club offers, now loading them from the database.</p><p></p><p>[ATTACH=full]15675[/ATTACH]</p><p>[ATTACH=full]15676[/ATTACH]</p><p>[ATTACH=full]15681[/ATTACH]</p><p></p><p>Added <a href="https://github.com/khellang/Scrutor" target="_blank">Scruptor</a> (adds extension methods to M.E.DI) for easier service registration:</p><p></p><p>[ATTACH=full]15682[/ATTACH]</p><p>[automerge]1711892795[/automerge]</p><p>Refactored events so each one declares its packet identifier via a property (auto mapping).</p><p></p><p>[ATTACH=full]15684[/ATTACH]</p><p>[automerge]1711964997[/automerge]</p><p>Bit off topic... I wanted to improve code quality and enforce certain rules for Sadie but couldn't find anything better than a basic linter.</p><p></p><p>I spent some time last night writing a really rough C# analyzer, it uses the Roslyn .NET compiler and provides abstractions for things like class and individual method line count, parameter counts, etc</p><p></p><p>It runs off a config file like so:</p><p>[ATTACH=full]15707[/ATTACH]</p><p></p><p>zsh alias for pre-commit</p><p>[ATTACH=full]15710[/ATTACH]</p><p></p><p>It returns the suggestions count as its exit code (!= 0 will fail) for things like <a href="https://circleci.com/" target="_blank">CircleCI</a></p><p>[ATTACH=full]15709[/ATTACH]</p><p></p><p>Back on topic...</p><p></p><p>Commands now define their own trigger keyword via an attribute, instead of defining a collection map.</p><p></p><p>[ATTACH=full]15711[/ATTACH]</p><p></p><p>Other highlights</p><ul> <li data-xf-list-type="ul">Done a ton of refactoring with suggestions from the code-quality-checker.</li> <li data-xf-list-type="ul">Started moving catalog packet writers to shared serializers so the code stays DRY</li> <li data-xf-list-type="ul">Spent some time playing with Entity Framework, will (probably?) switch Sadie to it soon.</li> </ul><p>[automerge]1712075582[/automerge]</p><p>Spent the day working through some refactoring, room paint settings, and catalog front page items.</p><p></p><p>Packets now pass front page items, loads from db, etc:</p><p>[ATTACH=full]15715[/ATTACH]</p><p></p><p>[ATTACH=full]15719[/ATTACH]</p><p></p><p></p><p>Room painting done, wall and floor thickness, as well as paint for floor, wall and landscape (see discord for screen cast, can't upload), plus a few other trello items.</p><p>[automerge]1712155406[/automerge]</p><p>Busy upgrading a few things with my set up today but a few commits:</p><p></p><p>[ATTACH=full]15725[/ATTACH]</p><p>[automerge]1712232154[/automerge]</p><p>Working on lots of paint related stuff, fixing a few bugs, added a few catalogue page serializers.</p><p></p><p>Starting implementing Entity Framework, which cleared up a lot of boilerplate for the ADO stuff. It still exists, but its on its way out.</p><p></p><p>Even though EF is a repository pattern I'm keeping the repository classes for testing / mock ability and separation concerns.</p><p></p><p>Lengthy DAO classes are now gone and repository classes are now cleaner as a result</p><p></p><p>[ATTACH=full]15726[/ATTACH]</p><p>[ATTACH=full]15727[/ATTACH]</p><p></p><p>Will move all the other stuff over to use it in the next few days and drop ADO.NET for good.</p><p>[automerge]1712312685[/automerge]</p><p><strong>More updates today</strong></p><p></p><p>Moved all of furniture, catalogue (items, pages, front page items, etc), and navigator to Entity Framework. All that's left now is player and rooms old data access layer then ADO.NET is gone.</p><p></p><p>This is taking some time to write up all the models and configure the relationships, and I don't want to get distracted so its all I'm focusing on right now. New features will come but the transition to EF core was a must for Sadie which is getting there...</p><p></p><p>[ATTACH=full]15730[/ATTACH]</p><p></p><p>Players and rooms are huge in terms of tech debt. They hold more data access related code than all other projects combined, but I'll be tackling those in the coming days.</p><p>[automerge]1712503954[/automerge]</p><p><strong>April 7th, 2024</strong></p><ul> <li data-xf-list-type="ul">The EF transition is fully complete for room project </li> <li data-xf-list-type="ul">Separated persistent and BL entities using auto mapper</li> <li data-xf-list-type="ul">Done a ton of refactoring in response to the EF upgrade</li> <li data-xf-list-type="ul">Started migrating players project to EF (about 10%)</li> </ul><p></p><p>Plan for the next few weeks will be finishing EF transition, more refactoring and stabilisation work, then maybe an open beta.</p><p>[automerge]1712603696[/automerge]</p><p><strong>April 8th</strong></p><ul> <li data-xf-list-type="ul">EF transition is complete solution wide</li> </ul><p>[automerge]1712653793[/automerge]</p><p><strong>April 9th</strong></p><ul> <li data-xf-list-type="ul">Dropped tuples project wide for .NET 8's <a href="https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.collectionextensions.getvalueordefault?view=net-8.0" target="_blank">GetValueOrDefault</a></li> <li data-xf-list-type="ul">New permission system (roles now many to many, player can be many roles).</li> <li data-xf-list-type="ul">Improved enumeration parsing with description attributes</li> <li data-xf-list-type="ul">Lots more refactoring and clean up work</li> </ul><p>[automerge]1712747457[/automerge]</p><p><strong>April 10th</strong></p><ul> <li data-xf-list-type="ul">Refactored entire solution</li> <li data-xf-list-type="ul">Got migrations generating via EF</li> <li data-xf-list-type="ul">Can now lay down on lay able furniture.</li> <li data-xf-list-type="ul">Fixed a bug where status doesn't update coming off chair</li> <li data-xf-list-type="ul">Started working on furniture interactions (clicking)</li> </ul><p></p><p>[ATTACH=full]15766[/ATTACH]</p><p>[ATTACH=full]15767[/ATTACH]</p></blockquote><p></p>
[QUOTE="habtard, post: 481407, member: 90778"] Thanks! ADO.NET which I've tried to abstract down with a base class etc (see [URL='https://i.imgur.com/FnH2aSM.png']here[/URL] & [URL='https://imgur.com/UJymHXS']here[/URL]), its very verbose, something like [URL='https://github.com/DapperLib/Dapper']Dapper[/URL] or maybe even entity framework could really help with not writing so much code for that. Yep, adding parsers was one step to reducing the coupling so eventually I can seperate the responsibilities like you describe. Also yeah, using something like reflection to recursively register the events would be much easier as its an ever growing complexity otherwise, will look into this soon. It's good to see people being constructive. [automerge]1711880244[/automerge] Few more updates Did some work on club offers, now loading them from the database. [ATTACH type="full" alt="1711876656493.png"]15675[/ATTACH] [ATTACH type="full" alt="1711876693383.png"]15676[/ATTACH] [ATTACH type="full" alt="1711880308829.png"]15681[/ATTACH] Added [URL='https://github.com/khellang/Scrutor']Scruptor[/URL] (adds extension methods to M.E.DI) for easier service registration: [ATTACH type="full" alt="1711882370977.png"]15682[/ATTACH] [automerge]1711892795[/automerge] Refactored events so each one declares its packet identifier via a property (auto mapping). [ATTACH type="full" alt="1711892764229.png"]15684[/ATTACH] [automerge]1711964997[/automerge] Bit off topic... I wanted to improve code quality and enforce certain rules for Sadie but couldn't find anything better than a basic linter. I spent some time last night writing a really rough C# analyzer, it uses the Roslyn .NET compiler and provides abstractions for things like class and individual method line count, parameter counts, etc It runs off a config file like so: [ATTACH type="full" alt="1711963996013.png"]15707[/ATTACH] zsh alias for pre-commit [ATTACH type="full" alt="1711964650802.png"]15710[/ATTACH] It returns the suggestions count as its exit code (!= 0 will fail) for things like [URL='https://circleci.com/']CircleCI[/URL] [ATTACH type="full" alt="1711964163260.png"]15709[/ATTACH] Back on topic... Commands now define their own trigger keyword via an attribute, instead of defining a collection map. [ATTACH type="full" alt="1711979993438.png"]15711[/ATTACH] Other highlights [LIST] [*]Done a ton of refactoring with suggestions from the code-quality-checker. [*]Started moving catalog packet writers to shared serializers so the code stays DRY [*]Spent some time playing with Entity Framework, will (probably?) switch Sadie to it soon. [/LIST] [automerge]1712075582[/automerge] Spent the day working through some refactoring, room paint settings, and catalog front page items. Packets now pass front page items, loads from db, etc: [ATTACH type="full" alt="1712075437123.png"]15715[/ATTACH] [ATTACH type="full"]15719[/ATTACH] Room painting done, wall and floor thickness, as well as paint for floor, wall and landscape (see discord for screen cast, can't upload), plus a few other trello items. [automerge]1712155406[/automerge] Busy upgrading a few things with my set up today but a few commits: [ATTACH type="full"]15725[/ATTACH] [automerge]1712232154[/automerge] Working on lots of paint related stuff, fixing a few bugs, added a few catalogue page serializers. Starting implementing Entity Framework, which cleared up a lot of boilerplate for the ADO stuff. It still exists, but its on its way out. Even though EF is a repository pattern I'm keeping the repository classes for testing / mock ability and separation concerns. Lengthy DAO classes are now gone and repository classes are now cleaner as a result [ATTACH type="full"]15726[/ATTACH] [ATTACH type="full"]15727[/ATTACH] Will move all the other stuff over to use it in the next few days and drop ADO.NET for good. [automerge]1712312685[/automerge] [B]More updates today[/B] Moved all of furniture, catalogue (items, pages, front page items, etc), and navigator to Entity Framework. All that's left now is player and rooms old data access layer then ADO.NET is gone. This is taking some time to write up all the models and configure the relationships, and I don't want to get distracted so its all I'm focusing on right now. New features will come but the transition to EF core was a must for Sadie which is getting there... [ATTACH type="full"]15730[/ATTACH] Players and rooms are huge in terms of tech debt. They hold more data access related code than all other projects combined, but I'll be tackling those in the coming days. [automerge]1712503954[/automerge] [B]April 7th, 2024[/B] [LIST] [*]The EF transition is fully complete for room project [*]Separated persistent and BL entities using auto mapper [*]Done a ton of refactoring in response to the EF upgrade [*]Started migrating players project to EF (about 10%) [/LIST] Plan for the next few weeks will be finishing EF transition, more refactoring and stabilisation work, then maybe an open beta. [automerge]1712603696[/automerge] [B]April 8th[/B] [LIST] [*]EF transition is complete solution wide [/LIST] [automerge]1712653793[/automerge] [B]April 9th[/B] [LIST] [*]Dropped tuples project wide for .NET 8's [URL='https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.collectionextensions.getvalueordefault?view=net-8.0']GetValueOrDefault[/URL] [*]New permission system (roles now many to many, player can be many roles). [*]Improved enumeration parsing with description attributes [*]Lots more refactoring and clean up work [/LIST] [automerge]1712747457[/automerge] [B]April 10th[/B] [LIST] [*]Refactored entire solution [*]Got migrations generating via EF [*]Can now lay down on lay able furniture. [*]Fixed a bug where status doesn't update coming off chair [*]Started working on furniture interactions (clicking) [/LIST] [ATTACH type="full"]15766[/ATTACH] [ATTACH type="full"]15767[/ATTACH] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Development
Sadie: A clean code Habbo emulator
Top