private void MainForm_Load(object sender, EventArgs e) { Player_van = new Playerinfo(); if (!Directory.Exists(@".\HikazeLauncher")) { DirectoryInfo directoryInfo = new DirectoryInfo(@".\HikazeLauncher"); directoryInfo.Create(); } JObject JsonObj_zsc; if (!File.Exists(@".\HikazeLauncher\configure.json")) { configure_ljc = new AllConfigure(0); using (File.Create(@".\HikazeLauncher\configure.json")) { }; JsonObj_zsc = configure_ljc.ConvertToJson(); File.WriteAllText(@".\HikazeLauncher\configure.json", JsonObj_zsc.ToString(Newtonsoft.Json.Formatting.Indented, null)); } else { configure_ljc = new AllConfigure(); } string json = File.ReadAllText(@".\HikazeLauncher\configure.json"); JsonObj_zsc = (JObject)JsonConvert.DeserializeObject(json); this.label1.Text = JsonObj_zsc.ToString(Newtonsoft.Json.Formatting.Indented, null); SetConfigureFromJson(JsonObj_zsc); this.Opacity = 0; while (this.Opacity < 0.85) { this.Refresh(); this.Opacity += 0.05; System.Threading.Thread.Sleep(3); } return; }
void Start() { Playerinfo playerInfo = (Playerinfo)FindObjectOfType(typeof(Playerinfo)); if (playerInfo.playerName != null) { playerNameInput = playerInfo.playerName; input.text = playerInfo.playerName; } singleplayer_ButtonFrame.transform.localPosition = new Vector3(360, -200, 0); singleplayer_ButtonFrame.GetComponent <Button>().onClick.AddListener(() => { PhotonNetwork.offlineMode = true; PhotonNetwork.CreateRoom("room"); SceneManager.LoadScene(4); }); multiplayer_ButtonFrame.transform.localPosition = new Vector3(-360, -200, 0); multiplayer_ButtonFrame.GetComponent <Button>().onClick.AddListener(() => { SceneManager.LoadScene(1); }); customization_ButtonFrame.transform.localPosition = new Vector3(0, -200, 0); customization_ButtonFrame.GetComponent <Button>().onClick.AddListener(() => { SceneManager.LoadScene(3); }); input.transform.localPosition = new Vector3(0, 75, 0); input.onEndEdit.AddListener(SubmitName); }
void OnEntityDeath(BaseCombatEntity entity, HitInfo info) { //Checks if entity is a barrel. if (!entity.ShortPrefabName.StartsWith("loot-barrel") && !entity.ShortPrefabName.StartsWith("loot_barrel") && entity.ShortPrefabName != "oil_barrel") { return; } if (CheckPlayer(info) == false) { return; } else { Playerinfo user = get_user(info.InitiatorPlayer); if (user.barrelCount < myConfig.Barrelcountdrop) { user.barrelCount += 1; update_user(info.InitiatorPlayer, user); } else { user.barrelCount = 0; update_user(info.InitiatorPlayer, user); if (entity.transform.position != null) { if (SpawnRate(myConfig.BearRate) == true) { SpawnBear(bearString, entity.transform.position); SendMsg(info.InitiatorPlayer, "Msg_Bearspawned"); } if (SpawnRate(myConfig.ScientistRate) == true) { SpawnScientist(scientistString, entity.transform.position); SendMsg(info.InitiatorPlayer, "Msg_Scienistspawned"); } if (SpawnRate(myConfig.AirdropRate) == true) { SpawnSupplyCrate(airdropString, entity.transform.position); SendMsg(info.InitiatorPlayer, "Msg_Airdropspawned"); } if (SpawnRate(myConfig.ZombieRate) == true) { SpawnZombie(zombieString, entity.transform.position); SendMsg(info.InitiatorPlayer, "Msg_Zombiespawned"); } } } } }
void Start() { PhotonNetwork.offlineMode = true; playAgain_ButtonFrame.transform.localPosition = new Vector3(0, 50, 0); playAgain_ButtonFrame.SetActive(false); playAgain_ButtonFrame.GetComponent <Button>().onClick.AddListener(() => { SceneManager.LoadScene(4); }); continue_ButtonFrame.transform.localPosition = new Vector3(0, 50, 0); continue_ButtonFrame.SetActive(false); continue_ButtonFrame.GetComponent <Button>().onClick.AddListener(() => { continue_ButtonFrame.SetActive(false); menu_ButtonFrame.SetActive(false); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }); menu_ButtonFrame.transform.localPosition = new Vector3(0, -50, 0); menu_ButtonFrame.SetActive(false); menu_ButtonFrame.GetComponent <Button>().onClick.AddListener(() => { PhotonNetwork.Disconnect(); SceneManager.LoadScene(0); }); time.transform.localPosition = new Vector3(400, 275, 0); min = 0; sec = 0; playerInfo = (Playerinfo)FindObjectOfType(typeof(Playerinfo)); newplayer = (GameObject)Instantiate(singlePlayer, new Vector3(27, 12, 16), Quaternion.identity); newplayerTransform = newplayer.GetComponent <Transform>(); bodyTransform = newplayerTransform.Find("Body"); GetColors(newplayer.transform); playerName = newplayer.GetComponentInChildren <TextMesh>(); playerName.text = playerInfo.playerName; playerMovement = newplayer.GetComponent <PlayerMovement>(); cursorMovement = newplayer.GetComponent <CursorMovement>(); playerCollisions = newplayer.GetComponent <PlayerCollisions>(); status = "spawned"; }
static void Main(string[] args) { Playerinfo playerInfo1 = new Playerinfo(); playerInfo1.SetPlayerName("Hikaze"); playerInfo1.RegenerateUUID(); string fp = System.Environment.CurrentDirectory + "\\info.json"; if (!File.Exists(fp)) // 判断是否已有相同文件 { FileStream fs1 = new FileStream(fp, FileMode.Create, FileAccess.ReadWrite); fs1.Close(); } File.WriteAllText(fp, JsonConvert.SerializeObject(playerInfo1)); }
Playerinfo get_user(BasePlayer player) { if (!Interface.Oxide.DataFileSystem.ExistsDatafile(file_main + player.UserIDString)) { Playerinfo user = new Playerinfo(); user.userName = player.displayName.ToString(); user.barrelCount = 0; update_user(player, user); return(user); } else { string raw_player_file = Interface.Oxide.DataFileSystem.ReadObject <string>(file_main + player.UserIDString); return(JsonConvert.DeserializeObject <Playerinfo>(raw_player_file)); } }
void OnJoinedRoom() { //There needs to be atleast 2 players for the game to start if (PhotonNetwork.isMasterClient == false) { photonView.RPC("TimerStart", PhotonTargets.All); } playerInfo = (Playerinfo)FindObjectOfType(typeof(Playerinfo)); playerNumber = PhotonNetwork.playerList.Length; //Creates list of player names and scores for this player while updating it for the other players photonView.RPC("Addinfo", PhotonTargets.All); //object must be named "Player" newplayer = PhotonNetwork.Instantiate("Player", new Vector3(27, 15, 16), Quaternion.identity, 0); ApplyColors(newplayer.transform); //Scripts for each player are originally disabled, so that they aren't controlling eachother //Enables scripts for individual player GetComponent <Camera>(camera).enabled = true; GetComponent <AudioListener> (AL).enabled = true; GetComponent <CursorMovement>(cursorMovement).enabled = true; GetComponent <CursorLock> (cursorLock).enabled = true; GetComponent <GrabandLaunch>(grabAndLaunch).enabled = true; GetComponent <RFist1Grab> (rfist1grab).enabled = true; GetComponent <RFist2Grab> (rfist2grab).enabled = true; GetComponent <LFist1Grab> (lfist1grab).enabled = true; GetComponent <LFist2Grab> (lfist2grab).enabled = true; GetComponent <PlayerMovement> (playerMovement).enabled = true; GetComponent <ColorSync> (colorSync).enabled = true; GetComponent <NameSync>(nameSync).enabled = true; playerScore = newplayer.GetComponent <PlayerScore>(); playerScore.enabled = true; playerName = newplayer.GetComponentInChildren <TextMesh>(); playerName.text = playerInfo.playerName; playerCollisions = newplayer.GetComponentsInChildren <PlayerCollisions>(); for (int n = 0; n < playerCollisions.Length; n++) { playerCollisions[n].enabled = true; } }
// Use this for initialization void Start() { Keystatus = new int[MaxPlayerNum][][]; for (int i = 0; i < MaxPlayerNum; i++) { Keystatus[i] = new int[MaxKey][]; for (int j = 0; j < MaxKey; j++) { Keystatus[i][j] = new int[2]; Keystatus[i][j][0] = new int(); Keystatus[i][j][1] = new int(); } } Player = new Playerinfo[MaxPlayerNum]; Player[0] = new Playerinfo(); Player[1] = new Playerinfo(); }
// Start is called before the first frame update void Start() { info = GameObject.FindWithTag("Info").GetComponent <Playerinfo>(); foreach (Collectable item in info.inventory) { item.player = this.gameObject; } // Makes sure game is "unpaused" isGamePaused = false; Time.timeScale = 1.0f; // Make sure all menus are filled in FindAllMenus(); //Start player with initial health and score //health = 100; //score = 0; }
public void Awake()//Startから内容をうつした { Keystatus = new int[MaxPlayerNum][][]; KeyPushcount = new double[MaxPlayerNum][]; for (int i = 0; i < MaxPlayerNum; i++) { Keystatus[i] = new int[MaxKey][]; KeyPushcount[i] = new double[MaxKey * 2]; for (int j = 0; j < MaxKey; j++) { Keystatus[i][j] = new int[2]; Keystatus[i][j][0] = new int(); Keystatus[i][j][1] = new int(); } } Player = new Playerinfo[MaxPlayerNum]; Player[0] = new Playerinfo(); Player[1] = new Playerinfo(); //conkind1 = ConKind.KEYBOARD1; // conkind2 = ConKind.KEYBOARD2; // ShowConKind(); }
static void Main(string[] args) { /*-Dminecraft.client.jar=D:\\mc\\.minecraft\\versions\\1.12.2-OptiFine_HD_U_E3\\1.12.2-OptiFine_HD_U_E3.jar * -XX:-UseAdaptiveSizePolicy * -XX:-OmitStackTraceInFastThrow * -Dfml.ignoreInvalidMinecraftCertificates=true * -Dfml.ignorePatchDiscrepancies=true * -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump * -Djava.library.path=D:\\mc\\.minecraft\\versions\\1.12.2-OptiFine_HD_U_E3\\1.12.2-OptiFine_HD_U_E3-natives * \"-Dminecraft.launcher.brand=Hello Minecraft! Launcher\" * -Dminecraft.launcher.version=2.7.9.55"; */ ParamentsGen ParaGen01 = new ParamentsGen(); Playerinfo player1 = new Playerinfo(); player1.SetPlayerName("Hikaze"); player1.RegenerateUUID(); string ext = "-XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true "; string a = ParaGen01.CombineParaments(player1, "", "D:\\mc", "1.12.2-OptiFine_HD_U_E3", ext, 4096, 2048, false); Console.WriteLine(a); Process p = new Process(); ProcessStartInfo s = new ProcessStartInfo("\"C:\\Program Files\\AdoptOpenJDK\\jdk-8.0.202.08\\bin\\java.exe\"", a); s.UseShellExecute = false; s.RedirectStandardOutput = true; p.StartInfo = s; p.Start(); //Console.WriteLine( ParaGen01.GetJarPackName("org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2")); //JObject j1 =new JObject { { "name", 123 } }; //ArrayList arr1 = new ArrayList(); //ParaGen01.GetPacksFromJson("D:\\mc", "1.12.2-OptiFine_HD_U_E3", arr1); //ParaGen01.ConvertPackNameFromList(arr1); //arr1 = ParaGen01.RemoveDuplicate(arr1); //for (int i = 0; i < arr1.Count; i++) //{ // Console.WriteLine(arr1[i]); //} }
void Awake() { playerInfo = (Playerinfo)FindObjectOfType(typeof(Playerinfo)); playerInfo.bottom = GameObject.Find("Player (Customization)"); }
void update_user(BasePlayer player, Playerinfo user) { Interface.Oxide.DataFileSystem.WriteObject <string>(file_main + player.UserIDString, JsonConvert.SerializeObject(user)); }