From a4f36118dc3781fcee3e633d2db99127de919c68 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Fri, 18 Nov 2011 04:46:20 +0000 Subject: 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 --- macosx/plugins/DFNet/macsrc/cfg.c | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 macosx/plugins/DFNet/macsrc/cfg.c (limited to 'macosx/plugins/DFNet/macsrc/cfg.c') 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 +#include +#include + +#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); +} -- cgit v1.2.3