Results 1 to 3 of 3

Thread: Game in ships with using network.

  1. #1
    Join Date
    Jun 2013
    Location
    Poland, Katowice
    Posts
    13
    Thanks
    1
    Thanked 16 Times in 8 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Game in ships with using network.

    Hello All.
    I need help with my project on Academy. I write game in ships with option , playing by network and also simple chat for users. I want send by network 3 things:
    1. Simple strings from chat
    2. Several variables type int for location ships (How pixels?)
    3.And sending simple invitation to game (from one user to another user)

    And now my question...

    Can I send this all information in one function with created earlier one socket ? And next using one TcpServer to serve all requests?

    I am thinking that also I can do several functions to send different informations and several servers to serve this functions.

    Please about help in solve my problem. I don't know If my ideas are good.
    And sorry for my language. I know little English

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Game in ships with using network.

    You can use one server to receive and process messages of three different types by including a message type indicator (for example, invitation == 0, chat message == 1, position update == 2) at the start of the message. The server looks at the type indicator and handles the remainder of the message according to that type.

  3. The following user says thank you to ChrisW67 for this useful post:

    Mariusz_1990 (17th June 2013)

  4. #3
    Join Date
    Jun 2013
    Location
    Poland, Katowice
    Posts
    13
    Thanks
    1
    Thanked 16 Times in 8 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Game in ships with using network.

    Can you show me how this should look in code because I can't imagine

Similar Threads

  1. 2D Game
    By Peppy in forum Qt Programming
    Replies: 1
    Last Post: 1st May 2011, 12:45
  2. game on qt
    By bibhukalyana in forum Qt Programming
    Replies: 6
    Last Post: 27th March 2011, 22:56
  3. Replies: 1
    Last Post: 22nd May 2010, 07:38
  4. IQ Game
    By qtgears in forum Qt-based Software
    Replies: 0
    Last Post: 6th October 2009, 08:24
  5. Just for fun game
    By vermarajeev in forum Qt-based Software
    Replies: 6
    Last Post: 13th December 2007, 21:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.