Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Send data to database

Discussion in 'Multiplayer' started by Smuggler20, Sep 20, 2017.

?

Question are describe in post below

  1. When match completed, C send directly data (about score, kills etc.) to MS. MS send to DB.

    33.3%
  2. C data are sync with game model in GS. When match completed, GS send data about ALL C in one package

    66.7%
  1. Smuggler20

    Smuggler20

    Joined:
    Apr 20, 2015
    Posts:
    19
    Hi,

    Legend (C - client, GS - game server, MS - master server, DB - database)

    I have multiplayer game with 8 C connected to GS. GS is connected to MS who is connected with DB. After match i want update data in DB, but dont know which way (questions over post) sholud be better.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    There's no way I would have a match and have the clients themselves individually report their results to the master server. Trusting data like scores and kills from individual clients leaves yourself open to trivially easy hacking.

    You included a legend for a 2 sentence question? Really?
     
    TwoTen and xVergilx like this.
  3. Alvarz

    Alvarz

    Joined:
    May 20, 2015
    Posts:
    9
    I'll assume your architecture is an authoritative's game server. been said that, before the match start the master server must create a match object with all the players and the information you need to save, tell about this to the game server and then when the match is done the game server must define who is the winner and notifify to all clients and to the master server who the winner is, the master server then should save that information on your prefered database, using the information of the match .

    Sorry my terrible english, is not my primary language
     
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    Game Server and Master Server are connected by example using RabbitMQ. After match GS converts data (using for example protobuf) and send message to MasterServer via RabbitMQ as persistent messages, when MS have time it iwill grab this message and update db. Another similar way to do this, use Kafka instead Rabbit - it is like logging send info and forget. After sending GS can shutdown, the data will be handled anyway
     
  5. yty

    yty

    Joined:
    Aug 10, 2009
    Posts:
    82
    hi.aabramychev...
    Is there an example of u3d+Kafka?
     
  6. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    @yty Soory, I don't know. Do you think is it problem to use kafka with unity? If yes, why?