mirror of
https://github.com/recroom2016/OpenRec.git
synced 2026-04-22 21:25:51 +00:00
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.IO;
|
|
using System.Net;
|
|
|
|
namespace start
|
|
{
|
|
class Setup
|
|
{
|
|
public static void setup()
|
|
{
|
|
Console.WriteLine("Setting up...");
|
|
Directory.CreateDirectory("SaveData\\Profile\\");
|
|
if (!(File.Exists("SaveData\\avatar.txt")))
|
|
{
|
|
File.WriteAllText("SaveData\\avatar.txt", new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/avatar.txt"));
|
|
}
|
|
else if (File.ReadAllText("SaveData\\avatar.txt") == "")
|
|
{
|
|
File.WriteAllText("SaveData\\avatar.txt", new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Download/avatar.txt"));
|
|
}
|
|
if (!(File.Exists("SaveData\\Profile\\username.txt")))
|
|
{
|
|
File.WriteAllText("SaveData\\Profile\\username.txt", "DefaultUsername");
|
|
}
|
|
if (!(File.Exists("SaveData\\settings.txt")))
|
|
{
|
|
File.WriteAllText("SaveData\\settings.txt", Newtonsoft.Json.JsonConvert.SerializeObject(api.Settings.CreateDefaultSettings()));
|
|
}
|
|
if (!(File.Exists("SaveData\\profileimage.png")))
|
|
{
|
|
File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData("https://github.com/OpenRecRoom/OpenRec/raw/main/profileimage.png"));
|
|
}
|
|
Console.WriteLine("Done!");
|
|
Console.Clear();
|
|
}
|
|
}
|
|
}
|