Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code> How to detect if a player has not logged in simutaneously and opened two game sessions but without having to refer to a Database or using Sql </code></pre> <p>Assuming you use multiple servers you create a processes somewhere that only registers logins and logouts. You have it called whenever one of the two happens. You can use that process to check whether a user is already logged in. You can loadbalance this process by, for instance, running it on all servers and use an algorithm to use serverx only for a subset of the users. Say you have 10 servers, do (userId % 10) to get the Id of the server a user registers login/logout with. </p> <p>This way you do these checks only in memory with calls between servers. Possibly you will need a timeout/refreshcall so users that disconnect or servers that crash will not keep users logged in forever. </p> <pre><code>How to control the surge of records into the GameProgress table. so that players get response quicker. The Server starts to lag at peak hours or when 1000 players are online </code></pre> <p>#1 Switch the postgress database to using SSD's for storage</p> <p>#2 Elevate this entire process into memory and do not use the database for realtime work</p> <p>#3 Update records in the database instead of creating new ones</p> <p>#4 Use multiple databases and distribute users over them</p> <p>#5 ....</p> <pre><code>Our table has a primarykey as tournamentid a random 32 character code on basis of playerids. </code></pre> <p>A randomly generated primary key is very bad practice imho. Use a sequence, or anything is guaranteed to be unique. If your randomcode is not random enough you will get very nasty bugs. You need to generate this only once per game so it is not a performance bottleneck.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload