Ejemplo n.º 1
0
	//public static HelpPipeCon Instance;

//	private static HelpPipeCon _instance;
//	
//	/// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//	/// 
//	// Static singleton property
//	public static HelpPipeCon Instance
//	{
//		// Here we use the ?? operator, to return 'instance' if 'instance' does not equal null
//		// otherwise we assign instance to a new component and return that
//		get 
//		{ 
//			if(_instance == null)
//			{
//				GameObject obj = new GameObject ();
//				obj.hideFlags = HideFlags.HideAndDontSave;
//				_instance = obj.AddComponent<HelpPipeCon> ();
//			}
//			
//			return _instance;
//		}
//	}


	/// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Use this for initialization
	void Awake () {

		Instance = this;

		helpPopupCon = GameObject.Find("Popup_Help").GetComponent<HelpPopupCon>();

		ts = TextScript.Instance;

		helpState = 0;

		efm = EffectSoundManagerScript.Instance;

		go_HState = new GameObject[12];
		for(int i=0; i<12; i++)
		{
			go_HState[i] = GameObject.Find("HStage"+i);
		}
//		Debug.Log("1");
//		gd = GlobalData.Instance;
//		gameCon = GameCon.Instance;//GameObject.Find ("GameCon").GetComponent<GameCon>();

		go_popup = GameObject.Find("Popup_Help");

		gd = GlobalData.Instance;
		gd.setTileNum(0, true);


//		help_PipeIndex  = 173;
//		setHelpPipe(help_PipeIndex);
//
//
////		TweenPosition twPosition = TweenPosition.Begin(go_popup, 0.3f, new Vector3(0, 0, 0));
////		twPosition.method = UITweener.Method.BounceIn;
	}
Ejemplo n.º 2
0
    void Start()
    {
        gData = GameObject.FindGameObjectWithTag ("GlobalData").GetComponent<GlobalData> ();

        //从服务器加载tomb列表
        tombs = new List<Tomb> ();

        Tomb tomb = new Tomb ();
        tomb.tombName = StringCollection.KINGOFLU;
        tomb.tombLevel = 1;
        tomb.sceneList = new List<SceneInfo>();

        tombs.Add (tomb);

        //用列表初始化map
        Transform tombsO = GameObject.FindGameObjectWithTag ("UI").transform.FindChild ("Tombs");
        for (int i=0; i<tombsO.childCount; i++) {
            tombsO.GetChild (i).GetComponent<Image> ().sprite = Resources.Load <Sprite> ("_images/_game/tomb_" + tombs [i].tombLevel);
            tombsO.GetChild (i).FindChild ("Text").GetComponent<Text> ().text = tombs [i].tombName;
            tombsO.GetChild (i).GetComponent<TombInfo> ().tomb = tombs [i];
        }

        Transform tombsIn = GameObject.FindGameObjectWithTag ("UI").transform.FindChild ("TombIn");
        tombsIn.FindChild ("New").FindChild ("Text").GetComponent<Text> ().text = StringCollection.NEWAD;
        tombsIn.FindChild ("Log").FindChild ("Text").GetComponent<Text> ().text = StringCollection.LOGAD;
        tombsIn.FindChild ("Back").FindChild ("Text").GetComponent<Text> ().text = StringCollection.BACKTOMAP;
    }
Ejemplo n.º 3
0
    //===============================================================
    // Function: uploadProfilePicButton_click
    //===============================================================
    protected void uploadProfilePicButton_click(object sender, EventArgs e)
    {
        if (profilePicFileUpload.PostedFile.ContentLength != 0)
        {
            int fileSizeBytes = profilePicFileUpload.PostedFile.ContentLength;

            GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
            string fileStoreFolder = gd.GetStringValue("FileStoreFolder") + @"\temp";

            string originalFileName = Path.GetFileName(profilePicFileUpload.PostedFile.FileName);
            string destPath = Path.Combine(fileStoreFolder, originalFileName);
            destPath = destPath.Replace(" ", "_");
            destPath = MiscUtils.GetUniqueFileName(destPath);
            string savedFilename = Path.GetFileName(destPath);

            profilePicFileUpload.PostedFile.SaveAs(destPath);

            int status = MiscUtils.CreatePreviews(Path.GetFileName(destPath),
                int.Parse(Session["loggedInUserID"].ToString()));

            if (status >= 0)
            {
                Response.Redirect("profileRedirect.aspx");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert(\"This type of image is not supported, please choose another.\");", true);
            }
        }
    }
Ejemplo n.º 4
0
	void Awake()
    {
        if (instance == null)
        {
            instance = this as GlobalData;
        }
    }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            var srcDirectory = new DirectoryInfo(args[0]);
            //var dstDirectory = srcDirectory.Parent.CreateSubdirectory(srcDirectory.Name + "-converted");
			var dstDirectory = new DirectoryInfo("C:\\users\\user\\AIML-output");
			dstDirectory.Create();
			var input = dstDirectory.CreateSubdirectory("Input");
            var output = dstDirectory.CreateSubdirectory("Output");

            var global = new GlobalData();
            global.AfterLoad(dstDirectory);
            EditorModelIO.Save(global);

            var copying = "";

            
            foreach (var e in srcDirectory.GetDirectories())
            {
                var model = new EditorModel(e, srcDirectory, srcDirectory);
                ObsoleteModelIO.LoadAndConvert(model);
                var modelDst = input.CreateSubdirectory(e.Name);
                model.HackLocations(srcDirectory, modelDst);
                model.Save();
                //copying += string.Format(@"copy ""{0}\{2}"" ""{1}\{2}"""+"\n", e.FullName, modelDst.FullName, "face.mp4");
                //copying += string.Format(@"copy ""{0}\{2}"" ""{1}\{2}"""+"\n", e.FullName, modelDst.FullName, "desktop.avi");
                var files = e.GetFiles();
                copying += string.Format(@"xcopy ""{0}\AIML*.avi"" ""{1}\""" + "\n", e.FullName, output.FullName);
            }

            File.WriteAllText(dstDirectory + "\\copy.bat", copying);
        }
Ejemplo n.º 6
0
	void Start ()
	{
		stepCounter = 0;
		gData = GameObject.FindGameObjectWithTag ("GlobalData").GetComponent<GlobalData> ();
		sceneGen = GameObject.FindGameObjectWithTag ("GameController").GetComponent<SceneGen> ();
		uiInput = GameObject.FindGameObjectWithTag ("GameController").GetComponent<UI_Input> ();
	}
Ejemplo n.º 7
0
        static void Main()
        {
            var globalData = new GlobalData();
            globalData.TitleImage = "logo.png";
            globalData.TopicsRoot.Items.Add(
                new Topic
                {
                    Caption = "Основы программирования",
                    Items = {
                    new Topic { Caption="Введение в C#", Items = {
                        new Topic { Caption="Hello, world!", Items = {
                            new Topic { Caption="Методы" }}}}}}
                });
            var paris = new BasicProgrammingComposer();
            var bmp = paris.Compose(globalData, new string[] {
                "Основы программирования",
                "Введение в C#",
                "Hello, world!",
                "Методы"});

            var box = new PictureBox();
            box.Image = bmp;
            box.Dock = DockStyle.Fill;
            var wnd = new Form();
            wnd.WindowState = FormWindowState.Maximized;
            wnd.Controls.Add(box);
            Application.Run(wnd);
        }
Ejemplo n.º 8
0
 void Awake()
 {
     gData = GameObject.FindGameObjectWithTag ("GlobalData").GetComponent<GlobalData> ();
     Button btn = gameObject.GetComponent<Button>();
     btn.onClick.AddListener(delegate() {
         this.OnClick();
     });
 }
Ejemplo n.º 9
0
        public App()
        {
            DIService.Initialize();
            _globalData = DIService.GetSingleton<GlobalData>();
            _notifyIcon = InitNotifyIcon();

            Exit += (sender, args) => _notifyIcon.Dispose();
        }
Ejemplo n.º 10
0
 //===============================================================
 // Function: Page_Load
 //===============================================================
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
         emailContentTextBox.Text = gd.GetStringValue("BroadcastEmailContent");
         emailSubjectTextBox.Text = gd.GetStringValue("BroadcastEmailSubject");
     }
 }
Ejemplo n.º 11
0
 public EditorModel(DirectoryInfo local, DirectoryInfo global, DirectoryInfo program)
 {
     this.VideoFolder=local;
     this.RootFolder=global;
     this.ProgramFolder=program;
     Montage = new MontageModel(360000);
     Locations = new Locations(this);
     WindowState = new WindowState();
     Global = new GlobalData();
 }
Ejemplo n.º 12
0
    //===============================================================
    // Function: saveButton_Click
    //===============================================================
    protected void saveButton_Click(object sender, EventArgs e)
    {
        GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
        gd.UpdateStringValue("BroadcastEmailContent", emailContentTextBox.Text.Trim());
        gd.UpdateStringValue("BroadcastEmailSubject", emailSubjectTextBox.Text.Trim());

        gd.UpdateStringValue("BroadcastEmailWaiting", "Y");

        Response.Redirect("main.aspx");
    }
Ejemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     gData = GameObject.FindGameObjectWithTag ("GlobalData").GetComponent<GlobalData> ();
     Transform canvas = GameObject.FindGameObjectWithTag ("UI").transform;
     canvas.FindChild ("UsernameLable").GetComponent<Text> ().text = StringCollection.USERNAME;
     canvas.FindChild ("PasswordLable").GetComponent<Text> ().text = StringCollection.PASSWORD;
     canvas.FindChild ("Login").FindChild ("Text").GetComponent<Text> ().text = StringCollection.LOGIN;
     canvas.FindChild ("Reg").FindChild ("Text").GetComponent<Text> ().text = StringCollection.REG;
     username = canvas.FindChild ("Username").GetComponent<InputField> ();
     password = canvas.FindChild ("Password").GetComponent<InputField> ();
 }
Ejemplo n.º 14
0
    //===============================================================
    // Function: saveButton_Click
    //===============================================================
    protected void saveButton_Click(object sender, EventArgs e)
    {
        GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
        gd.UpdateStringValue("PopularSearchString1", popularSearchString1TextBox.Text.Trim());
        gd.UpdateStringValue("PopularSearchString2", popularSearchString2TextBox.Text.Trim());
        gd.UpdateStringValue("PopularSearchString3", popularSearchString3TextBox.Text.Trim());
        gd.UpdateStringValue("PopularSearchString4", popularSearchString4TextBox.Text.Trim());
        gd.UpdateStringValue("PopularSearchString5", popularSearchString5TextBox.Text.Trim());

        Response.Redirect("main.aspx");
    }
Ejemplo n.º 15
0
 //===============================================================
 // Function: Page_Load
 //===============================================================
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
         popularSearchString1TextBox.Text = gd.GetStringValue("PopularSearchString1");
         popularSearchString2TextBox.Text = gd.GetStringValue("PopularSearchString2");
         popularSearchString3TextBox.Text = gd.GetStringValue("PopularSearchString3");
         popularSearchString4TextBox.Text = gd.GetStringValue("PopularSearchString4");
         popularSearchString5TextBox.Text = gd.GetStringValue("PopularSearchString5");
     }
 }
Ejemplo n.º 16
0
        public MainWindow()
        {
            InitializeComponent();
            
            if (this.NotInDesignMode())
            {
                _globalData = DIService.GetSingleton<GlobalData>();
                _globalData.MainWindow = this;

                foreach (var contentControl in _globalData.ContentViews)
                    _globalData.SetChildContentViews(contentControl.GetType(), contentControl.FindChildControls<UserControl>());
            }
        }
Ejemplo n.º 17
0
        public Friends()
        {
            InitializeComponent();

            if (this.NotInDesignMode())
            {
                OnlineFriends.FriendItemSelected += FriendItem_Selected;
                AllFriends.FriendItemSelected += FriendItem_Selected;

                _globalData = DIService.GetSingleton<GlobalData>();
                _friendsRepo = DIService.GetSingleton<FriendsRepo>();
                _dialogMessagesRepo = DIService.GetSingleton<DialogMessagesRepo>();
            }
        }
