Minor ConsoleSystem cleanup#40
Open
richardnlarge wants to merge 7 commits intoPolarisTeam:masterfrom
richardnlarge:master
Open
Minor ConsoleSystem cleanup#40richardnlarge wants to merge 7 commits intoPolarisTeam:masterfrom richardnlarge:master
richardnlarge wants to merge 7 commits intoPolarisTeam:masterfrom
richardnlarge:master
Conversation
Since the server's printing doesn't clear to EOL, pre-existing text in a console window gets smeared behind server output. This is only noticable when starting the server from an already-open command line window.
The window should probably not be resized unless the user explicitly requests to do so. Mainly only matters if starting the server from an already-open command line window.
The old warning message logged upon parsing window size command arguments was misleading. "Capping" implies enforcement of a maximum size but the code implemented a minimum size. Regardless of the original code's intent, for better or for worse, the window size is the users' business. Should they wish to have funky window sizes, so be it. Additionally, threw in try-catch blocks to gracefully handle resize exceptions.
The console favored scrolling down instead of moving the prompt from the second-to-last line to the last line, which resulted in a wasted blank line at the bottom of the console. Additionally, BlankDrawnCommandLine calls were always followed up with a SetCursorPosition to move the cursor to the beginning of the line. Slightly simplified this process by moving the column reset into BlankDrawnCommandLine.
Clear the current command line upon pressing Escape.
Internal PacketWriter.WritePosition()'s duties are fulfilled by one of the public PacketWriter.Write() overloads.
Both a container that holds all objects and a container that holds zone/object relationships aren't really needed. These have been folded into a single container for only zone/object pairings, which can be queried with LINQ to fulfill the same intent as before. The container has been changed from a Dictionary to a List under the assumption that any one zone will not have duplicate object IDs, as supported by the SQL scripts in the Resources submodule. Additionally, removed function-local list copies that the functions returned in favor of LINQ statements. Added a warning for when the filesystem fallback has no directory for the requested zone. Updated NPC caching to prevent the database from being queried when a zone's NPCs have already been loaded. Implemented getObjectByID(string, uint) and updated getObjectByID(uint). The function now warns when either the requested object is not found or there are multiple matching objects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's a handful of trivial console-related updates.