@echo off :: ############################################################################### :: # :: # Copyright (C) 2009-2013 Nintendo. All rights reserved. :: # :: # These coded instructions, statements, and computer programs contain :: # proprietary information of Nintendo of America Inc. and/or Nintendo :: # Company Ltd., and are protected by Federal copyright law. They may :: # not be disclosed to third parties or copied or duplicated in any form, :: # in whole or in part, without the prior written consent of Nintendo. :: # :: ############################################################################### :: Run setbridgeconfig to update INI file setbridgeconfig.exe %* if not "%errorlevel%"=="0" ( :: Something went wrong; setbridgeconfig should have :: issued an error message, so let's just die here. exit /b 1 ) set is_default=0 if "%1"=="-default" ( set is_default=1 shift ) set bridge_name=%1 set bridge_ipaddr= :: Look up the bridges IP from the INI file by name. :: This allows us to set the bridge by it's name only. for /f "eol=; tokens=1,2 delims==" %%i in (%APPDATA%\bridge_env.ini) do ( if "BRIDGE_NAME_%bridge_name%"=="%%i" ( set bridge_ipaddr=%%j ) ) if "%bridge_ipaddr%"=="" ( :: Must've deleted a bridge with "-d" option... :: TODO: Should I clear the BRIDGE_CURRENT_* variables, or set them to :: the default bridge, if we cleared the current session's bridge? echo Cleared stored IP address for %bridge_name%. ^(current environment unchanged^). ) else ( if "%is_default%"=="1" ( echo Setting hostbridge for current session ^(and default^) to %bridge_name% %bridge_ipaddr%. ) else ( echo Setting hostbridge for current session to %bridge_name% %bridge_ipaddr%. ) set BRIDGE_CURRENT_NAME=%bridge_name% set BRIDGE_CURRENT_IP_ADDRESS=%bridge_ipaddr% if "%SESSION_MANAGER%"=="1" goto multisession ) goto END :multisession :: Call the SessionManager to get the session information for /f "usebackq tokens=1,2,3,4,5,6,7" %%a in (`"%MION_BRIDGE_TOOLS%\SessionManagerUtil" -p NAME DEBUG_OUT DEBUG_CONTROL HIO_OUT LAUNCH_CTRL NET_MANAGE PCFS_SATA`) do ( set SESSION_NAME=%%a set SESSION_DEBUG_OUT_PORT=%%b set SESSION_DEBUG_CONTROL_PORT=%%c set SESSION_HIO_OUT_PORT=%%d set SESSION_LAUNCH_CTRL_PORT=%%e set SESSION_NET_MANAGE_PORT=%%f set SESSION_PCFS_SATA_PORT=%%g ) set SESSION_PATH_PREFIX=%SESSION_NAME%_ set CAFE_DATA_DIR=%CAFE_ROOT%\%SESSION_PATH_PREFIX%data if "%CAFE_CONTENT_DEFAULT%"=="1" set CAFE_CONTENT_DIR=%CAFE_DATA_DIR%\disc\content if "%CAFE_META_DEFAULT%"=="1" set CAFE_META_DIR=%CAFE_DATA_DIR%\disc\meta if "%CAFE_SAVE_DEFAULT%"=="1" set CAFE_SAVE_DIR=%CAFE_DATA_DIR%\save if "%CAFE_SLC_DEFAULT%"=="1" set CAFE_SLC_DIR=%CAFE_DATA_DIR%\slc if "%CAFE_MLC_DEFAULT%"=="1" set CAFE_MLC_DIR=%CAFE_DATA_DIR%\mlc set CAFE_DATA_TMP=%CAFE_DATA_DIR%/tmp if not "%bridge_ipaddr%"=="" ( title Multi-Cafe Session for %bridge_name%^(%bridge_ipaddr%^) ) else ( title Multi-Cafe Session ) :END set bridge_name= set bridge_ipaddr= set is_default=