Ejemplo n.º 18
0
	private static GlobalData GetInstance()
	{
		if (instance == null)
        {
            instance = GameObject.FindObjectOfType(typeof(GlobalData)) as GlobalData;
 
            if (instance == null)
            {
                instance = new GameObject("GlobalData").AddComponent<GlobalData>();
            }
			DontDestroyOnLoad(instance);
        }
        return instance;
	}
Ejemplo n.º 19
0
 static CourseTreeData Convert(GlobalData data)
 {
     var converted = new CourseTreeData();
     converted.Directory = data.GlobalDataFolder;
     converted.Videos = new List<VideoPublishSummary>();
     converted.Structure=new CourseStructure();
     foreach (var e in data.VideoData)
     {
         converted.Videos.Add(new VideoPublishSummary(e));
         if (e.TopicGuid != null)
             converted.Structure.VideoToTopicRelations.Add(new VideoToTopicRelation { VideoGuid = e.Guid, TopicGuid = e.TopicGuid, NumberInTopic = e.NumberInTopic });
     }
     converted.Structure.RootTopic = data.TopicsRoot;
     return converted;
 }
Ejemplo n.º 20
0
    //===============================================================
    // Function: saveButton_Click
    //===============================================================
    public void saveButton_Click(object sender, EventArgs e)
    {
        SedogoUser user = new SedogoUser(Session["loggedInUserFullName"].ToString(),
            int.Parse(Session["loggedInUserID"].ToString()));

        if (profilePicFileUpload.PostedFile.ContentLength != 0)
        {
            int fileSizeBytes = profilePicFileUpload.PostedFile.ContentLength;

            GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
            string fileStoreFolder = gd.GetStringValue("FileStoreFolder") + @"\temp";

            string originalFileName = Path.GetFileName(profilePicFileUpload.PostedFile.FileName);
            string destPath = Path.Combine(fileStoreFolder, originalFileName);
            int status = -1;
            if ((profilePicFileUpload.PostedFile.ContentType == "image/jpeg"
                || profilePicFileUpload.PostedFile.ContentType == "image/gif"
                || profilePicFileUpload.PostedFile.ContentType == "image/png")
                && Path.GetExtension(destPath) != ""
                )
            {
                destPath = destPath.Replace(" ", "_");
                destPath = MiscUtils.GetUniqueFileName(destPath);
                string savedFilename = Path.GetFileName(destPath);

                profilePicFileUpload.PostedFile.SaveAs(destPath);

                status = MiscUtils.CreatePreviews(Path.GetFileName(destPath),
                    int.Parse(Session["loggedInUserID"].ToString()));
            }

            if (status >= 0)
            {
                Response.Redirect("profileRedirect.aspx");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert(\"This type of image is not supported, please choose another.\");", true);
            }
        }
        else
        {
            user.avatarNumber = int.Parse(avatarComboBox.SelectedValue);
            user.Update();

            Response.Redirect("profileRedirect.aspx");
        }
    }
Ejemplo n.º 21
0
    //===============================================================
    // Function: uploadProfilePicButton_click
    //===============================================================
    protected void uploadProfilePicButton_click(object sender, EventArgs e)
    {
        if (profilePicFileUpload.PostedFile.ContentLength != 0)
        {
            int fileSizeBytes = profilePicFileUpload.PostedFile.ContentLength;

            GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
            string fileStoreFolder = gd.GetStringValue("FileStoreFolder") + @"\temp";

            string originalFileName = Path.GetFileName(profilePicFileUpload.PostedFile.FileName);
            string destPath = Path.Combine(fileStoreFolder, originalFileName);
            destPath = destPath.Replace(" ", "_");
            destPath = MiscUtils.GetUniqueFileName(destPath);
            string savedFilename = Path.GetFileName(destPath);

            int status = -1;

            if ( ( profilePicFileUpload.PostedFile.ContentType == "image/jpeg"
                || profilePicFileUpload.PostedFile.ContentType == "image/pjpeg"
                || profilePicFileUpload.PostedFile.ContentType == "image/gif"
                || profilePicFileUpload.PostedFile.ContentType == "image/png" )
                && Path.GetExtension(destPath) != ""
                )
            {
                if (!Directory.Exists(Path.GetDirectoryName(destPath)))
                {
                    Directory.CreateDirectory(Path.GetDirectoryName(destPath));
                }
                profilePicFileUpload.PostedFile.SaveAs(destPath);

                status = MiscUtils.CreatePreviews(Path.GetFileName(destPath), int.Parse(Session["loggedInUserID"].ToString()));

                // PD 3/12/10 - Removed due to server error on file upload
                var user = new SedogoUser(string.Empty, int.Parse(Session["loggedInUserID"].ToString()));
                ImageHelper.GetRelativeImagePath(user.userID, user.GUID, ImageType.UserPreview, true);
                ImageHelper.GetRelativeImagePath(user.userID, user.GUID, ImageType.UserThumbnail, true);
            }

            if (status >= 0)
            {
                Response.Redirect("profileRedirect.aspx");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert(\"This type of image is not supported or the file extension is missing, please choose another.\");", true);
            }
        }
    }
Ejemplo n.º 22
0
        public Content()
        {
            InitializeComponent();

            if (this.NotInDesignMode())
            {
                _globalData = DIService.GetSingleton<GlobalData>();

                foreach (UserControl contentControl in MainGrid.Children)
                {
                    _globalData.ContentViews.Add(contentControl);
                }

                _globalData.PreviousView = _globalData.ContentViews.First(x => x.Visibility == Visibility.Visible);
                _globalData.CurrentView = _globalData.ContentViews.First(x => x.Visibility == Visibility.Visible);
            }
        }
Ejemplo n.º 23
0
 public static string CreateBackup(GlobalData global, List<EditorModel> models)
 {
     var glob=global.GlobalDataFolder.FullName;
     var builder = new StringBuilder();
     builder.AppendFormat("xcopy \"{0}\\{1}\" .\\\r\n", glob, Locations.GlobalFileName);
     builder.AppendFormat("xcopy \"{0}\\{1}\" .\\\r\n", glob, Locations.PublishingFileName);
     foreach (var e in models)
     {
         var relative = global.Locations.RelativeToGlobal(e.VideoFolder.FullName);
         builder.AppendFormat("mkdir \"{0}\"\r\n", relative);
         var format="xcopy \"{0}{1}\\{2}\" \".{1}\\\"\r\n";
         builder.AppendFormat(format, glob, relative, Locations.FaceVideoFileName);
         builder.AppendFormat(format, glob, relative, Locations.DesktopVideoFileName);
         builder.AppendFormat(format, glob, relative, Locations.LocalFileName);
     }
     return builder.ToString();
 }
Ejemplo n.º 24
0
        public PublishViewModel(GlobalData globalData)
        {
            Levels = new ObservableCollection<TopicLevel>();
            this.GlobalData = globalData;
            Root = new TopicWrap[] { new TopicWrap(globalData.TopicsRoot) };
            UnassignedVideos = new ObservableCollection<VideoWrap>();
            foreach (var e in GlobalData.VideoData.Where(z => z.TopicGuid == Guid.Empty))
                UnassignedVideos.Add(new VideoWrap(e));
            foreach(var e in Root[0].Subtree.OfType<TopicWrap>())
                foreach (var v in GlobalData.VideoData.Where(z => z.TopicGuid == e.Topic.Guid).OrderBy(z => z.NumberInTopic))
                {
                    var vw = new VideoWrap(v);
                    e.Items.Add(vw);
                    vw.Parent = e;
                }
            foreach (var level in globalData.TopicLevels)
                Levels.Add(level);

            AddCommand = new RelayCommand(Add, () => SelectedItem != null && SelectedItem is TopicWrap);
            RemoveCommand = new RelayCommand(Remove, () => SelectedItem != null && SelectedItem != Root[0]);
            DeleteCommand = new RelayCommand(DeleteFromList, () => SelectedItemInUnassignedList != null);
        }
Ejemplo n.º 25
0
        //THIS IS listed as get calendar in serverhandler.cs
        async Task onGetEvent(object sender, EventArgs e)
        {
            //NOT IMPLEMENTED SERVER SIDE
            try
            {
                GlobalData g = new GlobalData();
                g.CurrentUser             = new UserObject();
                g.CurrentUser.ApartmentID = 1;


                List <EventObject> eve          = await(ServerHandeler.getCalendar(g));
                string             outputString = "";
                foreach (EventObject ev in eve)
                {
                    outputString += ev.name;
                }

                Output.Text = outputString;
            }
            catch (Exception except)
            {
                Output.Text = except.Message;
            }
        }
