summaryrefslogtreecommitdiff
path: root/plugins/dfnet/cfg.c
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-13 03:40:12 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-13 03:40:12 +0000
commit0d1d9bece31f605d4aa68b20f3ecb19cd0db2d3d (patch)
treeaa8228a939d9c813626e71f937b56b2280f2fc86 /plugins/dfnet/cfg.c
parent53eb8b20be0ed97773df48ce9788e617ad876e50 (diff)
downloadpcsxr-0d1d9bece31f605d4aa68b20f3ecb19cd0db2d3d.tar.gz
added netplay plugin
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47937 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins/dfnet/cfg.c')
-rw-r--r--plugins/dfnet/cfg.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/dfnet/cfg.c b/plugins/dfnet/cfg.c
new file mode 100644
index 00000000..a63b074b
--- /dev/null
+++ b/plugins/dfnet/cfg.c
@@ -0,0 +1,37 @@
+//
+// DF Netplay Plugin
+//
+// Based on netSock 0.2 by linuzappz.
+// The Plugin is free source code.
+//
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "dfnet.h"
+
+#define CFG_FILENAME "dfnet.cfg"
+
+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);
+}