sEver / screeps-colony-logic

Code driving a Screeps.com colony.
0 stars 0 forks source link

Single out all the available code sync options #1

Closed sEver closed 5 years ago

sEver commented 5 years ago
  1. Screeps server keeps a codebase with several "branches" (actually directories). A remote copy.
  2. Screeps webapp has an editor for that remote copy.
  3. Screeps client keeps a local copy of remote codebase. It's synced both ways by the client.
  4. Screeps account can have a GitHub repo connected, it will pull the code from that repo. (One-way sync "up").
  5. You can push code to the screeps remote copy, using the provided Gruntfile. (One-way sync "up")
sEver commented 5 years ago

Ideas:

  1. Editing the files in local copy will auto-sync them up, as long as the client is running (without necessity to commit).
  2. Keeping these files in a repo will help maintaining changes, we will be able to get changes done via webapp into the repo.
  3. Attaching this repo to an account, as a "source repo" will allow to get these changes up into the remote codebase.
sEver commented 5 years ago

Native Screeps GitHub integration works like that:

  1. You select a repo and a directory in the Screeps Account Management.
  2. That repo's master branch is then watched. When new commits are detected, the content of the indicated directory is checked out into "default" branch/directory in remote codebase.
sEver commented 5 years ago

When you open a local client, it detects that remote code has changed in relation to local and gives a warning.

sEver commented 5 years ago

Summarizing:

  1. Upon commit to a connected repo files are synced: Repo/Directory ->Remote:"default" branch
  2. If client is running, there is bi-directional auto sync Local <-> Server
  3. Committing what is already synced does not create conflicts, obviously. See: https://screeps.com/forum/topic/806/what-happens-when-i-link-my-account-to-github/5