Server Help

Misc User Apps - INI Checking tool

Cyan~Fire - 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
Mine GO BOOM - 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.
stuperfied - 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.
Anonymous - 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.
stuperfied - 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.
50% Packetloss - Wed Dec 10, 2003 1:37 pm
Post subject:
Nice! I get noobies asking me about this stuff all the time.

Code: Show/Hide
      WritePrivateProfileString("Directory", "IP", "sscentral.subspace.inet.fi,sscentral.ds98.com,sscentral.subspacehq.com,sscentral.subspace.net", spath);

Isnt ds98.com and subspace.net not up anymore?
1stStrike - 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.
stuperfied - 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.
Cyan~Fire - 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
Code: Show/Hide
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. icon_razz.gif

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! icon_smile.gif
ExplodyThingy - 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. icon_razz.gif


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.
Cyan~Fire - 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.
Dr Brain - Thu Dec 11, 2003 10:07 pm
Post subject:
I've always liked skyrocketing version numbers icon_smile.gif. When I was using CVS for my bot, I got to version .65 before my computer decided it didn't like CVS.
Mine GO BOOM - 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.
Cyan~Fire - 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 icon_razz.gif

And since I have a website anyway, mightn't as well use it.
stuperfied - Mon Dec 15, 2003 5:38 am
Post subject:
Which compilar do you use Cyan~Fire and where can I download one?
ExplodyThingy - Mon Dec 15, 2003 4:11 pm
Post subject:
There is a free one at bloodshed.com, called dev-c++
Cyan~Fire - Mon Dec 15, 2003 6:42 pm
Post subject:
I use MS Visual C++ 6. Snag yourself a copy (legally, if possible icon_razz.gif) if you wanna do a lot of Windows programming.
D1st0rt - Thu Dec 18, 2003 5:19 pm
Post subject:
VS.net is 1337
Cyan~Fire - 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)!
stuperfied - 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.
Cyan~Fire - 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
Smong - 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).
Cyan~Fire - 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!
Anonymous - 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
CypherJF - 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
Cyan~Fire - Sun Jan 11, 2004 12:37 pm
Post subject:
The sysop password in server.ini doesn't have to be the same as subbill.ini, does it? I thought they were for completely different things.

So far:
I haven't checked any of the argument errors.
No problems with the ports, may have been because it was loading the files mixed up?
I did discover that for some reason the code for loading Misc:DefaultLevelFile was missing in v2 when it was there in v1. Not quite sure how that happened.
I have added in a confirmation message for every setting.

Hopefully I'll have the new version compiled and released today.

Thanks again for your comments, must kill evil bugs!
Cyan~Fire - Sun Jan 25, 2004 1:40 pm
Post subject:
I just realized yesterday I never posted my changes up to my website. They are there now icon_razz.gif

Turned out with the DefaultLevelFile thing, my code got erased in v2, when it was there in v1. Dunno how that happened.

Also, the billing sysop password and server sysop password do not need to be the same. You may want to have a zone sysop without billing sysop powers.
stuperfied - Sun Feb 29, 2004 9:11 am
Post subject:
hello, im back. What ver of windows were you running when you referenced the ports Cyan~Fire?

I ask becuase winxp has a port manager and does not allow programs to directly reference ports but rather shunts it through virtual ports for handling first.
Cyan~Fire - Sun Feb 29, 2004 10:57 am
Post subject:
Huh what?

All this program does is check to see if the ports specified in the INIs correspond with each other. It does nothing with actually using ports.
stuperfied - Sun Feb 29, 2004 11:20 am
Post subject:
Yeah sorry, havent slept in a while. I remember now, just was browsing and havent had a chance to check on what you have all added to it since I got back. I mistook Misc:Port (now 901) for meaning you wanted to reference a port because I was just scanning instead of actually reading like I should have been doing.

Im going to bed.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group