Ejemplo n.º 26
0
        public void xmlDataWrite(Data.GloablNode globalNode, string excelDirFullPathClient)
        {
            string returnStr = "";

            for (int i = 0; i < globalNode.getFileNodes().Count; i++)
            {
                string fileName = globalNode.getFileNodes()[i].getFileName();
                returnStr = returnStr + GlobalData.getLuaGlobalBlock() + fileName + " = {\r\n";
                returnStr = returnStr + new LuaFileNodeWriter().getString(globalNode.getFileNodes()[i]);
                if (i == globalNode.getFileNodes().Count - 1)
                {
                    returnStr = returnStr + GlobalData.getLuaGlobalBlock() + "}\r\n";
                }
                else
                {
                    returnStr = returnStr + GlobalData.getLuaGlobalBlock() + "},\r\n";
                }
            }
            returnStr = "return {\r\n" + returnStr + "}";
            string luaFileName = excelDirFullPathClient + @"\_table_global.lua";

            if (File.Exists(luaFileName))
            {
                File.Delete(luaFileName);
            }
            FileStream   fs = new FileStream(luaFileName, FileMode.OpenOrCreate);
            StreamWriter sw = new StreamWriter(fs);

            //开始写入
            sw.Write(returnStr);
            //清空缓冲区
            sw.Flush();
            //关闭流
            sw.Close();
            fs.Close();
        }
        //设置UI文字
        public void SetUIString()
        {
            GlobalData global = GlobalData.gd;

            groupBox1.Text     = global.groupBox1_string;
            groupBox2.Text     = global.groupBox2_string;
            input_label1.Text  = global.input_label1_string;
            info_label1.Text   = global.info_label1_string;
            input_label2.Text  = global.input_label2_string;
            info_label2.Text   = global.info_label2_string;
            input_label3.Text  = global.input_label3_string;
            info_label3.Text   = global.info_label3_string;
            input_label4.Text  = global.input_label4_string;
            info_label4.Text   = global.info_label4_string;
            input_label5.Text  = global.input_label5_string;
            info_label5.Text   = global.info_label5_string;
            input_label6.Text  = global.input_label6_string;
            info_label6.Text   = global.info_label6_string;
            input_label7.Text  = global.input_label7_string;
            info_label7.Text   = global.info_label7_string;
            input_label8.Text  = global.input_label8_string;
            info_label8.Text   = global.info_label8_string;
            input_label9.Text  = global.input_label9_string;
            info_label9.Text   = global.info_label9_string;
            input_label10.Text = global.input_label10_string;
            info_label10.Text  = global.info_label10_string;
            input_label11.Text = global.input_label11_string;
            info_label11.Text  = global.info_label11_string;
            input_label12.Text = global.input_label12_string;
            info_label12.Text  = global.info_label12_string;
            result_label1.Text = global.result_label1_string;
            result_label2.Text = global.result_label2_string;
            button1.Text       = global.button1_string;
            button2.Text       = global.button2_string;
            button3.Text       = global.button3_string;
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 模拟本地动作
        /// </summary>
        private IEnumerator ClientPlayAct(int actCard, int userId, PlayerActType act)
        {
            var pushPlayerActS2C = new PushPlayerActS2C();

            pushPlayerActS2C.actCard = actCard;
            pushPlayerActS2C.userId  = userId;
            pushPlayerActS2C.act     = act;
            NetMgr.Instance.OnClientReceiveBuff(MsgNoS2C.S2C_ROOM_PLAYER_ACT_BROADCAST.GetHashCode(), 0, pushPlayerActS2C);
            yield return(new WaitForSeconds(0.5f));

            curSit = GlobalData.GetNextSit(curSit, 1);

            if (act == PlayerActType.PUT_CARD)//PUT_CARD
            {
                //int getCard = getRangeCard(false);
                //var getCardS2C = new PushPlayerActS2C();
                //getCardS2C.actCard = getCard;
                //getCardS2C.userId = battleProxy.playerSitInfoDic[curSit].userId;
                //getCardS2C.act = PlayerActType.GET_CARD;
                int getCard    = getRangeCard(false);
                var getCardS2C = new PushPlayerActS2C();
                getCardS2C.actCard = getCard;
                getCardS2C.userId  = battleProxy.playerSitInfoDic[curSit].userId;
                getCardS2C.act     = PlayerActType.GET_CARD;
                NetMgr.Instance.OnClientReceiveBuff(MsgNoS2C.S2C_ROOM_PLAYER_ACT_BROADCAST.GetHashCode(), 0, getCardS2C);
                yield return(new WaitForSeconds(0.5f));

                GameMgr.Instance.StartCoroutine(ClientPlayerTip());
            }
            else
            {
                yield return(new WaitForSeconds(0.5f));

                GameMgr.Instance.StartCoroutine(ClientPlayerTip());
            }
        }
Ejemplo n.º 29
0
    //===============================================================
    // Function: uploadProfilePicButton_click
    //===============================================================
    protected void uploadProfilePicButton_click(object sender, EventArgs e)
    {
        int eventID = int.Parse(Request.QueryString["EID"]);
        int userID = int.Parse(Session["loggedInUserID"].ToString());

        if (goalPicFileUpload.PostedFile.ContentLength != 0)
        {
            SedogoEvent sedogoEvent = new SedogoEvent((string)Session["loggedInUserFullName"], eventID);
            sedogoEvent.Update();

            int fileSizeBytes = goalPicFileUpload.PostedFile.ContentLength;

            GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
            string fileStoreFolder = gd.GetStringValue("FileStoreFolder") + @"\temp";

            string originalFileName = Path.GetFileName(goalPicFileUpload.PostedFile.FileName);
            string destPath = Path.Combine(fileStoreFolder, originalFileName);
            destPath = destPath.Replace(" ", "_");
            destPath = MiscUtils.GetUniqueFileName(destPath);
            string savedFilename = Path.GetFileName(destPath);

            goalPicFileUpload.PostedFile.SaveAs(destPath);

            int status = MiscUtils.CreateGoalPicPreviews(Path.GetFileName(destPath),
                eventID, (string)Session["loggedInUserFullName"], userID, captionTextBox.Text);

            if (status >= 0)
            {
                Response.Redirect("morePictures.aspx?EID=" + eventID.ToString());
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert(\"This type of image is not supported, please choose another.\");", true);
            }
        }
    }
Ejemplo n.º 30
0
    private void Start()
    {
        GD = GlobalData.GD;
        DT = DataTransfer.DT;

        nRoles = GD.GetNRoles();

        lang = LANG.GetLanguage();

        itemsPlayAllPlayers    = new List <Item>();
        itemsPlayPickedPlayers = new List <Item>();

        /*for (int x = 0; x < nRoles; x++)
         * {
         *  GameObject go = Instantiate(prefabButtonItem);
         *  Item i = go.GetComponent<Item>();
         *  i.setAsList();
         *  i.setDoubleText();
         *  i.setText1(GD.getRole(x).text);
         *  i.setTextColor(GD.getRoleColor(x));
         *  itemsRolesStats[x] = i;
         *  go.transform.SetParent(listRolesStats);
         * }*/
    }
Ejemplo n.º 31
0
        private void Start_Click(object sender, RoutedEventArgs e)
        {
            bool flag = !this.bPause;

            if (flag)
            {
                bool flag2 = !GlobalData.Connectflag && !GlobalData.ANT_Connectflag;
                if (flag2)
                {
                    MessageBox.Show(MultiLanguage.Warn6, MultiLanguage.Warn_t, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }
                this.bPause = true;
                this.timer_Init();
                bool connectflag = GlobalData.Connectflag;
                if (connectflag)
                {
                    GlobalData.SendGear(this.gear);
                }
                DateTime NOW = DateTime.Now;
                GlobalData.StartTime = Convert.ToInt64(UTCTimeOperate.ConvertDateTimeInt(NOW)).ToString();
                this.Start.Content   = MultiLanguage.Pause;
            }
            else
            {
                this.bPause = false;
                this.timer_Uninit();
                this.Start.Content = MultiLanguage.Start;
            }
            bool flag3 = !GlobalData.NormalTrainingflag;

            if (flag3)
            {
                GlobalData.NormalTrainingflag = true;
            }
        }
        public void InitDictionary()
        {
            if (_illustrationDataDictionary.Count != 0)
            {
                return;
            }
            Dictionary <int, IllustratedData> datas = IllustratedData.IllustratedDataDictionary;
            IllustratedData data;
            Dictionary <int, List <IllustrationInfo> > secondDic;
            List <IllustrationInfo> roleList;
            RoleInfo info;

            foreach (var value in datas)
            {
                data = value.Value;
                if (!_illustrationDataDictionary.ContainsKey(data.type))
                {
                    _illustrationDataDictionary.Add(data.type, new Dictionary <int, List <IllustrationInfo> >());
                    bigTitleStringDictionary.Add(data.type, Localization.Get(data.type_name));
                }
                secondDic = _illustrationDataDictionary[data.type];
                if (!secondDic.ContainsKey(data.sheet))
                {
                    secondDic.Add(data.sheet, new List <IllustrationInfo>());
                    smallTitleStringDictionary.Add(data.sheet, Localization.Get(data.sheet_name));
                }
                roleList = secondDic[data.sheet];
                if (data.resData.type == BaseResType.Hero)
                {
                    HeroData heroData = HeroData.GetHeroDataByID(data.resData.id);
                    if (heroData.hero_type == 2)
                    {
                        PlayerInfo player = new PlayerInfo((uint)0, (uint)data.resData.id, (uint)0, (uint)0, (uint)0, 0, "");
                        player.advanceLevel = data.resData.star;
                        player.level        = GlobalData.GetGlobalData().playerLevelMax;
                        roleList.Add(new IllustrationInfo(player));
                    }
                    else
                    {
                        HeroInfo hero = new HeroInfo((uint)data.resData.id, data.resData.id, 1, 0, data.resData.star, GlobalData.GetGlobalData().playerLevelMax);
                        roleList.Add(new IllustrationInfo(hero));
                    }
                }
                else if (data.resData.type == BaseResType.Equipment)
                {
                }
            }
        }
Ejemplo n.º 33
0
 public void LoadBossLevel(GlobalData.BossId bossId)
 {
     switch (bossId)
     {
         case GlobalData.BossId.Flower:
             SoundManager.Instance.PlayBgm(SoundManager.Instance.bgm_boss_flower);
             LoadLevel(mFlowerBossLevelData);
             break;
         case GlobalData.BossId.Chocolate:
             SoundManager.Instance.PlayBgm(SoundManager.Instance.bgm_boss_chocolate);
             LoadLevel(mChocolateBossLevelData);
             break;
         case GlobalData.BossId.Imposter:
             SoundManager.Instance.PlayBgm(SoundManager.Instance.bgm_boss_imposter);
             if(GlobalData.sSelectedCharacter == SelectedCharacter.Rose)
             {
                 LoadLevel(mImposterRoseBossLevelData);
             }
             else
             {
                 LoadLevel(mImposterVuBossLevelData);
             }
             break;
     }
 }
Ejemplo n.º 34
0
 public void showUserInfoPanel()
 {
     SceneManager.getInstance().showUserInfoPanel(GlobalData.getInstance().myAvatarVO);
 }
Ejemplo n.º 35
0
 void Start()
 {
     initUI();
     GameManager.getInstance().Server.onResponse += onResponse;
     GlobalData.getInstance().noticeChange += onNoticeChange;
 }
Ejemplo n.º 36
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     GlobalData.Save();
 }
Ejemplo n.º 37
0
 private void MubanHelperForm_Load(object sender, EventArgs e)
 {
     cbxChangwat.Items.AddRange(GlobalData.CompleteGeocodeList().FlatList().Where(x => x.type.IsCompatibleEntityType(EntityType.Changwat)).ToArray());
 }
Ejemplo n.º 38
0
 public void Start()
 {
     _globalData = App.GetGameData <GlobalData>();
 }
Ejemplo n.º 39
0
        public void LoadFromDb()
        {
            var biz = GlobalData.GetInstance <ILogisticsService>();

            this.Datas = new ObservableCollection <LogisticServices>(biz.GetAll());
        }
Ejemplo n.º 40
0
 /// <summary>
 /// 保存设置
 /// </summary>
 /// <param name="pinganPayConfig"></param>
 public void SaveConfig(PinganPayConfig pinganPayConfig)
 {
     GlobalData.SavePinganConfig(pinganPayConfig);
 }
Ejemplo n.º 41
0
    //===============================================================
    // Function: SendInviteEmail
    //===============================================================
    private Boolean SendInviteEmail(int eventID, string emailAddress, string additionalInviteText,
        string dateString, SedogoEvent currentEvent, SedogoUser currentUser,
        out string errorMessageDescription)
    {
        Boolean sentOK = false;
        GlobalData gd = new GlobalData("");
        errorMessageDescription = "";

        if (MiscUtils.IsValidEmailAddress(emailAddress) == true)
        {
            try
            {
                // Check if they have already been invited
                int inviteCount = EventInvite.GetInviteCountForEmailAddress(eventID, emailAddress);
                if (inviteCount == 0)
                {
                    StringBuilder emailBodyCopy = new StringBuilder();

                    // Check if they are a Sedogo account holder
                    int sedogoUserID = SedogoUser.GetUserIDFromEmailAddress(emailAddress);
                    Boolean enableSendEmails = true;

                    if( sedogoUserID != currentUser.userID )
                    {
                        EventInvite newInvite = new EventInvite(Session["loggedInUserFullName"].ToString());
                        newInvite.eventID = eventID;
                        newInvite.emailAddress = emailAddress;
                        newInvite.inviteAdditionalText = additionalInviteText;
                        newInvite.userID = sedogoUserID;
                        newInvite.Add();

                        string inviteURL = gd.GetStringValue("SiteBaseURL");
                        inviteURL = inviteURL + "?EIG=" + newInvite.eventInviteGUID;
                        string eventURL = gd.GetStringValue("SiteBaseURL");
                        eventURL = eventURL + "?EID=" + currentEvent.eventID.ToString();

                        emailBodyCopy.AppendLine("<html>");
                        emailBodyCopy.AppendLine("<head><title></title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
                        emailBodyCopy.AppendLine("<style type=\"text/css\">");
                        emailBodyCopy.AppendLine("	body, td, p { font-size: 15px; color: #9B9885; font-family: Arial, Helvetica, Sans-Serif }");
                        emailBodyCopy.AppendLine("	p { margin: 0 }");
                        emailBodyCopy.AppendLine("	h1 { color: #00ccff; font-size: 18px; font-weight: bold; }");
                        emailBodyCopy.AppendLine("	a, .blue { color: #00ccff; text-decoration: none; }");
                        emailBodyCopy.AppendLine("	img { border: 0; }");
                        emailBodyCopy.AppendLine("</style></head>");
                        emailBodyCopy.AppendLine("<body bgcolor=\"#f0f1ec\">");
                        emailBodyCopy.AppendLine("  <table width=\"692\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
                        //emailBodyCopy.AppendLine("	<tr><td colspan=\"3\"><img src=\"http://www.sedogo.com/email-template/images/email-template_01.png\" width=\"692\" height=\"32\" alt=\"\"></td></tr>");
                        emailBodyCopy.AppendLine("	<tr><td style=\"background: #fff\" width=\"30\"></td>");
                        emailBodyCopy.AppendLine("		<td style=\"background: #fff\" width=\"632\">");
                        if (sedogoUserID > 0)
                        {
                            SedogoUser inviteUser = new SedogoUser(Session["loggedInUserFullName"].ToString(), sedogoUserID);
                            if (inviteUser.enableSendEmails == false)
                            {
                                enableSendEmails = false;
                            }

                            inviteURL = inviteURL + "&UID=" + sedogoUserID.ToString();

                            emailBodyCopy.AppendLine("			<h1>You are invited to join the following goal:</h1>");
                            emailBodyCopy.AppendLine("			<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\">");
                            emailBodyCopy.AppendLine("				<tr>");
                            emailBodyCopy.AppendLine("					<td width=\"60\">What:</td>");
                            emailBodyCopy.AppendLine("					<td width=\"10\">&nbsp;</td>");
                            emailBodyCopy.AppendLine("					<td width=\"530\">" + currentEvent.eventName + "</td>");
                            emailBodyCopy.AppendLine("				</tr>");
                            emailBodyCopy.AppendLine("				<tr>");
                            emailBodyCopy.AppendLine("					<td valign=\"top\">Where:</td>");
                            emailBodyCopy.AppendLine("					<td width=\"10\">&nbsp;</td>");
                            emailBodyCopy.AppendLine("					<td>" + currentEvent.eventVenue + "</td>");
                            emailBodyCopy.AppendLine("				</tr>");
                            emailBodyCopy.AppendLine("				<tr>");
                            emailBodyCopy.AppendLine("					<td valign=\"top\">When:</td>");
                            emailBodyCopy.AppendLine("					<td width=\"10\">&nbsp;</td>");
                            emailBodyCopy.AppendLine("					<td>" + dateString + "</td>");
                            emailBodyCopy.AppendLine("				</tr>");
                            emailBodyCopy.AppendLine("			</table>");
                            emailBodyCopy.AppendLine("			<p><span class=\"blue\">" + currentUser.firstName + "</span> has created this future goal on <a href=\"http://www.sedogo.com\">sedogo.com</a> and wants you to join in.</p>");
                            emailBodyCopy.AppendLine("			<p>To be part of this event, <a href=\"" + inviteURL + "\"><u>click here</u></a>.</p>");
                            emailBodyCopy.AppendLine("			<p>To see who else is part of making this goal happen, <a href=\"" + eventURL + "\"><u>click here</u></a>.</p>");
                            emailBodyCopy.AppendLine("			<p>To view this goal, <a href=\"" + eventURL + "\"><u>click here</u></a>.</p>");
                        }
                        else
                        {
                            emailBodyCopy.AppendLine("			<h1>You are invited to join the following goal:</h1>");
                            emailBodyCopy.AppendLine("			<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\">");
                            emailBodyCopy.AppendLine("				<tr>");
                            emailBodyCopy.AppendLine("					<td width=\"60\">What:</td>");
                            emailBodyCopy.AppendLine("					<td width=\"10\">&nbsp;</td>");
                            emailBodyCopy.AppendLine("					<td width=\"530\">" + currentEvent.eventName + "</td>");
                            emailBodyCopy.AppendLine("				</tr>");
                            emailBodyCopy.AppendLine("				<tr>");
                            emailBodyCopy.AppendLine("					<td valign=\"top\">Where:</td>");
                            emailBodyCopy.AppendLine("					<td width=\"10\">&nbsp;</td>");
                            emailBodyCopy.AppendLine("					<td>" + currentEvent.eventVenue + "</td>");
                            emailBodyCopy.AppendLine("				</tr>");
                            emailBodyCopy.AppendLine("				<tr>");
                            emailBodyCopy.AppendLine("					<td valign=\"top\">When:</td>");
                            emailBodyCopy.AppendLine("					<td width=\"10\">&nbsp;</td>");
                            emailBodyCopy.AppendLine("					<td>" + dateString + "</td>");
                            emailBodyCopy.AppendLine("				</tr>");
                            emailBodyCopy.AppendLine("			</table>");
                            emailBodyCopy.AppendLine("			<p><span class=\"blue\">" + currentUser.firstName + "</span> has created this future goal on <a href=\"http://www.sedogo.com\">sedogo.com</a> and wants you to join in.</p>");
                            emailBodyCopy.AppendLine("			<p>To be part of this event, <a href=\"" + inviteURL + "\">sign up</a> for a free sedogo account now.");
                            emailBodyCopy.AppendLine("			<p>When you have completed the registration process, <a href=\"" + eventURL + "\">click here</a> to view this event.");
                        }
                        emailBodyCopy.AppendLine("			<br /><br />");
                        emailBodyCopy.AppendLine("			<p>Regards</p><a href=\"http://www.sedogo.com\" class=\"blue\"><strong>The Sedogo Team.</strong></a><br />");
                        emailBodyCopy.AppendLine("			<br /><br /><br /><a href=\"http://www.sedogo.com\">");
                        //emailBodyCopy.AppendLine("			<img src=\"http://www.sedogo.com/email-template/images/logo.gif\" />");
                        emailBodyCopy.AppendLine("			</a></td>");
                        emailBodyCopy.AppendLine("		<td style=\"background: #fff\" width=\"30\"></td></tr><tr><td colspan=\"3\">");
                        //emailBodyCopy.AppendLine("			<img src=\"http://www.sedogo.com/email-template/images/email-template_05.png\" width=\"692\" height=\"32\" alt=\"\">");
                        emailBodyCopy.AppendLine("		</td></tr><tr><td colspan=\"3\"><small>This message was intended for " + emailAddress + ". To stop receiving these emails, go to your profile and uncheck the 'Enable email notifications' option.<br/>Sedogo offices are located at Sedogo Ltd, The Studio, 17 Blossom St, London E1 6PL.</small></td></tr>");
                        emailBodyCopy.AppendLine("		</td></tr></table></body></html>");

                        string emailSubject = currentUser.firstName + " wants you to be a part of " + currentEvent.eventName + " " + dateString + "!";

                        string SMTPServer = gd.GetStringValue("SMTPServer");
                        string mailFromAddress = gd.GetStringValue("MailFromAddress");
                        string mailFromUsername = gd.GetStringValue("MailFromUsername");
                        string mailFromPassword = gd.GetStringValue("MailFromPassword");

                        if (enableSendEmails == true)
                        {
                            try
                            {
                                MailMessage message = new MailMessage(mailFromAddress, emailAddress);
                                message.ReplyTo = new MailAddress("*****@*****.**");

                                message.Subject = emailSubject;
                                message.Body = emailBodyCopy.ToString();
                                message.IsBodyHtml = true;
                                SmtpClient smtp = new SmtpClient();
                                smtp.Host = SMTPServer;
                                if (mailFromPassword != "")
                                {
                                    // If the password is blank, assume mail relay is permitted
                                    smtp.Credentials = new System.Net.NetworkCredential(mailFromAddress, mailFromPassword);
                                }
                                smtp.Send(message);

                                newInvite.inviteEmailSent = true;
                                newInvite.inviteEmailSentDate = DateTime.Now;
                                newInvite.inviteEmailSentEmailAddress = emailAddress;
                                newInvite.Update();

                                SentEmailHistory emailHistory = new SentEmailHistory(Session["loggedInUserFullName"].ToString());
                                emailHistory.subject = emailSubject;
                                emailHistory.body = emailBodyCopy.ToString();
                                emailHistory.sentFrom = mailFromAddress;
                                emailHistory.sentTo = emailAddress;
                                emailHistory.Add();
                            }
                            catch (Exception ex)
                            {
                                SentEmailHistory emailHistory = new SentEmailHistory(Session["loggedInUserFullName"].ToString());
                                emailHistory.subject = emailSubject;
                                emailHistory.body = ex.Message + " -------- " + emailBodyCopy.ToString();
                                emailHistory.sentFrom = mailFromAddress;
                                emailHistory.sentTo = emailAddress;
                                emailHistory.Add();
                            }
                        }
                        sentOK = true;
                    }
                    else
                    {
                        errorMessageDescription = emailAddress + " - you cannot invite yourself";
                    }
                }
                else
                {
                    errorMessageDescription = emailAddress + " - already invited";
                }
            }
            catch (Exception ex)
            {
                errorMessageDescription = emailAddress + " - " + ex.Message;
            }
        }
        else
        {
            errorMessageDescription = emailAddress + " - invalid email address";
        }

        return sentOK;
    }
Ejemplo n.º 42
0
 /// <summary>
 /// 重新加载配置
 /// </summary>
 public PinganPayConfig ReLoadConfig()
 {
     return(GlobalData.LoadPinganConfig(true));
 }
    IEnumerator StartVictorySequence()
    {
        // Hide All flying bubble
        if (_flyingBubbles.Count > 0)
        {
            foreach (Bubble b in _flyingBubbles)
            {
                b.gameObject.SetActive(false);
                RemainBubbleShoot++;
            }
        }
        _flyingBubbles.Clear();

        // Hide Bullets
        if (_loadedBubble != null)
        {
            _loadedBubble.gameObject.SetActive(false);
            _loadedBubble = null;
            RemainBubbleShoot++;
        }
        if (_waitingBubble != null)
        {
            _waitingBubble.gameObject.SetActive(false);
            _waitingBubble = null;
            RemainBubbleShoot++;
        }
        if (needUpdateHUD)
        {
            UpdateHUD();
            needUpdateHUD = false;
        }

        yield return(new WaitForSeconds(3f));

        // Shoot remain bubbles Up
        int pointEachBubble = GlobalData.PointReward[RemainBubbleShoot > 14 ? 14 : RemainBubbleShoot, 2];

        while (RemainBubbleShoot > 0)
        {
            Bubble b = (Instantiate(BubblePrefab, WaitingPosition.position, WaitingPosition.rotation) as GameObject).GetComponent("Bubble") as Bubble;
            b.SetBubbleColor(Random.Range(1, 10));

            StartCoroutine(b.shootUp(pointEachBubble));

            RemainBubbleShoot--;
            //UpdateHUD();
            yield return(new WaitForSeconds(0.1f));
        }
        //

        // Play squirrel win animation
        Animator animator = PlayerSquirrel.GetComponent <Animator>();

        animator.Play("Victory");
        AudioHelper.CreatePlayAudioObject(BaseManager.GetInstance().sfxVictory);

        yield return(new WaitForSeconds(2f));

        // Result calculate
        int highScore = Utilities.PlayerPrefs.GetInt("LevelHighScore-" + GlobalData.GetCurrentLevel(), 0);

        if (CurrentScore > highScore)
        {
            highScore = CurrentScore;
        }

        int star = 0;

        if (CurrentScore >= StarTargets[2])
        {
            star = 3;
        }
        else if (CurrentScore >= StarTargets[1])
        {
            star = 2;
        }
        else
        {
            star = 1;
        }

        int highStar = Utilities.PlayerPrefs.GetInt("LevelStar-" + GlobalData.GetCurrentLevel(), 0);

        if (star > highStar)
        {
            highStar = star;
        }

        int nextLevel = GlobalData.GetCurrentLevel() + 1;

        // Update Preference
        Utilities.PlayerPrefs.SetInt("LevelHighScore-" + GlobalData.GetCurrentLevel(), highScore);
        Utilities.PlayerPrefs.SetInt("LevelStar-" + GlobalData.GetCurrentLevel(), highStar);
        // Set icon switch\
        if (nextLevel <= BranchPairSetup.MAXLEVEL)
        {
            Utilities.PlayerPrefs.SetBool("LevelUnlocked-" + (GlobalData.GetCurrentLevel() + 1), true);

            LevelSelectController.NewUnlockedLevel           = GlobalData.GetCurrentLevel() + 1;
            LevelSelectController.needUpdateMoveSquirrelIcon = true;
        }

        Utilities.PlayerPrefs.Flush();



        // Update Text & Star
        txtWinScore.text     = CurrentScore.ToString();
        txtWinHighScore.text = highScore.ToString();

        for (int i = 0; i < star; i++)
        {
            StarDisplay[i].SetActive(true);
        }
        gameSceneController.WinMenu.gameObject.SetActive(true);

        for (int i = 0; i < star; i++)
        {
            MovingQueue moac = StarDisplay[i].GetComponent <MovingQueue>();
            moac.moveToLocal(new Vector3(0, 0, 0), .5f, new Vector3((i - 1) * 300, 0, 0));
            yield return(new WaitForSeconds(.5f));
        }
    }
    void Start()
    {
        gameSceneController = GameObject.FindObjectOfType <GameSceneController>();

        // BGM
        if (BaseManager.globalMenuMusic != null)
        {
            StartCoroutine(AudioHelper.FadeAudioObject(BaseManager.globalMenuMusic, -1f));
        }
        if (BaseManager.globalGameMusic == null)
        {
            // create and return the Intro Scene music audio
            BaseManager.globalGameMusic = AudioHelper.CreateGetFadeAudioObject(BaseManager.GetInstance().gameMusic, true, BaseManager.GetInstance().fadeClip, "Audio-GameMusic");
            // play the clip
            StartCoroutine(AudioHelper.FadeAudioObject(BaseManager.globalGameMusic, 0.5f));
        }
        // Load data (if not done yet)
        GlobalData.LoadLevelData();


        if (GlobalData.gameMode == GlobalData.GameMode.PUZZLE_MODE)
        {
            // create board
            GameObject board = Instantiate(ModePuzzlePrefab) as GameObject;
            _bubbleBoard = board.GetComponent <IBubbleBoard>();

            // Set Data
            RequiredSquirrel  = GlobalData.LevelRequire[GlobalData.GetCurrentLevel()];
            RemainBubbleShoot = GlobalData.StarTarget[GlobalData.GetCurrentLevel()][0];

            if (GlobalData.GetCurrentLevel() >= 40)
            {
                RemainBubbleShoot += 15;
            }

            StarTargets[0] = GlobalData.StarTarget[GlobalData.GetCurrentLevel()][1];
            StarTargets[1] = GlobalData.StarTarget[GlobalData.GetCurrentLevel()][2];
            StarTargets[2] = GlobalData.StarTarget[GlobalData.GetCurrentLevel()][3];

            float maxPoint = StarTargets[2] + StarTargets[2] * 15 / 100;
            for (int i = 0; i < 3; i++)
            {
                RectTransform tf = StarTargetFlags[i].GetComponent <RectTransform>();
                tf.anchoredPosition = new Vector2(StarTargets[i] / maxPoint * 266f, tf.anchoredPosition.y);
            }


            // Levelselect switch
            LevelSelectController.NewUnlockedLevel           = -1;
            LevelSelectController.needUpdateMoveSquirrelIcon = false;
        }
        else if (GlobalData.gameMode == GlobalData.GameMode.ENDLESS_MODE)
        {
            LittleSquirrelController.publicList.Clear();

            // create board
            GameObject board = Instantiate(ModeEndlessPrefab) as GameObject;
            _bubbleBoard = board.GetComponent <IBubbleBoard>();

            // Set Data
            RequiredSquirrel  = -1;
            RemainBubbleShoot = -1;

            BubbleRemainBoard.SetActive(false);
            SquirrelCounter.SetActive(false);
            HUDBGEndless.SetActive(true);
            SplitBar.SetActive(true);

            RECT_ScoreBoard.anchoredPosition = new Vector2(-134, -16);
            RECT_StarBar.anchoredPosition    = new Vector2(-122, -52);
            RECT_StarRealBar.sizeDelta       = new Vector2(470, 12.8f);
            RECT_StarRealBar.GetComponent <Image>().sprite = longStarBarSprite;

            for (int i = 0; i < 3; i++)
            {
                StarTargetFlags[i].SetActive(false);
            }

            EndlessLastScore   = 0;
            EndlessTargetScore = GlobalData.ENDLESS_TARGET_EACHLEVEL;
        }

        // InitHUD

        foreach (UnityEngine.UI.Text txt in txtLevelLabels)
        {
            txt.text = GlobalData.GetCurrentLevel().ToString();
        }

        // Finish InitHUD


        UpdateHUD();

        gameStarted    = false;
        gameEnded      = false;
        allLoadingDone = false;
        _bubbleBoard.InitBubbleBoard();

        InitBubbles();
        _usingArrow = false;

        _shootArrow.CreateDots();
        _shootArrow.UpdateArrow();
    }
Ejemplo n.º 45
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                ViewState["TEMPSEGS"] = ConfigurationManager.AppSettings["TempPlaningSegs"];
                string tipoPlanning = Request.QueryString["planning"];
                if (Session["planning"] == null)
                {
                    Session["planning"] = tipoPlanning;
                }
                if (Request.QueryString["rdrt"] != null && Request.QueryString["rdrt"].ToString().Equals("1"))
                {
                    Session["REDIRCUADRO"] = false;
                }
                else if (Request.QueryString["rdrt"] != null && Request.QueryString["rdrt"].ToString().Equals("0"))
                {
                    Session.Contents.Remove("REDIRCUADRO");
                }
            }

            taller = tallerPrim = base.Request.QueryString["tal"];
            DataSet dsTalleresPlanning = new DataSet();

            DBFunctions.Request(dsTalleresPlanning, IncludeSchema.NO, "select pt.PALM_ALMA2, pa.palm_descripcion from PTALLERESPLANNING pt, PALMACEN pa where pt.PALM_ALMA1 = '" + this.taller + "' and pt.PALM_ALMA2 = pa.PALM_ALMACEN and pa.tvig_vigencia='V';");
            try
            {
                if (dsTalleresPlanning.Tables[0].Rows.Count > 1)
                {
                    taller = "";
                    for (int k = 0; k < dsTalleresPlanning.Tables[0].Rows.Count; k++)
                    {
                        taller      += dsTalleresPlanning.Tables[0].Rows[k][0] + "' OR palm.palm_almacen='";
                        LabelT.Text += dsTalleresPlanning.Tables[0].Rows[k][1] + "-";
                    }

                    taller      = taller.Substring(0, (taller.Length - 24));
                    LabelT.Text = LabelT.Text.Substring(0, (LabelT.Text.Length - 1));
                }
                else
                {
                    LabelT.Text = DBFunctions.SingleData("SELECT palm.palm_descripcion FROM DBXSCHEMA.PALMACEN palm where palm.tvig_vigencia='V' and palm.Palm_almacen='" + this.taller + "'");
                }
            }
            catch (Exception err)
            {
                LabelT.Text = "Parametrizar tabla de plannings";
            }

            pagina  = Convert.ToInt32(base.Request["pag"]);
            horaAct = DateTime.Now.Hour;

            GenerarTablaPlanning();
            GenerarTabla2(sender, e);

            //iconos empresas " + GlobalData.getEMPRESA() + "
            try
            {
                string urlIconoEmpresa = DBFunctions.SingleDataGlobal("SELECT GEMP_iCONO FROM GEMPRESA WHERE GEMP_NOMBRE='" + GlobalData.getEMPRESA() + "';");
                Image1.ImageUrl = urlIconoEmpresa;
            }
            catch { }
        }
Ejemplo n.º 46
0
    public void OnDrag(PointerEventData eventData)
    {
        if (Input.GetMouseButton(2))
        {
            return;
        }
        if (_selfElement == null)
        {
            _selfElement = GlobalData.GetElement(transform.name);
        }
        Vector2 pos    = Utils.GetAnchoredPositionInContainer(Input.mousePosition) - _offset;
        Vector2 offset = pos - selfRect.anchoredPosition;

        DisplayObjectUtil.UpdateElementPosition(selfRect, _selfElement, pos);
        UlEventSystem.DispatchTrigger <UIEventType>(UIEventType.UpdateInspectorInfo);
        _alignInfo = DisplayObjectUtil.GetAlignLine(_selfElement, _alignInfo);
        if (_alignInfo?.HorizontalAlignLine != null)
        {
            Rectangle horizontalAlignRect = _alignInfo.HorizontalAlignLine;
            print($"_alignInfo.HorizontalAlignType: {_alignInfo.HorizontalAlignType}, isCenter: {_alignInfo.HorizontalAlignType == AlignType.HorizontalCenter}");
            _horizontalAlignLineManager.gameObject.SetActive(true);
            _horizontalAlignLineManager.transform.SetAsLastSibling();
            AlignType leftType  = _alignInfo.HorizontalAlignType;
            AlignType rightType = _alignInfo.OtherHorizontalAlignType;
            if (Math.Abs(_alignInfo.HorizontalAlignLine.Right - _selfElement.Right) < Math.Abs(_alignInfo.HorizontalAlignLine.Left - _selfElement.Left))
            {
                leftType  = _alignInfo.OtherHorizontalAlignType;
                rightType = _alignInfo.HorizontalAlignType;
            }
            _horizontalAlignLineManager.UpdateHorizontal(leftType,
                                                         rightType,
                                                         Element.InvConvertTo(new Vector2(horizontalAlignRect.X - GlobalData.AlignExtensionValue, horizontalAlignRect.Y)),
                                                         new Vector2(horizontalAlignRect.Width + (GlobalData.AlignExtensionValue << 1), horizontalAlignRect.Height));
        }
        else
        {
            _horizontalAlignLineManager.gameObject.SetActive(false);
        }

        if (_alignInfo?.VerticalAlignLine != null)
        {
            Rectangle verticalAlignRect = _alignInfo.VerticalAlignLine;
            print($"_alignInfo.VerticalAlignType: {_alignInfo.VerticalAlignType}, isCenter: {_alignInfo.VerticalAlignType == AlignType.VerticalCenter}");
            _verticalAlignLineManager.gameObject.SetActive(true);
            _verticalAlignLineManager.transform.SetAsLastSibling();
            AlignType upType   = _alignInfo.VerticalAlignType;
            AlignType downType = _alignInfo.OtherVerticalAlignType;
            if (Math.Abs(_alignInfo.VerticalAlignLine.Top - _selfElement.Top) < Math.Abs(_alignInfo.VerticalAlignLine.Bottom - _selfElement.Bottom))
            {
                upType   = _alignInfo.OtherVerticalAlignType;
                downType = _alignInfo.VerticalAlignType;
            }
            _verticalAlignLineManager.UpdateVertical(upType,
                                                     downType,
                                                     Element.InvConvertTo(new Vector2(verticalAlignRect.X, verticalAlignRect.Y - GlobalData.AlignExtensionValue)),
                                                     new Vector2(verticalAlignRect.Width, verticalAlignRect.Height + (GlobalData.AlignExtensionValue << 1)));
        }
        else
        {
            _verticalAlignLineManager.gameObject.SetActive(false);
        }

        if (GlobalData.CurrentSelectDisplayObjectDic.Count == 1)
        {
            return;
        }
        foreach (var pair in GlobalData.CurrentSelectDisplayObjectDic)
        {
            if (pair.Value == transform)
            {
                continue;
            }
            RectTransform rt = pair.Value.GetComponent <RectTransform>();
            DisplayObjectUtil.UpdateElementPosition(rt, pair.Key, rt.anchoredPosition + offset);
        }
    }
Ejemplo n.º 47
0
        private void btnEnregistrer_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //if (!GlobalData.VerifyClotureSession())
                //{

                //    var result = MessageBox.Show("Voulez-vous fermer la session précédente ?", "Message", MessageBoxButton.YesNo, MessageBoxImage.Warning);

                //    if (result == MessageBoxResult.Yes)
                //    {
                //        RadDocumentPane radMenu = new RadDocumentPane();
                //        radMenu.Content = new GESHOTEL.ReservationsModules.Views.Win.ClotureJourneeFrm("Cloture de la session du " + GlobalData.CurrentRegistres.DateDebut.Value.ToShortDateString());
                //        radMenu.Header = "Cloture de la session du " + GlobalData.CurrentRegistres.DateDebut.Value.ToShortDateString();
                //        GlobalData.rrvMain.Title = "Cloture de la session du " + GlobalData.CurrentRegistres.DateDebut.Value.ToShortDateString();
                //        radMenu.FontFamily = new FontFamily("Perpetua Titling MT");
                //        radMenu.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                //        radMenu.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;

                //        if (!GlobalData.VerifyDock("Cloture de la session du " + GlobalData.CurrentRegistres.DateDebut.Value.ToShortDateString()))
                //        {
                //            GlobalData.PaneGroup.AddItem(radMenu, Telerik.Windows.Controls.Docking.DockPosition.Center);
                //        }
                //        else
                //        {

                //        }
                //    }

                //    return;
                //}

                Chambres Cham = chambreAutoCompleteBox.SelectedItem as Chambres;

                if (Cham.EtatOperation == "SALLE")
                {
                    MessageBox.Show("La chambre est salle veuillez la nettoyée", "Message", MessageBoxButton.OK, MessageBoxImage.Warning);
                    return;
                }

                var results = MessageBox.Show("Voulez-vous enregistrer ?", "Message", MessageBoxButton.YesNo, MessageBoxImage.Question);

                if (results == MessageBoxResult.Yes)
                {
                    int NbreHr = -rtHD.SelectedTime.Value.Subtract(rtHF.SelectedTime.Value).Hours;

                    if (rnHeure.Value <= 0)
                    {
                        MessageBox.Show("Le nombre d'heure ne peut pa etre egale a 0", "Message", MessageBoxButton.OKCancel, MessageBoxImage.Warning); return;
                    }
                    if (chambreAutoCompleteBox.SelectedItem == null)
                    {
                        MessageBox.Show("Choisissez une chambre svp", "Message", MessageBoxButton.OKCancel, MessageBoxImage.Warning); return;
                    }
                    if (NbreHr <= 0)
                    {
                        MessageBox.Show("Le nombre d'heure ne peut pa etre egale a 0", "Message", MessageBoxButton.OKCancel, MessageBoxImage.Warning); return;
                    }

                    Transactions Trans = new Transactions();
                    Trans.DateTransaction = DateTime.Now;

                    Trans.TotalPaye  = Convert.ToDecimal(rntarif.Value);
                    Trans.TotalTTC   = Convert.ToDecimal(rntarif.Value);
                    Trans.TotalHT    = Convert.ToDecimal(rntarif.Value);
                    Trans.TVA        = 0;
                    Trans.TotalReste = 0;

                    Trans.Etat = "PAYE";

                    DetailPaiements dtPaie = new DetailPaiements();
                    dtPaie.Montant          = rntarif.Value;
                    dtPaie.DatePaiement     = DateTime.Now;
                    dtPaie.MethodePaiements = GlobalData.model.MethodePaiements.Where(c => c.Libelle == "ESPECE").First();
                    dtPaie.Transactions     = Trans;
                    dtPaie.Etat             = "ACTIF";
                    //dtPaie.idHotel = GlobalData.HotId;

                    Trans.DetailPaiements.Add(dtPaie);

                    if (Cham.EtatOperation == "LIBRE" || Cham.EtatOperation == "RESERVER")
                    {
                        Cham.EtatOperation = "OCCUPER";
                    }

                    DetailTransactions dtTrans = new DetailTransactions();
                    dtTrans.Date         = DateTime.Now;
                    dtTrans.Descriptions = "CHAMBRE " + Cham.TypeChambres.Libelle + " " + Cham.Numero;
                    dtTrans.prix         = Convert.ToDecimal(rntarif.Value);
                    dtTrans.Quantite     = 1;
                    dtTrans.Montant      = Convert.ToDecimal(rntarif.Value);
                    dtTrans.Transactions = Trans;
                    dtTrans.Etat         = "ACTIF";
                    //dtTrans.idHotel = GlobalData.HotId;
                    dtTrans.Produits = GlobalData.model.Produits.Where(c => c.Libelle == "CHAMBRE").First();

                    Trans.DetailTransactions.Add(dtTrans);

                    ReservationTypes resType = GlobalData.model.ReservationTypes.Where(c => c.ReservationType == "PASSAGE").First();

                    Reservations Reservations = new Reservations();
                    Reservations.ReservationDate = DateTime.Now;
                    Reservations.Chambres        = Cham;
                    Reservations.Transactions.Add(Trans);
                    Reservations.ReservationTypes = resType;
                    Reservations.NbreNuit         = NbreHr;
                    Reservations.Etat             = "ACTIF";
                    Reservations.EtatOperation    = "ARRIVEE";
                    Reservations.TotalPaye        = Trans.TotalPaye;
                    Reservations.TotalReste       = Trans.TotalReste;
                    Reservations.TotalTTC         = Trans.TotalTTC;
                    Reservations.DateDepart       = new DateTime(rtHF.SelectedDate.Value.Year, rtHF.SelectedDate.Value.Month, rtHF.SelectedDate.Value.Day, rtHF.SelectedTime.Value.Hours, rtHF.SelectedTime.Value.Minutes, rtHF.SelectedTime.Value.Seconds);
                    Reservations.DateArrive       = new DateTime(rtHD.SelectedDate.Value.Year, rtHD.SelectedDate.Value.Month, rtHD.SelectedDate.Value.Day, rtHD.SelectedTime.Value.Hours, rtHD.SelectedTime.Value.Minutes, rtHD.SelectedTime.Value.Seconds);
                    Reservations.TypeOperation    = "LOCATION CHAMBRE";
                    Reservations.DateCheckIn      = DateTime.Now;
                    Reservations.isCheckIn        = true;
                    //Reservations.idHotel = GlobalData.HotId;
                    Reservations.idRegistre = GlobalData.RegId;

                    //Trans.idHotel = GlobalData.HotId;
                    Trans.idRegistre      = GlobalData.RegId;
                    Trans.TypeTransaction = resType.ReservationType;

                    Parametres param = GlobalData.model.Parametres.Where(c => c.IdParametre == 1).First();

                    Trans.TransactionNumero = GlobalData.GenerateFacture(param.TransNum.ToString(), 6);

                    param.TransNum++;


                    GlobalData.model.Transactions.Add(Trans);
                    GlobalData.model.Reservations.Add(Reservations);
                    GlobalData.model.SaveChanges();

                    var result = MessageBox.Show("Voulez vous imprimer le recu?", "Vente", MessageBoxButton.YesNo, MessageBoxImage.Warning);

                    if (result == MessageBoxResult.Yes)
                    {
                        try
                        {
                            //RapportWindows frm = new RapportWindows(Reservations.ID, "", "ALL");
                            //frm.ShowDialog();
                            //frm.Print();
                        }
                        catch (Exception ex)
                        {
                        }
                    }

                    //MessageBox.Show("Operation terminée", "Message", MessageBoxButton.OK, MessageBoxImage.None);

                    Clear();

                    GlobalFO.rpVM.Load();

                    chambreAutoCompleteBox.Focus();
                }
            }
            catch (Exception ex)
            {
                if (ex.Message == "Échec du fournisseur sous-jacent sur Commit.")
                {
                }
                else
                {
                }
            }
        }
