Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REG-2222] Support creating and editing segments through the dashboard app #376

Open
wants to merge 3 commits into
base: dashboard-wip
Choose a base branch
from

Conversation

abeizer
Copy link
Contributor

@abeizer abeizer commented Dec 20, 2024

What has been done

  • Added TCP message types for the client to request a specific segment and overwrite the contents of a specific segment using its resourcePath
  • Helper methods added to BotSegment to facilitate reading + writing segment files
  • Reworked TCPServer logic to properly handle fragmented messages

Out of scope

  • Creating new BotSequences and viewing/editing the contents of BotSequences
  • server ack on segment save -> I want to do this but ran out of time before the holiday break

Find the pull request instructions here

Every reviewer and the owner of the PR should consider these points in their request (feel free to copy this checklist so you can fill it out yourself in the overall PR comment)

  • The code is extensible and backward compatible
  • New public interfaces are extensible and open to backward compatibility in the future
  • If preparing to remove a field in the future (i.e. this PR removes an argument), the argument stays but is no longer functional, and attaches a deprecation warning. A linear task is also created to track this deletion task.
  • Non-critical or potentially modifiable arguments are optional
  • Breaking changes and the approach to handling them have been verified with the team (in the Linear task, design doc, or PR itself)
  • The code is easy to read
  • Unit tests are added for expected and edge cases
  • Integration tests are added for expected and edge cases
  • Functions and classes are documented
  • Migrations for both up and down operations are completed
  • A documentation PR is created and being reviewed for anything in this PR that requires knowledge to use
  • Implications on other dependent code (i.e. sample games and sample bots) is considered, mentioned, and properly handled
  • Style changes and other non-blocking changes are marked as non-blocking from reviewers

@abeizer abeizer changed the title [REG-2222] [REG-2222] Support creating and editing segments through the dashboard app Dec 20, 2024
@abeizer abeizer marked this pull request as ready for review December 20, 2024 21:43
@abeizer abeizer requested a review from batu December 20, 2024 21:43

public override string ToString()
{
StringBuilder sb = new StringBuilder(1000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this a readonly threadlocal so we avoid re-allocating/gc'ing it


public override string ToString()
{
StringBuilder sb = new StringBuilder(1000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this a readonly threadlocal so we avoid re-allocating/gc'ing it


public override string ToString()
{
StringBuilder sb = new StringBuilder(1000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this a readonly threadlocal so we avoid re-allocating/gc'ing it


public override string ToString()
{
StringBuilder sb = new StringBuilder(1000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this a readonly threadlocal so we avoid re-allocating/gc'ing it

* Saves a BotSegmentList to a file
* </summary>
* <param name="segmentList">The BotSegmentList to save to file</param>
* <param name="resourcePath">The segment's resourcePath, if it already exists. If null, a new path will be generated for it.</param>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably update this comment to indicate that the resource path should NOT include the '.json' suffix

public static void Delete(string resourcePath)
{
resourcePath = resourcePath.Replace('\\', '/');
if (!resourcePath.StartsWith("Assets/"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only valid if running in the editor. In built runtime this should point to persistent data path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deletion isn't allowed during a build right? This should be similar to what we're doing from the overlay currently, just for a segment versus a sequence

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you create a copy/override of a sequence/segment packaged in the build, it is written to the persistent data path. You CAN delete that override copy.

There is also an existing code path that deletes the prior existing after writing the new one when renaming.

@abeizer abeizer removed request for batu and vontell January 9, 2025 19:14
Copy link
Collaborator

@vontell vontell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes other than what has already been requested, approving this so we can get these off the notifications list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants