/// <summary> /// Handle a player join event /// </summary> private static void HandlePlayerJoin( string text, OutputParseResult outputparseresult, IPlayerAction playeraction) { PlayerActionJoin join = (PlayerActionJoin)playeraction; Player player = new Player(join.PlayerName, join.Ip, join.PlayerName); AddPlayer(player); }
public virtual PlayerActionJoin ParsePlayerJoin(string text) { //[INFO] Bertware[/127.0.0.1:58189] logged in with entity id 27 at ([world] -1001.0479985318618, 2.0, 1409.300000011921) //[INFO] Bertware[/127.0.0.1:58260] logged in with entity id 0 at (-1001.0479985318618, 2.0, 1409.300000011921) //[INFO] UUID of player Bertware is f0b27a3369394b25ab897aa4e4db83c1 //[INFO] Bertware[/127.0.0.1:51815] logged in with entity id 184 at ([world] 98.5, 64.0, 230.5) PlayerActionJoin join = new PlayerActionJoin(); join.PlayerName = Regex.Match(text, RG_FSPACE + RG_PLAYER).Value.Trim(); join.Ip = Regex.Match(text, RG_IP_NOPORT).Value; return(join); }
public virtual PlayerActionJoin ParsePlayerJoin(string text) { //[INFO] Bertware[/127.0.0.1:58189] logged in with entity id 27 at ([world] -1001.0479985318618, 2.0, 1409.300000011921) //[INFO] Bertware[/127.0.0.1:58260] logged in with entity id 0 at (-1001.0479985318618, 2.0, 1409.300000011921) //[INFO] UUID of player Bertware is f0b27a3369394b25ab897aa4e4db83c1 //[INFO] Bertware[/127.0.0.1:51815] logged in with entity id 184 at ([world] 98.5, 64.0, 230.5) PlayerActionJoin join = new PlayerActionJoin(); text = Regex.Replace(text, RG_INFO, "", RegexOptions.IgnoreCase); join.PlayerName = Regex.Match(text, "^\\s?(" + RG_PLAYER + ")").Groups[1].Value; join.Ip = Regex.Match(text, RG_IP_NOPORT).Value; return(join); }
/// <summary> /// Handle a player join event /// </summary> private static void HandlePlayerJoin( string text, OutputParseResult outputparseresult, IPlayerAction playeraction) { PlayerActionJoin join = (PlayerActionJoin)playeraction; Player player = new Player(join.PlayerName, join.Ip, join.PlayerName) { JoinTime = @join.Time }; if (!OnlinePlayers.ContainsKey(player.Name)) { OnlinePlayers.Add(player.Name, player); } RaisePlayerListChangedEvent(); }