private void Awake() { self = this; DontDestroyOnLoad(this.gameObject); UThread.initUnityThread(); accountparser = new INIParser(); string path = Application.dataPath.Replace("/", "\\").Replace("\\Assets", string.Empty); accountparser.Open(path + "\\account.dat", true); if (!accountparser.IsKeyExists("basic", "username")) { accountparser.WriteValue("basic", "username", "admin"); } if (!accountparser.IsKeyExists("basic", "password")) { accountparser.WriteValue("basic", "password", "admin"); } var date = DateTime.Now; var formattedDate = string.Format("{0}/{1}/{2}", date.Month, date.Day, date.Year); var time = new DateTime(DateTime.Now.TimeOfDay.Ticks); // Date part is 01-01-0001 var formattedTime = formattedDate + "-" + time.ToString("h:mm:sstt", CultureInfo.InvariantCulture); accountparser.WriteValue("basic", "lastlogin", formattedTime); }
private static void InitList() { string iniPath = Application.dataPath + "/Resources/SDKManager.bytes"; INIParser ini = new INIParser(); ini.Open(iniPath); List <string> sections = ini.GetAllSections(); _listPlatform.Clear(); _dicEnumSelect.Clear(); bSelectAll = false; for (int k = 0; k < sections.Count; k++) { if (ini.IsKeyExists(sections[k], "apkname")) { string apk_name = ini.ReadValue(sections[k], "apkname", sections[k]); _listPlatform.Add(sections[k], apk_name); _dicEnumSelect.Add(sections[k], false); } } ini.Close(); }
void Start() { if (HostName == "1.2.3.4") { Debug.LogError("Please set the mumble host name to your mumble server"); return; } else { INIParser ini = new INIParser(); // Open the save file. If the save file does not exist, INIParser automatically create // one ini.Open(Application.dataPath + "/MayaVerseLowPoly.ini"); if (ini.IsKeyExists("NetworkConfig", "ServerVoiceIP")) { HostName = ini.ReadValue("NetworkConfig", "ServerVoiceIP", "127.0.0.1"); Debug.Log("VoiceServerIP: " + HostName); } else { ini.WriteValue("NetworkConfig", "ServerVoiceIP", "127.0.0.1"); Debug.Log("VoiceServerIP: " + HostName); } if (ini.IsKeyExists("NetworkConfig", "ServerVoicePort")) { Port = ini.ReadValue("NetworkConfig", "ServerVoicePort", 64738); Debug.Log("VoiceServerPort: " + Port.ToString()); } else { ini.WriteValue("NetworkConfig", "ServerVoicePort", 64738); Debug.Log("VoiceServerPort: " + Port.ToString()); } if (ini.IsKeyExists("VoiceAccount", "Login")) { Username = ini.ReadValue("VoiceAccount", "Login", "Vytek"); Debug.Log("AvatarName: " + this.Username); } else { ini.WriteValue("VoiceAccount", "Login", "Vytek"); Debug.Log("AvatarName: " + this.Username); } if (ini.IsKeyExists("VoiceAccount", "Password")) { Password = ini.ReadValue("VoiceAccount", "Password", "Vytek"); } else { ini.WriteValue("VoiceAccount", "Password", "Vytek"); } //Close file ini.Close(); } Application.runInBackground = true; _mumbleClient = new MumbleClient(HostName, Port, CreateMumbleAudioPlayerFromPrefab, DestroyMumbleAudioPlayer, DebuggingVariables); if (DebuggingVariables.UseRandomUsername) { Username += UnityEngine.Random.Range(0, 100f); } _mumbleClient.Connect(Username, Password); if (MyMumbleMic != null) { _mumbleClient.AddMumbleMic(MyMumbleMic); } #if UNITY_EDITOR if (DebuggingVariables.EnableEditorIOGraph) { EditorGraph editorGraph = EditorWindow.GetWindow <EditorGraph>(); editorGraph.Show(); StartCoroutine(UpdateEditorGraph()); } #endif }
/// <summary /// Start this instance. /// </summary> void Start() { CustomLogger.LogIt("--- Starting Logging ---"); //Enable Background Running //Application.runInBackground = true; INIParser ini = new INIParser(); // Open the save file. If the save file does not exist, INIParser automatically create // one ini.Open(Application.dataPath + "/MayaVerse.ini"); if (ini.IsKeyExists("NetworkConfig", "ServerIP")) { ipAddress = ini.ReadValue("NetworkConfig", "ServerIP", "127.0.0.1"); Debug.Log("ServerIP: " + ipAddress); } else { ini.WriteValue("NetworkConfig", "ServerIP", "127.0.0.1"); Debug.Log("ServerIP: " + ipAddress); } if (ini.IsKeyExists("NetworkConfig", "ServerPort")) { portNumber = ini.ReadValue("NetworkConfig", "ServerPort", 4296); Debug.Log("ServerPort: " + portNumber.ToString()); } else { ini.WriteValue("NetworkConfig", "ServerPort", 4296); Debug.Log("ServerPort: " + portNumber.ToString()); } if (ini.IsKeyExists("AvatarConfig", "AvatarName")) { AvatarName = ini.ReadValue("AvatarConfig", "AvatarName", "Vytek75"); Debug.Log("AvatarName: " + this.AvatarName); } else { ini.WriteValue("AvatarConfig", "AvatarName", "Vytek75"); Debug.Log("AvatarName: " + this.AvatarName); } if (ini.IsKeyExists("AvatarConfig", "AvatarPassword")) { AvatarPassword = ini.ReadValue("AvatarConfig", "AvatarPassword", "test1234!"); Debug.Log("AvatarPassword: "******"AvatarConfig", "AvatarPassword", "test1234!"); Debug.Log("AvatarPassword: "******"Network idle."); StartClient(ipAddress); Debug.Log("Network Started."); //serverConn.SendBytes(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, SendOption.Reliable); //DEBUG SendMessageToServer((sbyte)CommandType.LOGIN); //Add PLAYER_JOIN MESSAGE (SENDTOOTHER) NOT HERE TIMER/THREAD PROBLEM //SendMessage(SendType.SENDTOOTHER, PacketId.PLAYER_JOIN, 0, this.UID, true, PlayerME.transform.position, PlayerME.transform.rotation); lastPosition = PlayerME.transform.position; lastRotation = PlayerME.transform.rotation; Debug.Log("Network Trasmitted."); //START POOL MANAGER FOR NETWORKOBJECTS Debug.Log("Pool Manager started."); poolObj = PoolsManager.Instance; }