Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Creating a server list for online games  (Read 4359 times)

0 Members and 1 Guest are viewing this topic.

mikedee

  • Newbie
  • *
  • Posts: 3
    • View Profile
Creating a server list for online games
« on: December 19, 2009, 07:40:37 am »
Is it possible to create a server list for online games using SFML's network package ?
If so how ?


Great work with SFML btw !  :D

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Creating a server list for online games
« Reply #1 on: December 19, 2009, 01:39:27 pm »
Yes, that's possible. But please specify your question. It's like "Is it possible to program Quake 22 with SFML? If so, how?" ;)

mikedee

  • Newbie
  • *
  • Posts: 3
    • View Profile
Creating a server list for online games
« Reply #2 on: December 19, 2009, 04:03:04 pm »
I'm sorry, basically what I want is a way to interact with a mySQL database.
This can be done via php, but what I want to know exactly is how to interact with a php page.

For example: that php page has a function called add_server(servername,ip,port) which like the name implies, adds a new server to the server list. I can specify the server name, ip and port variables, but I don't know how I could trigger the function. I'm pretty sure I have to use TCP for the job, but I don't know how exactly.  :?

lotios611

  • Newbie
  • *
  • Posts: 32
    • View Profile
Creating a server list for online games
« Reply #3 on: December 19, 2009, 11:12:17 pm »
So what you want is a way to interact with a MySQL database from C++? I don't think you can do that with SFML. I think Qt has functions to do what you want.

mikedee

  • Newbie
  • *
  • Posts: 3
    • View Profile
Creating a server list for online games
« Reply #4 on: December 20, 2009, 02:56:57 am »
I don't have to deal with mysql directly, the php page will take care of that. What I need is a way to trigger the functions of the php page so that it can work with MySQL table.  :wink:

JollyRoger

  • Newbie
  • *
  • Posts: 17
    • View Profile
Creating a server list for online games
« Reply #5 on: December 20, 2009, 03:09:17 am »
Your PHP page should look something like this:
Code: [Select]

<?php
 $server 
$_GET"server" &#93;;
 
$ip $_GET"ip" &#93;;
 
$port $_GET"port" &#93;;

 
add_server&#40; $server, $ip, $port &#41;;
?>



And then call "yourpage.php?server=servervar&ip=ipvar&port=portvar" using a sf::Http::Request (http://www.sfml-dev.org/tutorials/1.5/network-http.php).

 

anything