Ejemplo n.º 48
0
 public AllProjectData(GlobalData global)
 {
     Global = global;
     Models = new List<EditorModel>();
 }
Ejemplo n.º 49
0
 public override bool CanBePurchased()
 {
     return(!GlobalData.ItemCollected(mItemId) && GlobalData.BossDefeated(mBossRequirement));
 }
Ejemplo n.º 50
0
 public ValuesController(GlobalData globalData)
 {
     _globalData = globalData;
 }
Ejemplo n.º 51
0
    /*void ClickPlayerYouMenBtEvent(ButtonState val)
     * {
     *      if (val == ButtonState.UP) {
     *              return;
     *      }
     *      IsCloseYouMenTiShi = true;
     * }*/

    void Update()
    {
        if (PlayerController.GetInstance().timmerstar < 5.0f)
        {
            UpdateBeginDaojishi();
        }
        else
        {
            if (m_BeginDaojishi.enabled)
            {
                m_BeginDaojishi.enabled = false;
                m_BeginDaojishiAudio.Stop();

                if (pcvr.bIsHardWare)
                {
                    pcvr.GetInstance().mPcvrTXManage.SetJiDianQiCmd(0, pcvrTXManage.JiDianQiCmd.Open);
                    //pcvr.GetInstance().mPcvrTXManage.SetJiDianQiCmd(0, pcvrTXManage.JiDianQiCmd.Close); //test 为了安全暂时不打开继电器(即摇摇机).
                }
            }

            if (Mathf.Abs(pcvr.GetInstance().mGetSteer) > 0f && !IsCloseYouMenTiShi)
            {
                //关闭方向盘提示.
                IsCloseYouMenTiShi    = true;
                m_HasTishi            = true;
                m_YoumenTishi.enabled = false;
                m_YoumenTimmer        = 0.0f;
            }

            if (IsCloseYouMenTiShi && m_HasTishi)
            {
                if (Mathf.Abs(pcvr.GetInstance().mGetSteer) == 0f)
                {
                    m_YoumenTimmer += Time.deltaTime;
                    if (m_YoumenTimmer >= 5f)
                    {
                        //打开方向盘提示.
                        IsCloseYouMenTiShi = false;
                        m_HasTishi         = false;
                    }
                }
                else
                {
                    m_YoumenTimmer = 0.0f;
                }
            }

            if (!IsCloseYouMenTiShi && !m_HasTishi)
            {
                m_YoumenTishi.enabled = true;
                UpdateYoumenTishi();
            }

            if (m_pGameTime >= 0.0f && !m_Player.m_IsFinished)
            {
                UpdateJinduTiao();
                UpdateGameTime();
            }
            else
            {
                if (m_pGameTime <= 0.0f)
                {
                    m_IsGameOver = true;
                    TouBiInfoCtrl.IsCloseQiNang = true;
                    PlayerController.GetInstance().SortPlayerRankList();
                }
                m_pScale.enabled = false;
            }
            if (m_Player.m_timmerFinished > 2.0f && !m_IsCongratulate)
            {
                if (m_Player.m_IsFinished)
                {
                    m_Score = (int)(m_totalTime + chile * addChiLe - m_pGameTime);
                    Debug.Log("UIController -> m_Score " + m_Score);
                    m_JiluRecord = ReadGameInfo.GetInstance().ReadGameRecord();
                    if (m_JiluRecord == 0 || m_Score < m_JiluRecord)
                    {
                        if (!m_NewRecordAudio.isPlaying)
                        {
                            m_NewRecordAudio.Play();
                        }
                        m_CongratulateJiemian.SetActive(true);
                        ReadGameInfo.GetInstance().WriteGameRecord(m_Score);
                    }
                    else
                    {
                        if (!m_FinishiAudio.isPlaying)
                        {
                            m_FinishiAudio.Play();
                        }
                        m_FinishiJiemian.SetActive(true);
                    }
                    m_JiluObj.SetActive(true);
                    UpdateMyScore();
                    UpdateRecord();
                }
                else
                {
                    if (!m_GameOverAudio.isPlaying)
                    {
                        m_GameOverAudio.Play();
                    }
                    m_OverJiemian.SetActive(true);
                }
                m_IsCongratulate = true;
                m_JindutiaoObj.SetActive(false);
                m_daojishiObj.SetActive(false);
                m_biaodituObj.SetActive(false);
                HiddenJiFen();
                HiddenUi();
                JieSuanJiFenObj.SetActive(true);
                mRankListUI.ShowRankListUI();

                GlobalData.GetInstance().CaiPiaoCur = 0;
                if (ReadGameInfo.GetInstance().ReadGameIsPrintCaiPiao() && ReadGameInfo.GetInstance().ReadGameStarMode() == ReadGameInfo.GameMode.Oper.ToString())
                {
                    //打印彩票.
                    int coinToCard  = ReadGameInfo.GetInstance().ReadGamePrintCaiPiaoNum();
                    int maxScore    = SSGameDataCtrl.GetInstance().m_UIData.MaxScore;
                    int scoreToCard = maxScore / coinToCard;
                    int caiPiaoNum  = m_JiFenPlayer / scoreToCard;
                    int chuPiaoLv   = ReadGameInfo.GetInstance().ReadChuPiaoLv();
                    caiPiaoNum = (int)(caiPiaoNum * (chuPiaoLv / 100f));
                    if (caiPiaoNum <= 0)
                    {
                        caiPiaoNum = 1;
                    }
                    GlobalData.GetInstance().CaiPiaoCur = caiPiaoNum;
                    Debug.Log("should print " + caiPiaoNum + " cards, JiFenPlayer == " + m_JiFenPlayer);
                    if (pcvr.bIsHardWare)
                    {
                        pcvr.GetInstance().mPcvrTXManage.SetCaiPiaoPrintCmd(pcvrTXManage.CaiPiaoPrintCmd.BanPiaoPrint, pcvrTXManage.CaiPiaoJi.Num01, caiPiaoNum);
                    }
                    else
                    {
                        //软件版本不用出彩票.
                        //GlobalData.GetInstance().CaiPiaoCur = 12;
                    }
                }

                if (GlobalData.GetInstance().CaiPiaoCur > 0 && !IsCreatPrintCardUI)
                {
                    //产生出彩票UI界面.
                    IsCreatPrintCardUI = true;
                    SpawnPrintCardUI();
                }

                //开启芯片加密校验.
                if (pcvr.bIsHardWare)
                {
                    //pcvr.GetInstance().mPcvrTXManage.GamePlayCount = 500; //test
                    pcvr.GetInstance().mPcvrTXManage.GameJiaoYanJiaMiXinPian();
                    pcvr.GetInstance().mPcvrTXManage.SetJiDianQiCmd(0, pcvrTXManage.JiDianQiCmd.Close);
                }
            }

            if (m_IsCongratulate)
            {
                m_CongratulateTimmer += Time.deltaTime;
            }

            if (m_CongratulateTimmer > 1.0f)
            {
                if (m_Player.m_IsFinished)
                {
                    if (m_Score < m_JiluRecord || m_JiluRecord == 0)
                    {
                        if (!m_NewRecordHitAudio.isPlaying && !m_HasPlay)
                        {
                            m_HasPlay = true;
                            m_NewRecordHitAudio.Play();
                        }

                        m_CongratulateZitiObj.SetActive(true);
                    }
                    else
                    {
                        m_FinishiZitiObj.SetActive(true);
                    }
                }
                else
                {
                    m_OverZitiObj.SetActive(true);
                }
            }

            if (m_Player.m_IsFinished && m_CongratulateTimmer > 1.2f && !m_HasShake)
            {
                m_HasShake = true;
                m_CameraShake.setCameraShakeImpulseValue();
            }

            if (m_CongratulateTimmer > 5.0f && !IsCheckLoadingMovieLevel)
            {
                IsCheckLoadingMovieLevel = true;
                StartCoroutine(CheckLoadingMovieLevel());
            }
        }
    }
