Writing/Reading to and from log

This is a discussion on Writing/Reading to and from log within the C++ Programming forums, part of the General Programming Boards category; Hello Community members, First of all i want to say that i am very very new to C++ as i ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    Writing/Reading to and from log

    Hello Community members,
    First of all i want to say that i am very very new to C++ as i am looking into it because of a project i am working on which requires me to look into it.

    Also i am new to this forum so also hello from me!

    The question(s):
    I am looking for some startup information for a function in my server program.

    I'm trying to create a program that does the following things.

    1:Reads information from a log file (let we say log.txt).
    2:Looks for logdata example: -->
    Code:
    PBSV: VIOLATION (CVAR) #9001: banlist (slot #1) Cvar wallhack = 1 [337006ect.ect.ect.(VALID) 04.10.00.08:28960]
    [12.27.2007 02:14:43]
    (for the gamers under us, its a punkbuster violation).

    3:Write this to a new logfile called gbl.txt.

    After that the question is: is it possible for C++ to execute a TELNET command automaticly by the information gather by the LOG (in the other question)

    I think i leave it at that for now, so where i am hoping for is, which functions i need, or a example of it. Also if everything i asked is possible or not.

    (I am not asking you to WRITE it, although it would be nice :P but well we all have our limits!

    Thanks in advance!
    Maikel,

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,665
    I see that the 3rd question is a question, but not the first or second one. Do you mean you want to ask how to open and read from a file?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    PB already puts the violations in a file called sv_cheat.log and sv_viol.log in the PB folder. There is no reason to move the information from the svlogs folder to another location if it's done for you.

    What are you actually trying to do? The TELNET request is rather odd. From a PB violation, you want to TELNET somewhere based on it?

    If you're trying to make a banlist automatically from people caught cheating, I believe I have a solution for you.

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    3
    This needs further explanation i see.

    The process diagram.
    http://www.adminrequest.com/downloads/gblproject.gif

    The project GBL:
    GBL stands for Global Ban List and was created because of the need of bundling multiple banlists. We have spoken to Even Balance Inc. about the whole concept as they helped others with this kind of systems.

    ATM we have a remote LOG application streaming the servers called PBUCON(tm)
    which streams all violations to our remote dedicated server (master1.adminrequest.com)

    In here we have 1 major LOG, where all the servers stream to, from there we need an application to readout and write it to a new log.txt and from there we add a TELNET function which checks if "that" player is connected or not with the TRUE/FALSE statement if so KICK or NOT.

    ATM we already have a java scripter doing some work, but hes also a very busy man, and also i am in the need of getting this sorted so i am now looking my self how to work this out.

    Hope this clears everything up!

    Thanks in advance!
    Maikel
    Last edited by !AR!BlackHawk; 12-30-2007 at 09:45 AM.

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    3
    I make 1 new post so its alot more clean:

    @Elysia: I am looking to find out how i can set C++ to: FIND information (see my quote) and after that post the outcome into a new logfile.

    @MacGyver: Thats exactly what where doing! only on a larger scale, we got the gameserver end side sorted. BUT now where working on a masterserver side.

    If the C++ writes everything to a new logfile, then from there we stream all Banlists from other AC Communitys: PsB, PBBans, GV, ect ect. into 1 big banlist!

  6. #6
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Ah, OK. I got it.

    EB documented a way to utilize PBUcon. The way I understand it, you're supposed to make a master program of sorts to start up PBUcon. By redirecting the IO of the PBUcon process, you can send commands and receive data and responses via stdin and stdout (of the PBUcon process) respectively. I also believe you're supposed to have one PBUcon process per server, so this is why you're need a good master backend to handle all the instances.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21