Пример #1
0
        protected override void OnLoad( System.EventArgs e )
        {
            Plugin.Register( "MarsMiner.Shared.CorePlugin", true, true );
            Plugin.Register( "MarsMiner.Shared.MarsMinerPlugin", true, true );

            ServerBuilder sb = new ServerBuilder
            {
                Name = "Local Server",
                Password = null,
                SlotCount = 1
            };

            myLocalServer = new GameServer( sb );
            myServerThread = new Thread( myLocalServer.Run );
            myServerThread.Start();

            myLocalClient = new GameClient();
            myLocalClient.ConnectLocal();
            myClientThread = new Thread( myLocalClient.Run );
            myClientThread.Start();

            mySpriteShader = new SpriteShader( Width, Height );
            myUIRoot = new UIObject( new Vector2( Width, Height ) );

            myFPSText = new UILabel( Font.Large, new Vector2( 4.0f, 4.0f ) );
            myFPSText.Text = "FT: ??ms FPS: ?? MEM: ??";
            myUIRoot.AddChild( myFPSText );

            Mouse.Move += OnMouseMove;
            Mouse.ButtonUp += OnMouseButtonEvent;
            Mouse.ButtonDown += OnMouseButtonEvent;

            /*
            myTestWorld = new World();

            myGeoShader = new GeometryShader( Width, Height );
            myGeoShader.UpdateTileMap( 16 );

            myGeoRenderers = new List<ChunkRenderer>();

            myTestWorld.ChunkLoaded += OnChunkEvent;
            myTestWorld.ChunkUnloaded += OnChunkEvent;
            myTestWorld.ChunkChanged += OnChunkEvent;

            myTestWorld.Generate( 1024, 1024, 4 );

            myGeoShader.CameraPosition = new Vector3( 0.0f, 1024.0f, 0.0f );
            */

            GL.ClearColor( new Color4( 223, 186, 168, 255 ) );

            myFrameTimer.Start();
        }
Пример #2
0
 public LocalClient( GameServer server )
     : base(server)
 {
 }