From 0d1d9bece31f605d4aa68b20f3ecb19cd0db2d3d Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Thu, 13 May 2010 03:40:12 +0000 Subject: added netplay plugin git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47937 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfnet/cfg.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/dfnet/cfg.c (limited to 'plugins/dfnet/cfg.c') 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 +#include + +#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); +} -- cgit v1.2.3