Esempio n. 1
0
        public static void Main(string[] args)
        {
            UserSettings.Local = new UserSettings();
            UserSettings.Local.Load();

            var user = new TrueCraftUser { Username = args[1] };
            var client = new MultiplayerClient(user);
            var game = new TrueCraftGame(client, ParseEndPoint(args[0]));
            game.Run();
            client.Disconnect();
        }
Esempio n. 2
0
 public MultiplayerClient(TrueCraftUser user)
 {
     User = user;
     Client = new TcpClient();
     PacketReader = new PacketReader();
     PacketReader.RegisterCorePackets();
     PacketHandlers = new PacketHandler[0x100];
     Handlers.PacketHandlers.RegisterHandlers(this);
     World = new ReadOnlyWorld();
     var repo = new BlockRepository();
     repo.DiscoverBlockProviders();
     World.World.BlockRepository = repo;
     World.World.ChunkProvider = new EmptyGenerator();
     Physics = new PhysicsEngine(World, repo);
     SocketPool = new SocketAsyncEventArgsPool(100, 200, 65536);
     connected = 0;
     cancel = new CancellationTokenSource();
 }