Ejemplo n.º 1
0
        unsafe internal static void OnCommand(IntPtr entity)
        {
            MetaModEngine.SetResult(MetaResult.Handled);
            Player  player = Player.GetPlayer(entity);
            Command cmd    = CommandManager.CreateCommandFromGameEngine(CommandType.Player);

            switch (cmd.Arguments[0])
            {
            case "menuselect":
                player.SelectMenu(Convert.ToInt32(cmd.Arguments[1]) - 1);
                break;

            default:
                CommandManager.Execute(player, cmd);
                break;
            }

            clientCommandEventArgs = new CommandEventArgs(player, cmd);
            OnCommand(clientCommandEventArgs);
            player.OnPlayerCommand(clientCommandEventArgs);

            if (clientCommandEventArgs.Override)
            {
                MetaModEngine.SetResult(MetaResult.Supercede);
            }
            else
            {
                MetaModEngine.SetResult(MetaResult.Handled);
            }
        }
Ejemplo n.º 2
0
 protected static void OnConnect(ConnectEventArgs args)
 {
     MetaModEngine.SetResult(MetaResult.Handled);
     if (Connect != null)
     {
         Connect(args);
     }
 }
Ejemplo n.º 3
0
 protected static void OnPutInServer(PutInServerEventArgs args)
 {
     MetaModEngine.SetResult(MetaResult.Handled);
     if (PutInServer != null)
     {
         PutInServer(args);
     }
 }
Ejemplo n.º 4
0
 protected static void OnCommand(CommandEventArgs args)
 {
     MetaModEngine.SetResult(MetaResult.Handled);
     if (ClientCommand != null)
     {
         ClientCommand(args);
     }
 }
Ejemplo n.º 5
0
        internal static void OnDisconnect(IntPtr entity)
        {
            MetaModEngine.SetResult(MetaResult.Handled);
            Player player            = Player.GetPlayer(entity);
            DisconnectEventArgs args = new DisconnectEventArgs(player);

            OnDisconnect(args);
            player.OnPlayerClientDisconnect(args);
            player.Release();
        }