Created
July 17, 2016 06:58
-
-
Save sifex/4f675726662714a12d0565ce79200e8a to your computer and use it in GitHub Desktop.
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
| ws.OnMessage += (sender, e) => | |
| { | |
| // Scarlet WS API | |
| // Words = (Browser/Updater)|(IP/*)|(Command)|(Perameters) | |
| string[] words = e.Data.Split('|'); | |
| if (words[0] == "Updater") | |
| { | |
| if (words[1] == IP || words[1] == "*") | |
| { | |
| if (words[2] == "browserConnect") | |
| { | |
| ws.Send("Browser|" + IP + "|browserConfirmation"); | |
| } | |
| if (words[2] == "startDownload") | |
| { | |
| installDirectory = words[3]; | |
| if (backgroundWorker1.IsBusy == false) | |
| { | |
| backgroundWorker1.RunWorkerAsync(); | |
| } | |
| } | |
| if (words[2] == "locationChange") | |
| { | |
| ChooseFolder(); | |
| } | |
| if (words[2] == "updateInstallLocation") | |
| { | |
| installDirectory = words[3]; | |
| } | |
| if (words[2] == "Broadcast") | |
| { | |
| MessageBox.Show(words[3], "Scarlet Updater", MessageBoxButtons.OK); | |
| } | |
| if (words[2] == "FetchAll") | |
| { | |
| } | |
| } | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment