예제 #1
0
        /// <summary>
        /// Handles a switch request from a client
        /// </summary>
        static public void Handle_CS_PlayerSwitch(CS_PlayerSwitch pkt, Player player)
        {               //Allow the player's arena to handle it
            if (player._arena == null)
            {
                Log.write(TLog.Error, "Player {0} sent update packet with no arena.", player);
                return;
            }

            if (player.IsSpectator)
            {
                Log.write(TLog.Warning, "Player {0} attempted to activate a switch from spec.", player);
                return;
            }

            if (player.IsDead)
            {
                Log.write(TLog.Warning, "Player {0} attempted to activate a switch while dead.", player);
                return;
            }

            //Find the associated portal
            LioInfo.Switch sw = player._server._assets.getLioByID(pkt.switchID) as LioInfo.Switch;

            //If it doesn't exist, nevermind
            if (sw == null)
            {
                Log.write(TLog.Warning, "Player {0} attempted to use switch which doesn't exist.", player);
            }
            else
            {
                player._arena.handleEvent(delegate(Arena arena)
                {
                    player._arena.handlePlayerSwitch(player, pkt.bOpen, sw);
                }
                                          );
            }
        }
예제 #2
0
 public bool playerSwitch(Player player, LioInfo.Switch swi)
 {
     return(true);
 }
예제 #3
0
 /// <summary>
 /// Handles a player's switch request
 /// </summary>
 public virtual void handlePlayerSwitch(Player from, bool bOpen, LioInfo.Switch swi)
 {
 }