So I’m having a hard time understanding the documentation regarding how to write functions server side that will dictate what clients can and must do at a given time.
I have more experience with other solutions like PUN but on a p2p level not a server authoritative like the one I’m working on right now.
The first mini game I’m trying to make is fairly simple, it’s a hyper casual 2 players game where one player has to select a number and second player has to guess if the first player has selected an odd or even number.
So basically I need to be able to do the following :
1)Server decides randomly which player starts and tells the client that they can play or wait for the other client to play
Client 1 selects a number and send that information to the server
Server tells client 2 they can play and client 1 they have to wait for client 2 to play
Client 2 tells the server if they think client 1 number is odd or even
Server compares the answer and determines if client 2 has won or not and tells it to both clients.
It adds score to client 2 if it has won or to client 1 if client 2 has lost
- Server starts a new round and this time client 2 starts and client 1 will bid on odd /even.
So fairly simple, but I don’t really know how to start with writing these functions server side.
Thank you for your inputs,