Ejemplo n.º 52
0
        public async void GenerateHTMLEventHandler(object data)
        {
            PreviewParameter para     = data as PreviewParameter;
            string           filePath = para.SavePath;
            // Make textbox update source data.
            ISelectionService _selectionService = ServiceLocator.Current.GetInstance <SelectionServiceProvider>();
            IPagePropertyData page = _selectionService.GetCurrentPage();

            if (para.IsPreviewCurrentPage == true && page == null)
            {
                return;
            }

            if (page != null && page.EditorCanvas != null)
            {
                page.EditorCanvas.Focus();
            }

            if ((_currentPageGID != Guid.Empty))
            {
                return;
            }

            IDocumentService doc = ServiceLocator.Current.GetInstance <IDocumentService>();

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }
            if (doc == null || doc.Document == null)
            {
                return;
            }

            //Get Image save path;
            //doc.Document.GeneratorConfigurationSet.DefaultHtmlConfiguration.OutputFolder = @"D:\pic";
            _outputFolder = filePath;
            string imgPath = filePath + @"\images\";

            try
            {
                if (Directory.Exists(imgPath) == false)
                {
                    Directory.CreateDirectory(imgPath);
                }
                _htmlService.ImagesStreamManager.WorkingDirectory = imgPath;
            }
            catch (Exception ex)
            {
                MessageBox.Show(GlobalData.FindResource("Error_Generate_Html") + ex.Message);
                return;
            }

            if (para.IsPreviewCurrentPage)
            {
                Guid currentPageGuid = page.PageGID;
                if (page.ActivePage is IEmbeddedPage)
                {
                    IEmbeddedPage embeddedPage = page.ActivePage as IEmbeddedPage;
                    currentPageGuid = embeddedPage.ParentWidget.ParentPage.Guid;
                }

                doc.Document.GeneratorConfigurationSet.DefaultHtmlConfiguration.CurrentPage = currentPageGuid;
            }
            else
            {
                doc.Document.GeneratorConfigurationSet.DefaultHtmlConfiguration.CurrentPage = Guid.Empty;
            }


            Debug.WriteLine("----->HtmlGen----->Start All Convert");
            //Async operation to Generate Html and open it
            await AsyncGenerateHtml(para.IsBrowerOpen);

            // Reset image working directory.
            _htmlService.ImagesStreamManager.WorkingDirectory = string.Empty;
        }
    public static GlobalData GetInstance()
    {
        if (Instance == null)
        {
            Instance = new GlobalData();
            Instance.InitInfo();
            if (!Directory.Exists(FilePath))
            {
                Directory.CreateDirectory(FilePath);
            }

            //init gameMode
            Instance.gameMode = GameMode.OnlineMode;
            if (Application.loadedLevel == (int)GameLeve.Leve1 || Application.loadedLevel == (int)GameLeve.Leve2)
            {
                Instance.gameMode = GameMode.SoloMode;
            }

            if (handleJsonObj == null)
            {
                handleJsonObj = HandleJson.GetInstance();
            }

            string gmText = handleJsonObj.ReadFromFileXml(fileName, "GameTextVal");
            if (gmText == null || gmText == "")
            {
                gmText = "0";                 //中文版.
                handleJsonObj.WriteToFileXml(fileName, "GameTextVal", gmText);
            }
            GameTextVal = gmText == "0" ? GameTextType.Chinese : GameTextType.English;
            //GameTextVal = GameTextType.English; //test.

            //start coin info
            startCoinInfo = handleJsonObj.ReadFromFileXml(fileName, "START_COIN");
            if (startCoinInfo == null || startCoinInfo == "")
            {
                startCoinInfo = "1";
                handleJsonObj.WriteToFileXml(fileName, "START_COIN", startCoinInfo);
            }
            Instance.XUTOUBI = Convert.ToInt32(startCoinInfo);

            //free mode
            bool   isFreeMode = false;
            string modeGame   = handleJsonObj.ReadFromFileXml(fileName, "GAME_MODE");
            if (modeGame == null || modeGame == "")
            {
                modeGame = "1";
                handleJsonObj.WriteToFileXml(fileName, "GAME_MODE", modeGame);
            }

            if (modeGame == "0")
            {
                isFreeMode = true;
            }
            Instance.IsFreeMode = isFreeMode;

            //game diff
            string diffStr = handleJsonObj.ReadFromFileXml(fileName, "GAME_DIFFICULTY");
            if (diffStr == null || diffStr == "")
            {
                diffStr = "1";
                handleJsonObj.WriteToFileXml(fileName, "GAME_DIFFICULTY", diffStr);
            }
            Instance.GameDiff = diffStr;


            string readInfo = handleJsonObj.ReadFromFileXml(fileName, "GameAudioVolume");
            if (readInfo == null || readInfo == "")
            {
                readInfo = "7";
                handleJsonObj.WriteToFileXml(fileName, "GameAudioVolume", readInfo);
            }

            int value = Convert.ToInt32(readInfo);
            if (value < 0 || value > 10)
            {
                value = 7;
                handleJsonObj.WriteToFileXml(fileName, "GameAudioVolume", value.ToString());
            }
            GameAudioVolume = value;

            //开始设置联机游戏状态参数.
            readInfo = handleJsonObj.ReadFromFileXml(fileName, "LinkModeState");
            if (readInfo == null || readInfo == "")
            {
                readInfo = "0";
                handleJsonObj.WriteToFileXml(fileName, "LinkModeState", readInfo);
            }

            value = Convert.ToInt32(readInfo);
            if (value < 0 || value > 1)
            {
                value = 0;
                handleJsonObj.WriteToFileXml(fileName, "LinkModeState", value.ToString());
            }

            /**
             * 此处代码必须放在这里,它是用来设定游戏是否为联机状态的控制接口.
             */
            if (FreeModeCtrl.IsServer)
            {
                Instance.LinkModeState = 0;
            }
            else
            {
                Instance.LinkModeState = value;
            }
            //结束设置联机参数.

            readInfo = handleJsonObj.ReadFromFileXml(fileName, "BikeZuLiDengJi");
            if (readInfo == null || readInfo == "")
            {
                readInfo = "5";
                handleJsonObj.WriteToFileXml(fileName, "BikeZuLiDengJi", readInfo);
            }

            value = Convert.ToInt32(readInfo);
            if (value < 0 || value > 10)
            {
                value = 5;
                handleJsonObj.WriteToFileXml(fileName, "BikeZuLiDengJi", value.ToString());
            }
            Instance.BikeZuLiDengJi = value;

            string fileNameTmp = "../config/Config.xml";
            readInfo = handleJsonObj.ReadFromFileXml(fileNameTmp, "ZuLiDengJiMax");
            if (readInfo == null || readInfo == "")
            {
                readInfo = "6";
                handleJsonObj.WriteToFileXml(fileNameTmp, "ZuLiDengJiMax", readInfo);
            }

            value = Convert.ToInt32(readInfo);
            if (value < 2 || value > 10)
            {
                value = 6;
                handleJsonObj.WriteToFileXml(fileNameTmp, "ZuLiDengJiMax", value.ToString());
            }
            Instance.ZuLiDengJiMax = value;
        }
        return(Instance);
    }
