@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% ) set bridge_name= set bridge_ipaddr= set is_default= if "%SESSION_MANAGER%"=="1" ( if not "%bridge_ipaddr%"=="" ( title Multi-Cafe Session for %bridge_name%^(%bridge_ipaddr%^) ) else ( title Multi-Cafe Session ) )