MacProxy tweaks

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1077 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
axial
2007-03-28 21:43:05 +00:00
parent eaf7052f64
commit c949715566
5 changed files with 17 additions and 3 deletions

View File

@@ -4,10 +4,13 @@
#import "SLProxy.h"
NSTask *killtask;
@interface Controller : NSObject
{
}
+ (void)terminateOnFailure:(NSTask *)task;
+ (void)failBecause:(NSString *)reason;
@end

View File

@@ -2,7 +2,12 @@
@implementation Controller
+ (void)terminateOnFailure:(NSTask *)task {
killtask = task;
}
+ (void)failBecause:(NSString *)reason {
[killtask terminate];
NSRunCriticalAlertPanel(@"Failed to start Second Life.", reason, @"Quit", nil, nil);
[NSApp terminate:nil];
}
@@ -24,6 +29,8 @@
}
- (void)awakeFromNib {
killtask = nil;
/* Start the proxy, run Second Life, stop the proxy, and terminate. */
SLProxy *proxy = [[SLProxy alloc] init];
[self runSecondLifeWithLoginURL:[proxy loginURL]];

View File

@@ -5,6 +5,8 @@
@implementation SLProxy
- (SLProxy *)init {
[super init];
NSPipe *pipe = [NSPipe pipe];
/* Launch the proxy. */
@@ -18,6 +20,7 @@
NS_HANDLER
[Controller failBecause:@"Mono does not appear to be installed on your system."];
NS_ENDHANDLER
[Controller terminateOnFailure:task];
/* Read the proxy's output to determine the login URL to give SL. */
int reader = [[pipe fileHandleForReading] fileDescriptor];

View File

@@ -26,6 +26,7 @@ framework installed. This should be distributed separately, since
it's huge. The installer is available from
http://www.mono-project.com/Downloads.
Applications generated by MacProxy currently require Mac OS 10.4.0 or
later, whereas Second Life itself only requires 10.3.9. This
shouldn't be hard to fix.
MacProxy assumes that your proxy application accepts the standard
suite of --proxy arguments via the command line (see SLProxy's
documentation) and that it doesn't output anything of its own to
stdout before the proxy is active.