Ejemplo n.º 54
0
        private async Task AsyncGenerateMD5Html(DiffGeneratorParameter para)
        {
            //Application.Current.MainWindow.IsEnabled = false;
            _busyIndicator.Progress = 3;
            _busyIndicator.CanStop  = true;
            _busyIndicator.IsShow   = true;

            //load page data and create all images,ignore it now
            //foreach (IDocumentService doc in para.Docs)
            //{
            //    await AsyncConvertAllPages(doc.Document);
            //}

            //generate the html files.
            //if (_busyIndicator.IsContinue == false)
            //{
            //    _busyIndicator.IsShow = false;
            //    IsHtmlGenerating = false;
            //    return;
            //}
            _busyIndicator.Progress = 30;
            //_busyIndicator.Content=@"Generate the HTML Page......";


            //Create All Page Htmls with MD5 hash
            int i = 0;

            foreach (IDocumentService doc in para.Docs)
            {
                await AsyncConvertAllPages(doc.Document);

                string szLocation    = _outputFolder + @"\" + i++;
                bool   bIsSuccessful = await Task.Factory.StartNew <bool>(() => GenerateMD5Html(doc, szLocation));

                if (bIsSuccessful == false)
                {
                    _busyIndicator.IsShow         = false;
                    _htmlService.IsHtmlGenerating = false;
                    MessageBox.Show(GlobalData.FindResource("Error_Generate_Html_Access"));
                    return;
                }
                _busyIndicator.Progress = _busyIndicator.Progress + 15;
            }

            //Create Differ project Json Date
            bool bSuccessful = await Task.Factory.StartNew <bool>(() => GenerateMD5DifferInfo(para.Docs, _outputFolder));

            if (bSuccessful == false)
            {
                _busyIndicator.IsShow         = false;
                _htmlService.IsHtmlGenerating = false;
                MessageBox.Show(GlobalData.FindResource("Error_Generate_Html_Access"));
                return;
            }

            //Browser to open page
            if (_busyIndicator.IsContinue == false)
            {
                _busyIndicator.IsShow         = false;
                _htmlService.IsHtmlGenerating = false;
                return;
            }
            _busyIndicator.Progress = 98;
            _busyIndicator.Content  = @"HTML Page is ready now, Open the Browser..";

            //open the web browser
            IWebServer httpServer = ServiceLocator.Current.GetInstance <IWebServer>();

            if (httpServer != null)
            {
                try
                {
                    Process.Start("explorer.exe", httpServer.GetWebUrl());
                }
                catch
                {
                    NLogger.Error("Preview:Open Browser failed!");
                }
            }
            else
            {
                NLogger.Error("httpServer is null when open browner!");
            }


            //end progress show
            _busyIndicator.Progress       = 100;
            _busyIndicator.IsShow         = false;
            _htmlService.IsHtmlGenerating = false;
        }
