Пример #1
0
        /*Only the server recieves this event.
         * Similar to NextTurnEvent, but doesn't update the turn.
         * Used for network disconnection.
         * Sends the current spellcasterId.
         */
        public override void OnEvent(NotifyTurnEvent evnt)
        {
            BoltConsole.Write("SERVER: Recieved a Notify turn event");
            int currentSpellcaster = gameStateEntity.GetComponent <NetworkGameState>().getCurrentTurn();
            var nextTurnEvnt       = NextPlayerTurnEvent.Create(Bolt.GlobalTargets.Everyone);

            nextTurnEvnt.NextSpellcaster = currentSpellcaster;
            nextTurnEvnt.Send();
        }
Пример #2
0
        // ----------------- Client callbacks -----------------------------------------------------------
        // NOTE: the host also recieves these callbacks


        public override void OnEvent(NextPlayerTurnEvent evnt)
        {
            //BoltConsole.Write("Recieved NextPlayerTurnEvent");
            playerEntity.GetComponent <Player>().nextTurnEvent(evnt.NextSpellcaster);
        }