public RollRating(string line, GameType type) { line = line.Replace("//", ""); string[] lineFields = line.Split(':'); for (int i = 0; i < lineFields.Length; i++) { if (i == 0) { float value = float.Parse(lineFields[i]); if (type.Equals(GameType.PvE)) { pveRating = value; } else if (type.Equals(GameType.PvP)) { pvpRating = value; } else { pveRating = value; pvpRating = value; } } else if (i == 1) { id = Convert.ToInt64(lineFields[i]); } else if (i == 2) { name = lineFields[i]; } } }
public JoiningToLobby(GameType gameType, int size, string playerToken, string nickName = "default") { if (!gameType.Equals(GameType.Usual) && !gameType.Equals(GameType.Custom) && !gameType.Equals(GameType.Fast) || size < 4 || size > 7) { throw new ArgumentException("wrong type of game"); } GameType = gameType; Size = size; PlayerToken = playerToken; NickName = nickName; }
public void OnDisable() { IsDisabled = true; if (!GameType.Equals("hub")) { foreach (Level level in Server.LevelManager.Levels) { foreach (MiNET.Player player in level.Players.Values) { ExternalGameHandler.AddPlayer(player as SkyPlayer, "hub"); } } Thread.Sleep(1000); } foreach (Level level in Server.LevelManager.Levels) { foreach (MiNET.Player player in level.Players.Values) { player.Disconnect(" §d§lSkytonia §f§lNetwork§r\n" + "§7Skytonia is currently rebooting, try joining again soon!"); } } RunnableTask.CancelAllTasks(); PunishCore.Close(); StatisticsCore.Close(); }
private int checkMasterwork(string[] text, int lineNum, GameType gameType) { if (lineNum < text.Length && text[lineNum].Replace("//", "").ToLower().StartsWith("mw")) { string mw = text[lineNum].Replace("//", "").Remove(0, 3); if (gameType.Equals(GameType.PvE)) { pveMasterwork = mw; } else if (gameType.Equals(GameType.PvP)) { pvpMasterwork = mw; } else { pveMasterwork = mw; pvpMasterwork = mw; } lineNum++; } return(lineNum); }
/// <summary> /// /// </summary> /// <returns></returns> public string GetGameType() { if (GameType.Equals("MP")) { return("Multiplayer"); } else if (GameType.Equals("ZM")) { return("Zombies"); } else { return("n/a"); } }
public bool CanQuickJoin(string gameType) { return(GameType.Equals(gameType, StringComparison.OrdinalIgnoreCase) && !Started && !HasPassword && GetPlayers().Count < 2); }