dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Port Listener - FPS game

  1. #1
    Join Date
    May 2012
    Posts
    2

    Port Listener - FPS game

    Hi all,

    I just got added to a new project and as I'm a novice in web development, I need a little bit of help. I'm working on a project called VBS 2 (which is a FPS game) mingle with a trust system. Basically while you play, messages will be displayed (time, information, source and level of trust) and players will tell whether they trust this information or source or not.

    My job is to display the messages so I guess, I have to implement a port listener that for each new incoming message on the specific port, will add the content of the new message to the current displayed list. I have absolutely no clues if it's feasible in PHP, so please let me know how you would implement that idea.

    Thanks a lot,
    Greg

  2. #2
    Join Date
    May 2012
    Posts
    59
    It's not the best language for that, you would be better off with something like Python for such a task.

    If you must go down that route... remember to handle output buffering... remember to flush it each time you want to send data to the browser... and here is the huge list of socket functions you may need:
    http://php.net/manual/en/book.sockets.php

    I've recently built an instant messenger using PHP & MySQL as the backend... and i had to do it using AJAX using the Prototype library. This works well because sockets tend to be a pain the ar*e to program and to do it in PHP is like ice skating up hill!

    Kind regards,
    Scott

    P.S. I also did a IRC bot a while back using sockets - trust me, it's not nice programming!

  3. #3
    Join Date
    May 2012
    Posts
    42
    Yeah, Python would definitely work better. Ruby (not Ruby on Rails) could do the trick as well. I made an interactive SSH client using Ruby once. It was pretty easy. Just had to run it as a service.

  4. #4
    Join Date
    May 2012
    Posts
    2
    Hi all,

    Thanks for your useful responses. Unfortunately, I never did either python or Ruby but I found out a script using sockets in Php and modified it in order to display the informations needed.

    Thanks a lot for your help guys.

    Greg

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles