Skip to content

Commit

Permalink
Merge pull request #11 from BoiHanny/Version_0.5.0
Browse files Browse the repository at this point in the history
Version 0.5.0
  • Loading branch information
BoiHanny authored Feb 20, 2023
2 parents dc2847b + e061d87 commit 4a8b04d
Show file tree
Hide file tree
Showing 15 changed files with 1,066 additions and 194 deletions.
45 changes: 0 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +0,0 @@
![MagicOSC_icon](https://user-images.githubusercontent.com/114599052/194428052-3e5d0018-4a96-405d-b2e2-c7db16d02940.png) v0.4.0
<!-- BEGIN LATEST DOWNLOAD BUTTON -->
[![Download zip](https://custom-icon-badges.herokuapp.com/badge/-Download-blue?style=for-the-badge&logo=download&logoColor=white "Download zip")](https://github.com/BoiHanny/vrcosc-magicchatbox/releases/download/v0.4.0/Version-0.4.0.zip)
<!-- END LATEST DOWNLOAD BUTTON -->


**Introducing MagicChatbox: the ultimate companion for all your VRChat needs! Whether you're on desktop or in VR, we've got you covered with our compact and modern UI.**

### Download and Installation

1. Download the [zip file](https://github.com/BoiHanny/vrcosc-magicchatbox/releases/download/v0.4.0/Version-0.4.0.zip).
2. Right-click and choose the option 'extract all'.
3. By default it will create a new folder in your download folder (you can also extract the content to other locations).
4. When extracted, the folder will open.
5. Run the file 'MagicChatbox.exe'.

[**Please make sure OSC is enabled in VRChat**](https://youtu.be/OHjN_q6RqGY?t=80)

![197355959-83441bed-2b27-469e-974f-53acbc0badf9](https://user-images.githubusercontent.com/114599052/218335607-3f1b904b-5812-41c5-84de-9d82290962c1.png)

### Features

- **VR mode:** MagicChatbox shows "In VR" on the UI, and you have the option to display your local time in-game. MagicChatbox also provides a Spotify integration that shows the currently playing song, adding to the immersive experience. You can enable or disable this feature from the options menu.

- **Desktop mode:** MagicChatbox shows "On desktop" on the UI, and displays which application you are currently focused on. It's a great way to keep track of your messages while multitasking. The Spotify integration also shows the currently playing song, making it easier to keep up with your favorite tunes.

- **Status tab:** One of the most exciting changes we made in version 0.4.0 is the addition of the Status tab, which provides an easy way to manage your status items. You can sort your status items based on creation date, recent usage, and if they are a favorite. Each status item has three types of interactions - activate, delete, and favorite - and you can quickly add new items using the input box.

- **Personal Message integration:** In addition to the Status tab, we have also added a new Personal Message integration, allowing you to easily share messages with others.

- **Time options:** MagicChatbox offers an option to show only the current time in VR, without the "my time:" prefix. You can choose to display the time in a 24-hour format, making it easier to read.

- **OSC customization:** We have updated our codebase to support UTF-8 and made the switch from Sharp OSC to CoreOSC-VRC-UTF8, which was a collaborative effort with VRCWizard. MagicChatbox also provides an option to change the OSC IP and port from the options menu, allowing for more customization.

- **Local save and version checker:** We have implemented a local JSON file to save your status items, ensuring they are always available to you. The application also features a built-in version checker that informs you if you have the latest version, if a new version is available, or if you are running a preview version.

- **Overload feature:** Finally, MagicChatbox features a unique overload feature that disables some integrations automatically if the number of characters in your message exceeds 140. The order of disabled integrations will be as follows: Personal Message, Windows Activity, Current Time, and finally Spotify. MagicChatbox will try to fill the 144 character cap, but when above it, it will disable the integration.

### Contact
Have any questions, suggestions, or feedback regarding MagicChatbox? We'd love to hear from you! Feel free to reach out to us through one of the following channels:

- **Discord:** [BoiHanny#6666](https://discordapp.com/users/270646719086198803)
- **Github Issues:** [Report a bug or submit a feature request](https://github.com/BoiHanny/vrcosc-magicchatbox/issues)

We're committed to providing the best possible experience for our users, and your feedback helps us make MagicChatbox even better.
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Xml;
using vrcosc_magicchatbox.Classes.DataAndSecurity;
using vrcosc_magicchatbox.ViewModels;
using Version = vrcosc_magicchatbox.ViewModels.Version;

namespace vrcosc_magicchatbox.Classes
namespace vrcosc_magicchatbox.DataAndSecurity
{
internal class DataController
{
private ViewModel _VM;
private EncryptionMethods _ENCRY;
public DataController(ViewModel vm)
{
_VM = vm;
_ENCRY = new EncryptionMethods(_VM);
}

public static bool CreateIfMissing(string path)
Expand All @@ -38,7 +40,7 @@ public static bool CreateIfMissing(string path)
}
public void SaveSettingsToXML()
{
if(CreateIfMissing(_VM.DataPath) == true)
if (CreateIfMissing(_VM.DataPath) == true)
{
try
{
Expand Down Expand Up @@ -98,6 +100,26 @@ public void SaveSettingsToXML()
userNode.InnerText = _VM.PrefixIconStatus.ToString();
rootNode.AppendChild(userNode);

userNode = xmlDoc.CreateElement("ScanPauseTimeout");
userNode.InnerText = _VM.ScanPauseTimeout.ToString();
rootNode.AppendChild(userNode);

userNode = xmlDoc.CreateElement("PrefixChat");
userNode.InnerText = _VM.PrefixChat.ToString();
rootNode.AppendChild(userNode);

userNode = xmlDoc.CreateElement("ChatFX");
userNode.InnerText = _VM.ChatFX.ToString();
rootNode.AppendChild(userNode);

userNode = xmlDoc.CreateElement("PauseIconMusic");
userNode.InnerText = _VM.PauseIconMusic.ToString();
rootNode.AppendChild(userNode);

userNode = xmlDoc.CreateElement("Topmost");
userNode.InnerText = _VM.Topmost.ToString();
rootNode.AppendChild(userNode);

xmlDoc.Save(Path.Combine(_VM.DataPath, "settings.xml"));
}
catch (Exception)
Expand All @@ -106,8 +128,8 @@ public void SaveSettingsToXML()

}
}



}

Expand All @@ -132,18 +154,21 @@ public void LoadSettingsFromXML()
_VM.OSCPortOut = int.Parse(doc.GetElementsByTagName("OSCPortOut")[0].InnerText);
_VM.PrefixIconMusic = bool.Parse(doc.GetElementsByTagName("PrefixIconMusic")[0].InnerText);
_VM.PrefixIconStatus = bool.Parse(doc.GetElementsByTagName("PrefixIconStatus")[0].InnerText);
_VM.ScanPauseTimeout = int.Parse(doc.GetElementsByTagName("ScanPauseTimeout")[0].InnerText);
_VM.PrefixChat = bool.Parse(doc.GetElementsByTagName("PrefixChat")[0].InnerText);
_VM.ChatFX = bool.Parse(doc.GetElementsByTagName("ChatFX")[0].InnerText);
_VM.PauseIconMusic = bool.Parse(doc.GetElementsByTagName("PauseIconMusic")[0].InnerText);
_VM.Topmost = bool.Parse(doc.GetElementsByTagName("Topmost")[0].InnerText);


}
catch (Exception)
catch (Exception ex)
{

}
}





public void LoadStatusList()
{
Expand All @@ -166,8 +191,7 @@ public void CheckForUpdate()
{
try
{

string token = "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";
string token = _ENCRY.DecryptString(_VM.ApiStream);
string url = "https://api.github.com/repos/BoiHanny/vrcosc-magicchatbox/releases/latest";

using (var client = new HttpClient())
Expand All @@ -179,7 +203,7 @@ public void CheckForUpdate()
dynamic release = JsonConvert.DeserializeObject(json);
string latestVersion = release.tag_name;
_VM.GitHubVersion = new Version(Regex.Replace(latestVersion, "[^0-9.]", ""));
if(_VM.GitHubVersion != null)
if (_VM.GitHubVersion != null)
{
CompareVersions();
}
Expand All @@ -192,11 +216,12 @@ public void CheckForUpdate()
_VM.VersionTxt = "Can't check updates";
_VM.VersionTxtColor = "#F36734";
}

}

public void CompareVersions()
{

try
{
var currentVersion = _VM.AppVersion.VersionNumber;
Expand All @@ -218,7 +243,7 @@ public void CompareVersions()
_VM.VersionTxtColor = "#FFE816EA";
}
}
catch (Exception)
catch (Exception ex)
{

}
Expand Down
71 changes: 71 additions & 0 deletions vrcosc-magicchatbox/Classes/DataAndSecurity/EncryptionMethods.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using System;
using System.Text;
using System.Security.Cryptography;
using vrcosc_magicchatbox.ViewModels;

namespace vrcosc_magicchatbox.Classes.DataAndSecurity
{
internal class EncryptionMethods
{
private ViewModel _VM;

public EncryptionMethods(ViewModel vm)
{
_VM = vm;
}

//public string EncryptString(string plainText)
//{
// byte[] iv = new byte[16];
// byte[] array;

// using (Aes aes = Aes.Create())
// {
// aes.Key = Encoding.UTF8.GetBytes(_VM.aesKey);
// aes.IV = iv;

// ICryptoTransform encryptor = aes.CreateEncryptor(aes.Key, aes.IV);

// using (System.IO.MemoryStream memoryStream = new System.IO.MemoryStream())
// {
// using (CryptoStream cryptoStream = new CryptoStream((System.IO.Stream)memoryStream, encryptor, CryptoStreamMode.Write))
// {
// using (System.IO.StreamWriter streamWriter = new System.IO.StreamWriter((System.IO.Stream)cryptoStream))
// {
// streamWriter.Write(plainText);
// }

// array = memoryStream.ToArray();
// }
// }
// }

// return Convert.ToBase64String(array);
//}

public string DecryptString(string cipherText)
{
byte[] iv = new byte[16];
byte[] buffer = Convert.FromBase64String(cipherText);

using (Aes aes = Aes.Create())
{
aes.Key = Encoding.UTF8.GetBytes(_VM.aesKey);
aes.IV = iv;

ICryptoTransform decryptor = aes.CreateDecryptor(aes.Key, aes.IV);

using (System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(buffer))
{
using (CryptoStream cryptoStream = new CryptoStream((System.IO.Stream)memoryStream, decryptor, CryptoStreamMode.Read))
{
using (System.IO.StreamReader streamReader = new System.IO.StreamReader((System.IO.Stream)cryptoStream))
{
return streamReader.ReadToEnd();
}
}
}
}
}
}
}
Loading

0 comments on commit 4a8b04d

Please sign in to comment.