def save_player_action(rcon, action_type, player_name, by, reason=''): with enter_session() as sess: steam_id_64 = rcon.get_player_info(player_name)['steam_id_64'] player = _get_set_player(sess, player_name, steam_id_64) sess.add( PlayersAction(action_type=action_type.upper(), steamid=player, reason=reason, by=by))
def save_player_action( rcon, action_type, player_name, by, reason="", steam_id_64=None, timestamp=None ): with enter_session() as sess: _steam_id_64 = steam_id_64 or rcon.get_player_info(player_name)["steam_id_64"] player = _get_set_player(sess, player_name, _steam_id_64, timestamp=timestamp) sess.add( PlayersAction( action_type=action_type.upper(), steamid=player, reason=reason, by=by ) )