further mac fixes (password issue, --init, etc)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3400 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
<string>ObjC</string>
|
||||
<key>OUTLETS</key>
|
||||
<dict>
|
||||
<key>admin_password</key>
|
||||
<string>NSTextField</string>
|
||||
<key>console</key>
|
||||
<string>ConsoleView</string>
|
||||
<key>keys</key>
|
||||
|
||||
+2
-2
@@ -10,9 +10,9 @@
|
||||
<integer>4</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>264</integer>
|
||||
<integer>208</integer>
|
||||
<integer>21</integer>
|
||||
<integer>208</integer>
|
||||
<integer>264</integer>
|
||||
<integer>213</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
|
||||
Binary file not shown.
@@ -3,6 +3,8 @@
|
||||
@class ConsoleView;
|
||||
|
||||
@interface Launcher : NSObject {
|
||||
IBOutlet NSTextField *admin_password;
|
||||
|
||||
IBOutlet NSWindow *window;
|
||||
|
||||
//able to leave these disconnected
|
||||
@@ -23,7 +25,6 @@
|
||||
NSMutableDictionary *toolBarItems;
|
||||
pid_t server;
|
||||
NSMutableDictionary *fileRoles;
|
||||
BOOL forcename;
|
||||
}
|
||||
|
||||
- (IBAction)playAction:(id)sender;
|
||||
|
||||
+10
-32
@@ -433,8 +433,8 @@ static int numberForKey(CFDictionaryRef desc, CFStringRef key)
|
||||
NS_DURING
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
[task setCurrentDirectoryPath:cwd];
|
||||
[task setLaunchPath:exe];
|
||||
[task setArguments:args];
|
||||
[task setLaunchPath:exe];
|
||||
[task setArguments:args]; NSLog([args description]);
|
||||
[task setEnvironment:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
@"1", @"SDL_SINGLEDISPLAY",
|
||||
@"1", @"SDL_ENABLEAPPEVENTS", nil
|
||||
@@ -467,7 +467,10 @@ static int numberForKey(CFDictionaryRef desc, CFStringRef key)
|
||||
|
||||
NSArray *res = [[resolutions titleOfSelectedItem] componentsSeparatedByString:@" x "];
|
||||
NSMutableArray *args = [NSMutableArray array];
|
||||
|
||||
|
||||
[args addObject:@"--init"];
|
||||
[args addObject:[NSString stringWithFormat:@"--home=%@", [Launcher userdir]]];
|
||||
|
||||
[args addObject:[NSString stringWithFormat:@"-w%@", [res objectAtIndex:0]]];
|
||||
[args addObject:[NSString stringWithFormat:@"-h%@", [res objectAtIndex:1]]];
|
||||
[args addObject:@"-z32"]; //otherwise seems to have a fondness to use -z16 which looks crap
|
||||
@@ -475,31 +478,7 @@ static int numberForKey(CFDictionaryRef desc, CFStringRef key)
|
||||
if([defs integerForKey:dkFULLSCREEN] == 0) [args addObject:@"-t"];
|
||||
[args addObject:[NSString stringWithFormat:@"-a%d", [defs integerForKey:dkFSAA]]];
|
||||
|
||||
if ([stencil state] == NSOnState) [args addObject:@"-z8"];
|
||||
|
||||
[args addObject:[NSString stringWithFormat:@"--home=%@", [Launcher userdir]]];
|
||||
|
||||
NSMutableArray *cmds = [NSMutableArray array];
|
||||
if(forcename) [cmds addObject:[NSString stringWithFormat:@"name \"%@\"", NSUserName()]];
|
||||
|
||||
if(filename)
|
||||
{
|
||||
if([filename isEqual:@"-rpg"]) {
|
||||
[cmds removeAllObjects]; // rpg current doesn't require name/team
|
||||
[args addObject:@"-grpg"]; //demo the rpg game
|
||||
} else if([filename hasPrefix:@"-x"])
|
||||
[cmds addObject:[filename substringFromIndex:2]];
|
||||
else
|
||||
[args addObject:[NSString stringWithFormat:@"-l%@", filename]];
|
||||
}
|
||||
|
||||
if([cmds count] > 0)
|
||||
{
|
||||
NSString *script = [cmds objectAtIndex:0];
|
||||
int i;
|
||||
for(i = 1; i < [cmds count]; i++) script = [NSString stringWithFormat:@"%@;%@", script, [cmds objectAtIndex:i]];
|
||||
[args addObject:[NSString stringWithFormat:@"-x%@", script]];
|
||||
}
|
||||
if ([stencil state] == NSOnState) [args addObject:@"-s8"];
|
||||
|
||||
NSEnumerator *e = [[[defs nonNullStringForKey:dkADVANCEDOPTS] componentsSeparatedByString:@" "] objectEnumerator];
|
||||
NSString *opt;
|
||||
@@ -581,9 +560,6 @@ static int numberForKey(CFDictionaryRef desc, CFStringRef key)
|
||||
NSDictionary *dict = [self readConfigFiles];
|
||||
[keys addObjects:[self getKeys:dict]];
|
||||
|
||||
//encourage people not to remain unnamed
|
||||
NSString *name = [dict objectForKey:@"name"];
|
||||
forcename = (!name || [name isEqual:@""] || [name isEqual:@"unnamed"]);
|
||||
|
||||
[self initMaps];
|
||||
[self initResolutions];
|
||||
@@ -673,7 +649,9 @@ static int numberForKey(CFDictionaryRef desc, CFStringRef key)
|
||||
|
||||
NSString *pass = [defs nonNullStringForKey:dkPASSWORD];
|
||||
if (![pass isEqual:@""]) [args addObject:[NSString stringWithFormat:@"-p%@", pass]];
|
||||
|
||||
|
||||
if (![[admin_password stringValue] isEqual:@""]) [args addObject:[NSString stringWithFormat:@"-x%@", pass]];
|
||||
|
||||
int clients = [defs integerForKey:dkMAXCLIENTS];
|
||||
if (clients > 0) [args addObject:[NSString stringWithFormat:@"-c%d", clients]];
|
||||
|
||||
|
||||
@@ -583,7 +583,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "echo $TARGET_BUILD_DIR\ncd $TARGET_BUILD_DIR\n\n#ensure old package is gone\nrm -f assaultcube.dmg\n\n#make the directory which our disk image will be made of\n#use /tmp as a destination because copying ourself (xcode folder) whilst compling causes the dog to chase its tail\nACPKG=`mktemp -d /tmp/acpkg.XXXXXX` || exit 1\n\n#leave indicator of where temp directory is in case things break\nln -sf $ACPKG $TARGET_BUILD_DIR/acpkg\n\n#copy launcher\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/launcher.app $ACPKG/AssaultCube.app\n\nHELPDIR=$ACPKG/AssaultCube.app/Contents/Resources/help/\nGAMEDIR=$ACPKG/AssaultCube.app/Contents/gamedata\nmkdir $GAMEDIR\nmkdir $HELPDIR\n\n#copy assaultcube\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/assaultcube.app $GAMEDIR/\n\n#install all frameworks into app bundle\nmkdir $GAMEDIR/assaultcube.app/Contents/Frameworks\nfor framework in SDL.framework SDL_image.framework Ogg.framework Vorbis.framework\ndo\n\tif [ -d $LOCAL_LIBRARY_DIR/Frameworks/$framework/ ] \n\tthen\t\n\t\t/Developer/Tools/CpMac -r $LOCAL_LIBRARY_DIR/Frameworks/$framework/ $GAMEDIR/assaultcube.app/Contents/Frameworks\n\t\trm -rf $GAMEDIR/assaultcube.app/Contents/Frameworks/$framework/Versions/A/Headers\n\telse\n\t\texit 1\n\tfi\ndone\n\n\n#copy readme and data and remove unneccesary stuff\n/Developer/Tools/CpMac -r $SRCROOT/../../README.html $HELPDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../docs $HELPDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../bot $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../config $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../screenshots $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../mods $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../packages $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../source $ACPKG/sourcecode\nfind -d $ACPKG -name \"shadows.dat\" -exec rm -rf {} \\;\nfind -d $ACPKG -name \"CVS\" -exec rm -rf {} \\;\nfind $ACPKG -name \".DS_Store\" -exec rm -f {} \\;\nrm -rf $ACPKG/sourcecode/xcode/build\nrm -f $GAMEDIR/config/saved.cfg\nrm -f $GAMEDIR/config/servers.cfg\n\n\n#add alias to readme\n/usr/bin/osascript <<EOT\ntell application \"Finder\"\nset macSrcPath to POSIX file \"$HELPDIR/README.html\" as text\nset macDestPath to POSIX file \"$ACPKG\" as text\nmake new alias file to file macSrcPath at folder macDestPath\nend tell\nEOT\n\n#finally make a disk image out of the stuff\nhdiutil create -srcfolder $ACPKG -volname assaultcube assaultcube.dmg\nhdiutil internet-enable -yes assaultcube.dmg\n\n#cleanup\nrm -rf $ACPKG";
|
||||
shellScript = "echo $TARGET_BUILD_DIR\ncd $TARGET_BUILD_DIR\n\n#ensure old package is gone\nrm -f assaultcube.dmg\n\n#make the directory which our disk image will be made of\n#use /tmp as a destination because copying ourself (xcode folder) whilst compling causes the dog to chase its tail\nACPKG=`mktemp -d /tmp/acpkg.XXXXXX` || exit 1\n\n#leave indicator of where temp directory is in case things break\nln -sf $ACPKG $TARGET_BUILD_DIR/acpkg\n\n#copy launcher\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/launcher.app $ACPKG/AssaultCube.app\n\nHELPDIR=$ACPKG/AssaultCube.app/Contents/Resources/help/\nGAMEDIR=$ACPKG/AssaultCube.app/Contents/gamedata\nmkdir $GAMEDIR\nmkdir $HELPDIR\n\n#copy assaultcube\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/assaultcube.app $GAMEDIR/\n\n#install all frameworks into app bundle\nmkdir $GAMEDIR/assaultcube.app/Contents/Frameworks\nfor framework in SDL.framework SDL_image.framework Ogg.framework Vorbis.framework\ndo\n\tif [ -d $LOCAL_LIBRARY_DIR/Frameworks/$framework/ ] \n\tthen\t\n\t\t/Developer/Tools/CpMac -r $LOCAL_LIBRARY_DIR/Frameworks/$framework/ $GAMEDIR/assaultcube.app/Contents/Frameworks\n\t\trm -rf $GAMEDIR/assaultcube.app/Contents/Frameworks/$framework/Versions/A/Headers\n\telse\n\t\texit 1\n\tfi\ndone\n\n\n#copy readme and data and remove unneccesary stuff\n/Developer/Tools/CpMac -r $SRCROOT/../../README.html $HELPDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../docs $HELPDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../bot $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../config $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../screenshots $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../mods $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../packages $GAMEDIR/\n/Developer/Tools/CpMac -r $SRCROOT/../../source $ACPKG/sourcecode\nfind -d $ACPKG -name \"shadows.dat\" -exec rm -rf {} \\;\nfind -d $ACPKG -name \"CVS\" -exec rm -rf {} \\;\nfind $ACPKG -name \".DS_Store\" -exec rm -f {} \\;\nrm -rf $ACPKG/sourcecode/xcode/build\nrm -f $GAMEDIR/config/saved.cfg\nrm -f $GAMEDIR/config/init.cfg\nrm -f $GAMEDIR/config/servers.cfg\n\n\n#add alias to readme\n/usr/bin/osascript <<EOT\ntell application \"Finder\"\nset macSrcPath to POSIX file \"$HELPDIR/README.html\" as text\nset macDestPath to POSIX file \"$ACPKG\" as text\nmake new alias file to file macSrcPath at folder macDestPath\nend tell\nEOT\n\n#finally make a disk image out of the stuff\nhdiutil create -srcfolder $ACPKG -volname assaultcube assaultcube.dmg\nhdiutil internet-enable -yes assaultcube.dmg\n\n#cleanup\nrm -rf $ACPKG";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user