Navigation Menu

Skip to content

Commit

Permalink
scsynth: /version branch name & commit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Ho committed Dec 11, 2016
1 parent 2074cb4 commit b7ca7db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HelpSource/Reference/Server-Command-Reference.schelp
Expand Up @@ -124,11 +124,15 @@ definitionlist::
## int || Major version number. Equivalent to sclang's code::Main.scVersionMajor::.
## int || Minor version number. Equivalent to sclang's code::Main.scVersionMinor::.
## string || Patch version name. Equivalent to sclang's code::Main.scVersionPostfix::.
## string || Git branch name.
## string || First seven hex digits of the commit hash.
::
::

The standard human-readable version string can be constructed by concatenating code:: major_version ++ "." ++ minor_version ++ patch_version ::. Since version information is easily accessible to sclang users via the methods described above, this command is mostly useful for alternate clients.

The git branch name and commit hash could be anything if the user has forked SC, so they should only be used for display and user interface purposes.

section:: Synth Definition Commands

subsection:: /d_recv
Expand Down
6 changes: 5 additions & 1 deletion server/scsynth/SC_MiscCmds.cpp
Expand Up @@ -1334,7 +1334,7 @@ SCErr meth_version(World *inWorld, int inSize, char *inData, ReplyAddress* inRep

small_scpacket packet;
packet.adds("/version.reply");
packet.maketags(5);
packet.maketags(7);
packet.addtag(',');
packet.addtag('s');
packet.adds("scsynth");
Expand All @@ -1344,6 +1344,10 @@ SCErr meth_version(World *inWorld, int inSize, char *inData, ReplyAddress* inRep
packet.addi(SC_VersionMinor);
packet.addtag('s');
packet.adds(SC_VersionPatch);
packet.addtag('s');
packet.adds(SC_Branch);
packet.addtag('s');
packet.adds(SC_CommitHash);

CallSequencedCommand(SendReplyCmd, inWorld, packet.size(), packet.data(), inReply);

Expand Down

0 comments on commit b7ca7db

Please sign in to comment.