Exemplo n.º 1
0
 /// <summary>
 /// Handles the packet.
 /// </summary>
 /// <param name="Server">The server.</param>
 /// <param name="Client">The client.</param>
 /// <remarks></remarks>
 public override void HandlePacket(ClassicServer Server, RemoteClient Client)
 {
     World.Find(Client.World)._SetBlock(Position, Type);
     //Send the block to all clients.
     if (Mode != 0)
     {
         Server.EnqueueToAllClients(new ServerSetBlockPacket(Position, Type));
     }
     else
     {
         Server.EnqueueToAllClients(new ServerSetBlockPacket(Position, 0));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Stops MCForge
        /// </summary>
        /// <remarks>Kicks all players, saves all of the worlds then exits</remarks>
        public static void Stop()
        {
            ClassicServer.EnqueueToAllClients(new DisconnectPlayerPacket {
                Reason = ServerSettings.GetSetting("ShutdownMessage")
            });

            foreach (var world in ClassicServer.Worlds)
            {
                world.Save();
            }
            if (ServerSettings.GetSettingBoolean("UsingConsole"))
            {
                MCForgeConsole.Close();
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Handles the packet.
 /// </summary>
 /// <param name="Server">The server.</param>
 /// <param name="Client">The client.</param>
 /// <remarks></remarks>
 public override void HandlePacket(ClassicServer Server, RemoteClient Client)
 {
     //Send message to all clients. Create a method in ClassicServer to do this, which handles length & colors.
     Server.EnqueueToAllClients(new MessagePacket(0, "<" + Client.UserName + ">: " + Message));
 }