Example #1
0
        public void ConnectGameServer()
        {
            Play.DoConnectToGameSever(Play.GameServer, () =>
            {
                var sessionOpenCmd = new PlayCommand()
                {
                    Body = new Dictionary <string, object>()
                    {
                        { "cmd", "session" },
                        { "op", "open" },
                        { "ua", Play.PlayVersion + "_" + Play.GameVersion },
                        { "peerId", this.ID }
                    }
                };

                Play.RunSocketCommand(sessionOpenCmd, PlayEventCode.OnAuthenticating, done: (req, res) =>
                {
                    this.SessionToken = res.Body["st"] as string;
                });
            });
        }