![]() |
Writing a file based on IP address
I'm making a code modification, but I need some assisstance with something.
My code mod is going to have a 'challenge' system similar to Movie Battles 2, as well as an experience, levelling, and class system. Challenges unlock certain things, and certain challenges are limited to class and weapon. I want the game to write a file serverside based on the IP address to achieve this, as well as a /wipe command in order to erase all data. I'm thinking I can reference two new functions, oz_Write and oz_Read in ClientDisconnect and ClientConnect, respectively. I haven't the foggiest idea how to write oz_Write/Read though, and I tried using a register type system that Robo posted a while back, but it requires me to include Windows include files and that will crop up even more issues (But it will work with JK3...sigh). I'm using the .vm compiler to compile in JK2 first, that way I know how to implement the features without worrying about JK3 exploits. Then I can fix the bugs, or use OJP's source. I'm thinking something like a write file, but use ent->client->sess.IPString as a filename. Could someone help me please? :) |
wouldn't a login system be better? peoples ip addresses change all the time.
|
Create a new string in client->sess called IP
Upon ClientConnect it does a userinfo grab for the IP. Create a local variable (char TmpIP[32] = {0}) Adjust the code to look like: Code:
// check to see if they are on the banned IP listCode:
//if this is the first time then auto-assign a desired siege team and show briefing for that teamCode:
if (firstTime && !isBot)That code there (As explained in comments) will also deny connection from someone attempting to overflow their userinfo string, in which case ban checks can't be performed Then, create your file writing/reading funcs using that. For file reading, I recommend poking around JA's token parsing system (You know, the way it reads .sab files) Sorry I can't post much more, kind-of rushed =P |
| All times are GMT -4. The time now is 05:27 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.