public void Awake() { GameObject poRef = PersistentObjMang.getInstance(); Transform serverTrans = poRef.transform.Find("Server"); GameObject server_object = null; if(serverTrans != null){ server_object = serverTrans.gameObject; } if (server_object == null){ Debug.Log("Server object not instanciated; Offline session started"); GameObject nwS = new GameObject(); nwS.name = "Server"; nwS.transform.parent = poRef.transform; server = nwS.AddComponent<ILearnRWOffline>(); server_object = nwS; }else{ server = (IServerServices)server_object.GetComponent(typeof(IServerServices)); } }
void setUpOnlineServerDual() { setUp(); server_script = server.AddComponent<ILearnRWServer>(); connection = server_script.requestAuthentication(userLoginData.username,userLoginData.password,userLoginData.teacher_username,userLoginData.teacher_password); }
void testConnection() { setUp(); connection_test_script = server.AddComponent<ILearnRWServer>(); connectionTest = connection_test_script.requestServerVersion(); }
void setUpOfflineServer() { setUp(); server_script = server.AddComponent<ILearnRWOffline>(); ILearnRWOffline castVersion = (ILearnRWOffline) server_script; castVersion.language = LocalisationMang.langCode.ToString(); connection = server_script.requestAuthentication(userLoginData.username,userLoginData.password); }