Exemplo n.º 1
0
        public void TrySave()
        {
            if (!isLoaded)
            {
                return;
            }
            CloudSocialModule module = SocialAPI.Cloud;

            SocialAPI.Cloud          = new SSCModule(false);
            Main.ServerSideCharacter = false;
            PlayerFileData.CreateAndSave(Main.LocalPlayer);
            SocialAPI.Cloud          = module;
            Main.ServerSideCharacter = true;
        }
Exemplo n.º 2
0
        private void OnEnterWorldInternal(object oplayer)
        {
            Player            player = oplayer as Player;
            CloudSocialModule module = SocialAPI.Cloud;

            SocialAPI.Cloud = new SSCModule(false);
            string pathName = Main.GetPlayerPathFromName(player.name, true);

            SocialAPI.Cloud = new SSCModule(true);
            Player newPlayer = Player.GetFileData(pathName, true).Player;

            if (newPlayer.name == "")
            {
                newPlayer = new Player(true);
                PlayerHooks.SetupStartInventory(player, false);
                newPlayer.name = Main.LocalPlayer.name;
            }
            newPlayer.SpawnX           = Main.LocalPlayer.SpawnX;
            newPlayer.SpawnY           = Main.LocalPlayer.SpawnY;
            Main.player[Main.myPlayer] = newPlayer;
            Main.LocalPlayer.Spawn();
            SocialAPI.Cloud = module;
            Main.LocalPlayer.GetModPlayer <SSCPlayer>().isLoaded = true;
        }