Ejemplo n.º 55
0
 void OnDestroy()
 {
     GameManager.getInstance().Server.onResponse -= onResponse;
     GlobalData.getInstance().noticeChange -= onNoticeChange;
 }
Ejemplo n.º 56
0
        private async Task AsyncGenerateHtml(bool IsOpenBrower)
        {
            if (_htmlService.IsHtmlGenerating == false)
            {
                _htmlService.IsHtmlGenerating = true;
            }
            else
            {
                return;
            }

            //Application.Current.MainWindow.IsEnabled = false;
            _busyIndicator.Progress = 3;
            _busyIndicator.CanStop  = true;
            _busyIndicator.IsShow   = true;

            //load page data and create all images
            await AsyncConvertAllPages();

            Debug.WriteLine("----->HtmlGen----->End All Convert");

            //generate the html files.
            if (_busyIndicator.IsContinue == false)
            {
                _busyIndicator.IsShow         = false;
                _htmlService.IsHtmlGenerating = false;
                return;
            }
            _busyIndicator.Progress = 90;
            _busyIndicator.Content  = @"Generate the HTML Page......";
            bool bIsSuccessful = await Task.Factory.StartNew <bool>(GenerateHtml);

            if (bIsSuccessful == false)
            {
                _busyIndicator.IsShow         = false;
                _htmlService.IsHtmlGenerating = false;
                MessageBox.Show(GlobalData.FindResource("Error_Generate_Html_Access"));
                return;
            }

            //Browser to open page
            if (_busyIndicator.IsContinue == false)
            {
                _busyIndicator.IsShow         = false;
                _htmlService.IsHtmlGenerating = false;
                return;
            }
            _busyIndicator.Progress = 98;
            _busyIndicator.Content  = @"HTML Page is ready now, Open the Browser..";

            if (IsOpenBrower)
            {
                IWebServer httpServer = ServiceLocator.Current.GetInstance <IWebServer>();
                if (httpServer != null)
                {
                    try
                    {
                        Process.Start("explorer.exe", httpServer.GetWebUrl());
                    }
                    catch
                    {
                        NLogger.Error("Preview:Open Browser failed!");
                    }
                }
                else
                {
                    NLogger.Error("httpServer is null when open browner!");
                }
            }

            _busyIndicator.Progress       = 100;
            _busyIndicator.IsShow         = false;
            _htmlService.IsHtmlGenerating = false;
        }
