diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-12-02 23:20:44 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-12-02 23:20:44 +0000 |
| commit | e46e672bf9d13a5aefeed9520cc68fec1bff583e (patch) | |
| tree | b132d2f62002cc411e2c63a49e3dadb6a27e1a7d /macosx/plugins/DFNet/macsrc | |
| parent | afc0ff9c91ec161fb519bede8957311ef0fc3b7d (diff) | |
| download | pcsxr-e46e672bf9d13a5aefeed9520cc68fec1bff583e.tar.gz | |
Fixes to the Net plug-in for Mac OS X:
Use -[NSString cStringUsingEncoding:NSASCIIStringEncoding] instead of just -[NSString cString] for getting the IP address from an NSString.
Center the SockDialog before showing it.
Load values when sockOpen() is called.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72821 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFNet/macsrc')
| -rw-r--r-- | macosx/plugins/DFNet/macsrc/PluginConfigController.m | 2 | ||||
| -rw-r--r-- | macosx/plugins/DFNet/macsrc/SockDialog.m | 4 | ||||
| -rw-r--r-- | macosx/plugins/DFNet/macsrc/cfg.c | 14 |
3 files changed, 6 insertions, 14 deletions
diff --git a/macosx/plugins/DFNet/macsrc/PluginConfigController.m b/macosx/plugins/DFNet/macsrc/PluginConfigController.m index 39ff984f..dbda2051 100644 --- a/macosx/plugins/DFNet/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFNet/macsrc/PluginConfigController.m @@ -92,7 +92,7 @@ void ReadConfig() conf.PortNum = [[keyValues objectForKey:kIPPORT] intValue]; conf.PlayerNum = [[keyValues objectForKey:kPLAYERNUM] intValue]; - strcpy(conf.ipAddress, [[keyValues objectForKey:kIPADDRKEY] cString]); + strcpy(conf.ipAddress, [[keyValues objectForKey:kIPADDRKEY] cStringUsingEncoding:NSASCIIStringEncoding]); } @implementation PluginConfigController diff --git a/macosx/plugins/DFNet/macsrc/SockDialog.m b/macosx/plugins/DFNet/macsrc/SockDialog.m index e49ffc3d..0b108f5e 100644 --- a/macosx/plugins/DFNet/macsrc/SockDialog.m +++ b/macosx/plugins/DFNet/macsrc/SockDialog.m @@ -38,9 +38,9 @@ void sockCreateWaitDlg() { if (globalSock == nil) { globalSock = [[SockDialog alloc] init]; } - [globalSock showWindow:nil]; NSWindow *tempWindow = [globalSock window]; [tempWindow center]; + [globalSock showWindow:nil]; [tempWindow makeKeyAndOrderFront:nil]; } @@ -51,6 +51,8 @@ void sockDlgUpdate() { long sockOpen() { + LoadConf(); + return 0; } diff --git a/macosx/plugins/DFNet/macsrc/cfg.c b/macosx/plugins/DFNet/macsrc/cfg.c index a61e6cd8..f6db3ecd 100644 --- a/macosx/plugins/DFNet/macsrc/cfg.c +++ b/macosx/plugins/DFNet/macsrc/cfg.c @@ -15,6 +15,7 @@ void AboutDlgProc(); void ConfDlgProc(); +void ReadConfig(); void NETabout() { AboutDlgProc(); @@ -36,16 +37,5 @@ void SaveConf() { } void LoadConf() { - FILE *f; - - f = fopen(CFG_FILENAME, "r"); - if (f == NULL) { - conf.PlayerNum = 1; - conf.PortNum = 33306; - strcpy(conf.ipAddress, "127.0.0.1"); - return; - } - - fread(&conf, 1, sizeof(conf), f); - fclose(f); + ReadConfig(); } |
