コード例 #1
0
        /// <summary>
        /// Serialises all header properties. The output will be a dictionary containing
        /// the extra header key-value pairs in addition the standard headers sent with
        /// all server requests. Will return an empty dictionary if there are no headers.
        /// </summary>
        ///
        /// <returns>The header key-value pairs.</returns>
        public IDictionary <string, string> SerialiseHeaders()
        {
            var dictionary = new Dictionary <string, string>();

            // Game Token
            dictionary.Add("Game-Token", GameToken.ToString());

            return(dictionary);
        }
コード例 #2
0
        public static string GenerateGameToken(string playerToken)
        {
            //Structure of a game token
            //G....-....-....-....
            //[0]: Timestamp since equinox
            //[1]: State => Number of games currently going
            //[2]: Player token last bit
            //[3]: Nonce

            GameToken gameToken = new GameToken(playerToken);

            return(gameToken.ToString());
        }