Example #1
0
        private void OnJoin(JoinEvent e)
        {
            Program.DebugLog("on Join");
            if (!ProposalExists(e.PostedChannel.Id)) //if there is already an active proposal
            {
                return;
            }

            var proposal = _proposals[e.PostedChannel.Id];

            if (proposal.WhiteSide == null)
            {
                OnJoinSide(e.ToJoinSideEvent(true));
            }
            else if (proposal.BlackSide == null)
            {
                OnJoinSide(e.ToJoinSideEvent(false));
            }
            else
            {
                throw new AggregateException("not deleting proposals correctly after game has already started?");
            }
        }