diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-11-18 04:46:20 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-11-18 04:46:20 +0000 |
| commit | a4f36118dc3781fcee3e633d2db99127de919c68 (patch) | |
| tree | aca2b0c5e96609da798acb5b2bae696ee45444fd /macosx/plugins/DFNet/macsrc/cfg.c | |
| parent | 8a299835645bef784c8c468def91031e2e5e4400 (diff) | |
| download | pcsxr-a4f36118dc3781fcee3e633d2db99127de919c68.tar.gz | |
DFNet for Mac OS X.
Note that DFNet is disabled by default, and there are still a few rough edges.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72400 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFNet/macsrc/cfg.c')
| -rw-r--r-- | macosx/plugins/DFNet/macsrc/cfg.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/macosx/plugins/DFNet/macsrc/cfg.c b/macosx/plugins/DFNet/macsrc/cfg.c new file mode 100644 index 00000000..a61e6cd8 --- /dev/null +++ b/macosx/plugins/DFNet/macsrc/cfg.c @@ -0,0 +1,51 @@ +// +// DF Netplay Plugin +// +// Based on netSock 0.2 by linuzappz. +// The Plugin is free source code. +// + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "dfnet.h" + +#define CFG_FILENAME "dfnet.cfg" + +void AboutDlgProc(); +void ConfDlgProc(); + +void NETabout() { + AboutDlgProc(); +} + +long NETconfigure() { + ConfDlgProc(); + + return 0; +} + +void SaveConf() { + FILE *f; + + f = fopen(CFG_FILENAME, "w"); + if (f == NULL) return; + fwrite(&conf, 1, sizeof(conf), f); + fclose(f); +} + +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); +} |
