public void endActivity(int difficulty,int category, ApplicationID activity,string level)
    {
        UserLogNoTimestamp log = new UserLogNoTimestamp(username,activity,Tag.APP_SESSION_END);
        log.setDifficulty(difficulty,category);
        log.setMode(Mode.ADVENTURE);
        log.setLevel(level);

        server.logData(log);
    }
    public void activityProposed(int difficulty,int category, ApplicationID activity,string level)
    {
        //	Debug.Log("ACTIVITY PROPOSED: "+activity+" "+level);

        UserLogNoTimestamp log = new UserLogNoTimestamp(username,activity,Tag.ACTIVITY_PROPOSED);
        log.setDifficulty(difficulty,category);
        log.setMode(Mode.PLAY);
        log.setLevel(level);

        server.logData(log);
    }
Пример #3
0
    public void logData(UserLogNoTimestamp log)
    {
        log.setSupervisor(teacher_name);
        logs.Add(log);

        if (logs.Count>20)
            flushLogs();
    }
Пример #4
0
    //int status = 0;
    void Update()
    {
        if (connection!=null){
            //server_script
            if((connection.status()==RoutineStatus.READY ) ){//||(connection.status()==RoutineStatus.IDLE)

                UserLogNoTimestamp log = new UserLogNoTimestamp(userLoginData.username,ApplicationID.LOGGING_SCREEN,Tag.LOGIN);
                log.setValue("Connected");
                server_script.logData(log);//Log successfull log in//also change the status of the connection to IDLE//Maybe too late
                connection = new ConnectionError("Connected",RoutineStatus.IDLE);
                wvServCom =  server.AddComponent<WorldViewServerCommunication>();//This script will launch on Awake a request User Details
                acServCom = server.AddComponent<ActivityServerCommunication>();

            }else if(connection.status()==RoutineStatus.ERROR){

                connectingInProgressFlag = false;

                setConnectButtonVisibility(true);

                GetRoutine  server_response = server_script.errorHandler(connection);

                UserLogNoTimestamp log = new UserLogNoTimestamp(userLoginData.username,ApplicationID.LOGGING_SCREEN,Tag.LOGIN);
                log.setValue(server_response.getError());

                server_script.logData(log);//Log fail log in

                error = server_response.getError();
                connection = null;
                return;
            }else if(connection.status()==RoutineStatus.WAIT){
                //GUI.Label(new Rect(20,220,500,20), "Connecting...");
                return;
            }
        }else
            return;

        downloader(false);

        if(wvServCom.Loading().status()==RoutineStatus.READY){

            message = "Loading saved data";
            SaveFileManager.loadSaveFromPlayerDownload(wvServCom.loadSavefile(),wvServCom.language,WorldViewServerCommunication.userProfile.getLiteracyProfile());//status changes to IDLE

            acServCom.setUserDetails(wvServCom.getUsername(),wvServCom.getUserID(),wvServCom.language);

            BinaryFormatter bf = new BinaryFormatter();
            FileStream file = File.Create (Application.persistentDataPath + "/username.gd");
            userLoginData.language = LocalisationMang.langCode;
            bf.Serialize(file, userLoginData);
            file.Close();

            Debug.LogWarning("Removed the flip between Milton and Monica");

            WorldViewServerCommunication.clearError();

            Application.LoadLevel("PlayerCustomisationScene");

        }else if(wvServCom.Loading().status()==RoutineStatus.WAIT){
            return;
        }else if(wvServCom.Loading().status()==RoutineStatus.ERROR){

            error = wvServCom.Loading().getError();
            connectingInProgressFlag = false;

            //loading = false;
            //askedForSaveFile = false;
            //loadedSaveFlag = false;
            setConnectButtonVisibility(true);
            connection = null;
        }
    }
Пример #5
0
 public void logData(UserLogNoTimestamp log)
 {
     logs.Add(log);
     return;
 }