Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with INI
#1
I've been working on something lately, and I need to do something that I haven't done with an ini file before. I haven't yet messed around with this bit as I'm in the process of programming the other parts.
I wouldn't say it's a complex idea, which is why I've posted this in the beginner section. Thinking about it in my mind though hasn't seem to spark any good methods of achieving it, so I wanted to get some possible solutions from other people before I attempted to start working on this part of the system.

The ini file is made up of 4 different headers, each containing 10-100 values, which will contain players names. I've put 5 on here as an example:

Code:
[HEADER1]
Name1=
Name2=
Name3=
Name4=
Name5=
[HEADER2]
Name1=
Name2=
Name3=
Name4=
Name5=
[HEADER3]
Name1=
Name2=
Name3=
Name4=
Name5=
[HEADER4]
Name1=
Name2=
Name3=
Name4=
Name5=

Now, the first bit of this part of the system involves adding names and removing names. Finding a blank space and adding the name is fairly easy. Now I need to add some code that removes a specific name from one of the headers.

The next bit of this involves working with both of those methods, removing a specific name and adding it into a specific header.

I could probably use this system for my WizList security feature too, making it more easy to add and remove GMs from the WizList.

Thanks.
Reply
#2
That's white easy, use the INI functions that you already have at your game and loop thru all the posible names searching for a name. It's no problem at all, the ini functions already make all the hard work for you. Just loop it ^^
Reply
#3
problem solved I think. Some more testing needed but I think I've got it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)