Thread: A possiblity of not useing tcp-ip for a lan based game?

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    38

    A possiblity of not useing tcp-ip for a lan based game?

    I was wondering if it is possible to have a program save to an output file on another computer ,have that computer check the file and if some variable in it == 1 then it does its thing. Tho the time delays would be crucial. I believe this would have the ability to work, but I would like to be warned before I spend some long *** time coding something that manages to kill my LAN over and over again. (assuming I make a function to save the configurations of the locations of the files n such)

  2. #2
    stovellp
    Guest
    But then wouldn't you want to use TCP/IP anyway to get the file there?

    It would be much easier just using TCP/IP sockets and setting up all the computers as Hosts/clients and develop your own protocol for what information you send, eg:

    HLTH=10

    When another computer see's that they think your health is ten. I dunno, I haven't thought about it much but this is how I would do it.

    Paul

  3. #3
    Registered User foniks munkee's Avatar
    Join Date
    Nov 2001
    Posts
    343
    It would be deathly slow - especially if you require real time interaction.
    "Queen and huntress, chaste and fair,
    Now the sun is laid to sleep,
    Seated in thy silver chair,
    State in wonted manner keep."

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    38
    No real time at all.... Just a turn based game... but I dont know how to use that tcp-ip stuff for c++ and it looked pretty ****ing weird when I looked at it.... I was just wondering if I could save over a LAN like make this computer save its game on the other one....

  5. #5
    stovellp
    Guest
    I don't think you can just 'Save a file' to someone else's hard drive, too many security breaches and all. TCP/IP with sockets in C isn't too hard, all you need to do is get the address and port, then you bind the socket (get it ready) and connect it or make it listen. You'll find it a lot faster too because you don't have to endlessly open files to see if they've been changed, you just act on information when it is sent to you.

    There are heaps of places on the net that do it, I've done it in under 30 lines before, and you'll learn heaps from it.

  6. #6
    Registered User
    Join Date
    Jan 2003
    Posts
    38
    Any good sites you know of that might have some code or better yet commented code?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. TCP IP Modbus
    By boschow in forum Networking/Device Communication
    Replies: 0
    Last Post: 03-27-2008, 12:20 PM
  2. C Programming 2d Array Question
    By jeev2005 in forum C Programming
    Replies: 3
    Last Post: 04-26-2006, 03:18 PM
  3. LAN IP masks?
    By whackaxe in forum Networking/Device Communication
    Replies: 7
    Last Post: 07-12-2004, 04:30 AM
  4. Text Based Game
    By drdroid in forum C++ Programming
    Replies: 2
    Last Post: 02-18-2002, 06:21 PM