Ejemplo n.º 57
0
 //房卡变化处理
 private void onCardChangeNotify(ClientResponse response)
 {
     cardCountText.text = response.message;
     GlobalData.getInstance().myAvatarVO.account.roomcard = int.Parse(response.message);
 }
Ejemplo n.º 58
0
    //===============================================================
    // Function: saveChangesButton_click
    //===============================================================
    protected void saveChangesButton_click(object sender, EventArgs e)
    {
        int eventID = int.Parse(Request.QueryString["EID"]);

        if (eventPicFileUpload.PostedFile.ContentLength != 0)
        {
            int fileSizeBytes = eventPicFileUpload.PostedFile.ContentLength;

            GlobalData gd = new GlobalData((string)Session["loggedInUserFullName"]);
            string fileStoreFolder = gd.GetStringValue("FileStoreFolder") + @"\temp";

            string originalFileName = Path.GetFileName(eventPicFileUpload.PostedFile.FileName);
            string destPath = Path.Combine(fileStoreFolder, originalFileName);
            if ((eventPicFileUpload.PostedFile.ContentType == "image/jpeg"
                || eventPicFileUpload.PostedFile.ContentType == "image/gif"
                || eventPicFileUpload.PostedFile.ContentType == "image/png")
                && Path.GetExtension(destPath) != ""
                )
            {
                destPath = destPath.Replace(" ", "_");
                destPath = MiscUtils.GetUniqueFileName(destPath);
                string savedFilename = Path.GetFileName(destPath);

                eventPicFileUpload.PostedFile.SaveAs(destPath);

                MiscUtils.CreateEventPicPreviews(Path.GetFileName(destPath), eventID);
            }
        }

        DateTime alertDate = CalendarAlertDate.SelectedDate;
        string alertText = newAlertTextBox.Text.Trim();

        if (alertText != "")
        {
            EventAlert eventAlert = new EventAlert((string)Application["connectionString"]);
            eventAlert.alertDate = alertDate;
            eventAlert.eventID = eventID;
            eventAlert.alertText = alertText;
            eventAlert.Add();

            newAlertTextBox.Text = "";
            CalendarAlertDate.SelectedDate = DateTime.Now;
            PickerAlertDate.SelectedDate = DateTime.Now;
        }

        SedogoEvent sedogoEvent = new SedogoEvent((string)Session["loggedInUserFullName"], eventID);
        sedogoEvent.Update();

        Response.Redirect("addEventInvites.aspx?EID=" + eventID.ToString());
    }
Ejemplo n.º 59
0
 public AdEdit()
 {
     InitializeComponent();
     GlobalData.InitForm(this);
 }
Ejemplo n.º 60
0
    //===============================================================
    // Function: saveChangesButton_click
    //===============================================================
    protected void saveChangesButton_click(object sender, EventArgs e)
    {
        Boolean continueSending = false;
        if (Session["SendMessageCaptcha"] == null || (string)Session["SendMessageCaptcha"] == "N")
        {
            if (registerCaptcha.IsValid == true)
            {
                Session["SendMessageCaptcha"] = "Y";
                continueSending = true;
            }
        }
        else
        {
            // Captcha has already been done in this session
            continueSending = true;
        }
        if (continueSending == true)
        {
            int eventID = int.Parse(Request.QueryString["EID"]);

            SedogoEvent sedogoEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString(), eventID);
            SedogoUser currentUser = new SedogoUser(Session["loggedInUserFullName"].ToString(),
                int.Parse(Session["loggedInUserID"].ToString()));
            SedogoUser eventOwner = new SedogoUser(Session["loggedInUserFullName"].ToString(),
                sedogoEvent.userID);

            string messageText = messageTextBox.Text;

            Message message = new Message(Session["loggedInUserFullName"].ToString());
            message.userID = sedogoEvent.userID;
            message.eventID = eventID;
            message.postedByUserID = int.Parse(Session["loggedInUserID"].ToString());
            message.messageText = messageText;
            message.Add();

            StringBuilder emailBodyCopy = new StringBuilder();

            GlobalData gd = new GlobalData("");
            string eventURL = gd.GetStringValue("SiteBaseURL");
            eventURL = eventURL + "/viewEvent.aspx?EID=" + eventID.ToString();

            string replyURL = gd.GetStringValue("SiteBaseURL");
            replyURL = replyURL + "?Redir=Messages&MessageID=" + message.messageID.ToString();

            emailBodyCopy.AppendLine("<html>");
            emailBodyCopy.AppendLine("<head><title></title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">");
            emailBodyCopy.AppendLine("<style type=\"text/css\">");
            emailBodyCopy.AppendLine("	body, td, p { font-size: 15px; color: #9B9885; font-family: Arial, Helvetica, Sans-Serif }");
            emailBodyCopy.AppendLine("	p { margin: 0 }");
            emailBodyCopy.AppendLine("	h1 { color: #00ccff; font-size: 18px; font-weight: bold; }");
            emailBodyCopy.AppendLine("	a, .blue { color: #00ccff; text-decoration: none; }");
            emailBodyCopy.AppendLine("</style></head>");
            emailBodyCopy.AppendLine("<body bgcolor=\"#f0f1ec\">");
            emailBodyCopy.AppendLine("  <table width=\"692\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
            //emailBodyCopy.AppendLine("	<tr><td colspan=\"3\"><img src=\"http://www.sedogo.com/email-template/images/email-template_01.png\" width=\"692\" height=\"32\" alt=\"\"></td></tr>");
            emailBodyCopy.AppendLine("	<tr><td style=\"background: #fff\" width=\"30\"></td>");
            emailBodyCopy.AppendLine("		<td style=\"background: #fff\" width=\"632\">");
            //emailBodyCopy.AppendLine("			<h1>sedogo.com message</h1>");
            emailBodyCopy.AppendLine("			<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\">");
            emailBodyCopy.AppendLine("				<tr>");
            emailBodyCopy.AppendLine("					<td width=\"60\">From:</td>");
            emailBodyCopy.AppendLine("					<td width=\"10\" rowspan=\"5\">&nbsp;</td>");
            emailBodyCopy.AppendLine("					<td width=\"530\">" + currentUser.firstName + " " + currentUser.lastName + "</td>");
            emailBodyCopy.AppendLine("				</tr>");
            emailBodyCopy.AppendLine("				<tr>");
            emailBodyCopy.AppendLine("					<td valign=\"top\">Goal:</td>");
            emailBodyCopy.AppendLine("					<td><a href=\"" + eventURL + "\">" + sedogoEvent.eventName + "</a></td>");
            emailBodyCopy.AppendLine("				</tr>");
            emailBodyCopy.AppendLine("				<tr>");
            emailBodyCopy.AppendLine("					<td valign=\"top\">Where:</td>");
            emailBodyCopy.AppendLine("					<td>" + sedogoEvent.eventVenue + "</td>");
            emailBodyCopy.AppendLine("				</tr>");
            emailBodyCopy.AppendLine("				<tr>");
            emailBodyCopy.AppendLine("					<td valign=\"top\">Message:</td>");
            emailBodyCopy.AppendLine("					<td><p style=\"color:black\">" + messageText.Replace("\n", "<br/>") + "</p></td>");
            emailBodyCopy.AppendLine("				</tr>");
            emailBodyCopy.AppendLine("				<tr>");
            emailBodyCopy.AppendLine("					<td valign=\"top\"></td>");
            emailBodyCopy.AppendLine("					<td><a class=\"blue\" href=\"" + replyURL + "\">Click here to reply to this message</a></td>");
            emailBodyCopy.AppendLine("				</tr>");
            emailBodyCopy.AppendLine("			</table>");
            emailBodyCopy.AppendLine("			<br /><br />");
            emailBodyCopy.AppendLine("			<p>Regards</p><a href=\"http://www.sedogo.com\" class=\"blue\"><strong>The Sedogo Team.</strong></a><br />");
            emailBodyCopy.AppendLine("			<br /><br /><br /><a href=\"http://www.sedogo.com\">");
            //emailBodyCopy.AppendLine("			<img src=\"http://www.sedogo.com/email-template/images/logo.gif\" />");
            emailBodyCopy.AppendLine("			</a></td>");
            emailBodyCopy.AppendLine("		<td style=\"background: #fff\" width=\"30\"></td></tr><tr><td colspan=\"3\">");
            //emailBodyCopy.AppendLine("			<img src=\"http://www.sedogo.com/email-template/images/email-template_05.png\" width=\"692\" height=\"32\" alt=\"\">");
            emailBodyCopy.AppendLine("		</td></tr><tr><td colspan=\"3\"><small>This message was intended for " + eventOwner.emailAddress + ". To stop receiving these emails, go to your profile and uncheck the 'Enable email notifications' option.<br/>Sedogo offices are located at Sedogo Ltd, The Studio, 17 Blossom St, London E1 6PL.</small></td></tr>");
            emailBodyCopy.AppendLine("		</td></tr></table></body></html>");

            string emailSubject = "Sedogo message from " + currentUser.firstName + " regarding " + sedogoEvent.eventName;

            string SMTPServer = gd.GetStringValue("SMTPServer");
            string mailFromAddress = gd.GetStringValue("MailFromAddress");
            string mailFromUsername = gd.GetStringValue("MailFromUsername");
            string mailFromPassword = gd.GetStringValue("MailFromPassword");

            if (eventOwner.enableSendEmails == true)
            {
                try
                {
                    MailMessage mailMessage = new MailMessage(mailFromAddress, eventOwner.emailAddress);
                    mailMessage.ReplyTo = new MailAddress("*****@*****.**");

                    mailMessage.Subject = emailSubject;
                    mailMessage.Body = emailBodyCopy.ToString();
                    mailMessage.IsBodyHtml = true;
                    SmtpClient smtp = new SmtpClient();
                    smtp.Host = SMTPServer;
                    if (mailFromPassword != "")
                    {
                        // If the password is blank, assume mail relay is permitted
                        smtp.Credentials = new System.Net.NetworkCredential(mailFromAddress, mailFromPassword);
                    }
                    smtp.Send(mailMessage);

                    SentEmailHistory emailHistory = new SentEmailHistory(Session["loggedInUserFullName"].ToString());
                    emailHistory.subject = emailSubject;
                    emailHistory.body = emailBodyCopy.ToString();
                    emailHistory.sentFrom = mailFromAddress;
                    emailHistory.sentTo = eventOwner.emailAddress;
                    emailHistory.Add();
                }
                catch (Exception ex)
                {
                    SentEmailHistory emailHistory = new SentEmailHistory(Session["loggedInUserFullName"].ToString());
                    emailHistory.subject = emailSubject;
                    emailHistory.body = ex.Message + " -------- " + emailBodyCopy.ToString();
                    emailHistory.sentFrom = mailFromAddress;
                    emailHistory.sentTo = eventOwner.emailAddress;
                    emailHistory.Add();
                }
            }

            Response.Redirect("viewEvent.aspx?EID=" + eventID.ToString());
        }
    }