Ejemplo n.º 1
0
 private static string CreateLoginJson(string username, string password, string uuid, string instanceId, string roomSecret, List <ModDesc> modlist)
 {
     return("{\"authType\":\"CLIENT\",\"name\":\"" + Convert.ToBase64String(Encoding.UTF8.GetBytes(username)) + "\",\"password\":\"" + Convert.ToBase64String(Encoding.UTF8.GetBytes(password)) + "\",\"vrcuuid\":\"" + uuid + "\",\"instanceId\":\"" + Convert.ToBase64String(Encoding.UTF8.GetBytes(instanceId)) + "\",\"joinSecret\":\"" + roomSecret + "\",\"modlist\":[" + ModDesc.CreateModlistJson(modlist) + "]}");
 }
Ejemplo n.º 2
0
 private static void ModCheckThread()
 {
     while (true)
     {
         lock (userDatasLock)
         {
             if (IsAuthenticated)
             {
                 List <ModDesc> newModlist = ModDesc.GetAllMods();
                 bool           identical  = true;
                 if (newModlist.Count != modlist.Count)
                 {
                     identical = false;
                 }
                 else
                 {
                     foreach (ModDesc mod in newModlist)
                     {
                         bool found = false;
                         foreach (ModDesc mod2 in modlist)
                         {
                             if (
                                 mod2.name.Equals(mod.name) &&
                                 mod2.version.Equals(mod.version) &&
                                 mod2.author.Equals(mod.author) &&
                                 ((mod2.downloadLink == null && mod.downloadLink == null) || (mod2.downloadLink != null && mod2.downloadLink.Equals(mod.downloadLink))) &&
                                 mod2.baseClass.Equals(mod.baseClass))
                             {
                                 found = true;
                                 break;
                             }
                         }
                         if (!found)
                         {
                             identical = false;
                             break;
                         }
                     }
                 }
                 if (!identical)
                 {
                     modlist = newModlist;
                     ((ModListChangedCommand)CommandManager.CreateInstance("MODLISTCHANGED", client)).Send("{\"modlist\":[" + ModDesc.CreateModlistJson(modlist) + "]}");
                 }
             }
         }
         Thread.Sleep(1000);
     }
 }
Ejemplo n.º 3
0
 private static string CreateLoginJson(string authToken, string apiType, string instanceId, List <ModDesc> modlist)
 {
     return("{\"authType\":\"CLIENT\",\"authToken\":\"" + authToken + "\",\"apiType\":\"" + apiType + "\",\"instanceId\":\"" + instanceId + "\",\"modlist\":[" + ModDesc.CreateModlistJson(modlist) + "]}");
 }