Esempio n. 1
0
        public void HostBidReceived(Bid bid)
        {
            if (MainGame.Instance.HostOnly)
            {
                while (bid == null)
                {
                    ;
                }
                debugOut("Bid received");

                clientData.placeBid(bid);

                AudioHelper.play(ContentStore.soundNeutral);
                Console.WriteLine("Bid player ID: " + bid.ID);
                Console.WriteLine(network.Players.GetPlayerByID(bid.ID).Name + " bid to win " + bid.Value);
                MainGame.Instance.GeneralMessageQueue.Enqueue(network.Players.GetPlayerByID(bid.ID).Name + " bid to win " + bid.Value);
                Thread.Sleep(1000);
            }
        }
Esempio n. 2
0
        public void BidReceived(Bid bid)
        {
            while (bid == null)
            {
                ;
            }
            debugOut("Bid received");

            if (bid == lastReceivedBid)
            {
                return;
            }

            if (bid.ID == clientData.CurrentPlayer.ID)
            {
                try {
                    client.frameController.stow(client.frameBid);
                } catch (FrameController.InvalidFrameException) {
                }
            }

            foreach (Player p in network.Players.GetPlayers())
            {
                Console.WriteLine(p.Name + " (" + p.ID + ")");
            }

            clientData.placeBid(bid);

            lastReceivedBid = bid;

            AudioHelper.play(ContentStore.soundNeutral);
            Console.WriteLine("Bid player ID: " + bid.ID);
            Console.WriteLine(network.Players.GetPlayerByID(bid.ID).Name + " bid to win " + bid.Value);
            MainGame.Instance.GeneralMessageQueue.Enqueue(network.Players.GetPlayerByID(bid.ID).Name + " bid to win " + bid.Value);
            Thread.Sleep(1000);
        }