Author |
Message |
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Dec 09, 2003 6:19 pm Post subject: INI Checking tool |
|
|
|
|
Here's a program inspired by this post. It's open source (the source is in the zip) and all it does is check your server.ini and subbill.ini for common errors. (They must be in the same directory as the program.) It's very un-userfriendly (command line interface), but gets the job done. This is probably all I'll do on it for a while, so feel free to add on to it! Please post any new versions/suggestions here.
Cyan _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
INIcheck.exe, inicheck.cpp
INIcheck.zip - 14.34 KB
File downloaded or viewed 118 time(s)
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Wed Dec 10, 2003 12:32 am Post subject: |
|
|
|
|
You could check for an argument to your program (if (argc > 1)), and assume that the inputted file is which directory you wish to check. So instead of using the current directory, you can split the inputed file (argv[1]) after the last \ or /, and then tack on the server.ini/subbill.ini. This way, it will work if they check either file.
Looking good. I'm sure others can suggest some more doh! type checks.
|
|
Back to top |
|
|
stuperfied Novice
Age:45 Gender: Joined: Dec 05 2003 Posts: 37 Location: wollongong Offline
|
Posted: Wed Dec 10, 2003 7:51 am Post subject: |
|
|
|
|
Well I cant help with that Mine GO BOOM as im not that good with C++ but I did some work on the [Directory].IP bit. I dont have a compilar and seeing as im not that good with C++ can someone please check this and if its ok compile it and post in this thread? Thanx.
I updated the version too, hope that is how its done.
inicheck.cpp - 4.01 KB
File downloaded or viewed 56 time(s)
Last edited by stuperfied on Wed Dec 10, 2003 8:06 am, edited 1 time in total |
|
Back to top |
|
|
Plody Guest
Offline
|
Posted: Wed Dec 10, 2003 7:59 am Post subject: |
|
|
|
|
That should work, I havent tried it, just read it. However, I wouldnt putz around with the directory part, as they may have a diferent order or whatever, or may not wish to list at all as most people generally do.
Try making it check for malicious settings. For example, setting Minimum Vitual to 0 can crash the server.
|
|
Back to top |
|
|
stuperfied Novice
Age:45 Gender: Joined: Dec 05 2003 Posts: 37 Location: wollongong Offline
|
Posted: Wed Dec 10, 2003 8:11 am Post subject: |
|
|
|
|
Thanx Plody. The purpose is to assume that the user does not know about these settings and correct any errors the user may have made. That directory ip is a big one that can stop their site being listed, hence they come in here and ask why. If they know what they want it set to they can just change it back afterwards. Good call on the malicious settings too Plody.
Was I supposed to put "* edited by stuperfied" in there too or not? If so can the person who compiles it for me put that in too? Thanx.
|
|
Back to top |
|
|
50% Packetloss Server Help Squatter
Age:39 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
|
Back to top |
|
|
1stStrike Cute like a kitty
Joined: Dec 28 2002 Posts: 426 Offline
|
Posted: Wed Dec 10, 2003 2:45 pm Post subject: |
|
|
|
|
When you get this app finalized a bit more, let me know and I'll put it on the ssi site so users can DL it.
|
|
Back to top |
|
|
stuperfied Novice
Age:45 Gender: Joined: Dec 05 2003 Posts: 37 Location: wollongong Offline
|
Posted: Wed Dec 10, 2003 3:44 pm Post subject: |
|
|
|
|
I wouldnt know 50% Packetloss, I just coppied it off the server help index and assumed that info was upto date. Please feel free to make corrections wherever needed.
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Dec 10, 2003 5:01 pm Post subject: |
|
|
|
|
I dunno about the whole Directory server thing, as someone may have it in a different order or maybe an extra server that's not so common or whatever. I changed it to if (strcmp(server.dip, "") == 0)
{
printf("Directory IP set to \'sscentral.subspace.inet.fi,sscentral.subspacehq.com\'\n");
WritePrivateProfileString("Directory", "IP", "sscentral.subspace.inet.fi,sscentral.subspacehq.com", spath);
error = true;
} | so it'll only add that in when there's no directory server entries. And also subspace.net and ds98.com are down so I took em off.
And I don't think I'll add in the MinimumVirtual thing (or at least not yet) since that would mean loading CFGs too, and right now it's just an INI checker. And doesn't FACTS check for that setting anyway? Every server owner should have FACTS.
Also, I think the arguments thing would be too easy for a 'server newb' to mess up somehow and it's probably just easier anyway to put the exe in your server directory.
Thanks for all of your suggestions!
|
|
Back to top |
|
|
ExplodyThingy Server Help Squatter
Age:37 Gender: Joined: Dec 15 2002 Posts: 528 Location: Washington DC Offline
|
Posted: Wed Dec 10, 2003 7:48 pm Post subject: |
|
|
|
|
Cyan~Fire wrote: |
And I don't think I'll add in the MinimumVirtual thing (or at least not yet) since that would mean loading CFGs too, and right now it's just an INI checker. And doesn't FACTS check for that setting anyway? Every server owner should have FACTS. |
Good point. I really ought to put it into my converter program, which deals with that very file. However, if the settings sucked or were untested, would someone really be converting them?
I sense someone should make a settings checker. I would if it werent midterm time.
However, you should make an optional parameter thing. If it runs and there are no parameters, check the files in that folder. The optional parameter should be a directory. Make it take that directory and prefix it to the files. Much easier, lets simple one-timers use it, and lets server owners double check their settings without moving around an exe. _________________ There are no stupid question, but there are many inquisitive idiots.
Loot
Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Dec 11, 2003 8:42 pm Post subject: |
|
|
|
|
OK I added command-line arguments.
You can get the latest binary and source at my website, to save space on this forum. (Click the open-source link for the source.)
I also decided on a little rule about version numbers. So the number doesn't start skyrocketing, I say put a letter on the end if you add a check or two, and bump up the minor version for anything else. Therefore this new version is .2 and stuperified's is .1a.
Also (again to save space), when submitting a new check or two, just post it up in a [code] box and I'll put it up on my website. But if it's a big change, you mightn't as well just put up the new cpp file.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Thu Dec 11, 2003 10:07 pm Post subject: |
|
|
|
|
I've always liked skyrocketing version numbers . When I was using CVS for my bot, I got to version .65 before my computer decided it didn't like CVS. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Thu Dec 11, 2003 10:10 pm Post subject: |
|
|
|
|
Cyan~Fire wrote: | to save space on this forum |
I have no problems with you updating your files here, as it is pretty small anyways.
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Dec 12, 2003 6:00 pm Post subject: |
|
|
|
|
Well I figured if a lot of people start getting active in this, there'll be a lot of inicheck.cpp files sitting around here
And since I have a website anyway, mightn't as well use it.
|
|
Back to top |
|
|
stuperfied Novice
Age:45 Gender: Joined: Dec 05 2003 Posts: 37 Location: wollongong Offline
|
Posted: Mon Dec 15, 2003 5:38 am Post subject: |
|
|
|
|
Which compilar do you use Cyan~Fire and where can I download one?
|
|
Back to top |
|
|
ExplodyThingy Server Help Squatter
Age:37 Gender: Joined: Dec 15 2002 Posts: 528 Location: Washington DC Offline
|
Posted: Mon Dec 15, 2003 4:11 pm Post subject: |
|
|
|
|
There is a free one at bloodshed.com, called dev-c++
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Mon Dec 15, 2003 6:42 pm Post subject: |
|
|
|
|
I use MS Visual C++ 6. Snag yourself a copy (legally, if possible ) if you wanna do a lot of Windows programming.
|
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Thu Dec 18, 2003 5:19 pm Post subject: |
|
|
|
|
VS.net is 1337
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Dec 18, 2003 5:31 pm Post subject: |
|
|
|
|
It may be, but then again its HUGE compared to 6.
And it's infected with the new .NET languages (C# bleh)!
|
|
Back to top |
|
|
stuperfied Novice
Age:45 Gender: Joined: Dec 05 2003 Posts: 37 Location: wollongong Offline
|
Posted: Thu Dec 18, 2003 7:02 pm Post subject: |
|
|
|
|
I downloaded ms visual c++ and im going through the help files now, any idea of a better, easier and faster way to learn the language? If you know of one im listenning, I havent found a better one yet but im allways open to suggestions.
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Dec 18, 2003 7:18 pm Post subject: |
|
|
|
|
www.cplusplus.com
It has all the basics.
Another really good way is looking at people's code. This INICheck program is really basic, try understanding every little thing it does and it'll help you out a lot.
BTW: I added a check on the existence of the two files. Files on my website are now updated to version .2a
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Fri Jan 09, 2004 1:52 pm Post subject: |
|
|
|
|
I decided to try this out.
I tried this: 'inicheck.exe subbill.ini server.ini' and it doesn't seem to be reading subbill.ini at all. I also tried switching the args around (server.ini subbill.ini) which gives me the same results.
When I do this: 'inicheck' and add 1 to Misc:Port (now 901) in subbill.ini windows gives me an illegal operation. I also make sure my sysop passwords differ and it gives no error (because it doesn't matter?).
I think the program should print to the screen contact details of where to send comments and the server version it is compatible with (1.34.xxx).
I got this error 'Missing DefaultLevelFile. Please set one.' but it didn't tell me which file to correct, or which [Section] in the file. I also have Misc:DefaultLevelFile already set in server.ini.
I got this error 'Billing IP set to 'localhost'', does that mean it is set to localhost, or should be set to localhost? This was when I had it set as an IP in server.ini.
In the readme it says: Quote: | Checks server.ini and subbill.ini for common errors and corrects them | Does it really write back to the file, and if so what about implementing a command line switch and confirmation whether it should do so (ok so any decent operator should keep backups in the first place).
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Jan 09, 2004 4:45 pm Post subject: |
|
|
|
|
Before I released the version with the command line arguments, I did test it, and it did work. I'll test it out again tonight.
Dunno why it would give you an illegal operation with the ports, I tested out every single error fixed in the program, no problems.
When you said you made sure the sysop passwords differed, what do you mean? Do you mean the billing pw? It does check for that.
OK I will add in server version and contact details in the readme.
OK I'll check out DefaultLevelFile, and I'll add in a section to the error message.
I made the program set the IP to localhost because if you have both the subbill.ini and server.ini on the same computer, I assumed you were running both servers on the same computer.
I will also add in a confirm on every error message, too.
Thanks for your critique!
|
|
Back to top |
|
|
-Smong- Guest
Offline
|
Posted: Sat Jan 10, 2004 3:51 pm Post subject: |
|
|
|
|
Cyan~Fire wrote: | When you said you made sure the sysop passwords differed, what do you mean? Do you mean the billing pw? It does check for that. | I made SysopPassword in server.ini differ from SysopPassword in subbill.ini
Cyan~Fire wrote: | I made the program set the IP to localhost because if you have both the subbill.ini and server.ini on the same computer, I assumed you were running both servers on the same computer. | Good thinking
|
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Sat Jan 10, 2004 8:56 pm Post subject: |
|
|
|
|
oh too, i dont think password's are case sensitive ... not sure if you took that into consideration if that's true.. lol... MEH XD
|
|
Back to top |
|
|
|