示例#1
0
        public override void Initialize() {
            server = new KappaServer();
            client = new KappaClient();
            player = map.CreateEntity(player);
            
            List<PlayerModel> players = new List<PlayerModel>();
            players.Add(player);

            server.Start();
            client.Start();

            client.ConnectToServer("127.0.0.1", server.ConnectionPort);

            client.SendString("We're connected, baby!");

            _camera = new Camera(KappaGame.Instance.GraphicsDevice.Viewport, 1024, 1024, 1, player);
        }
示例#2
0
        public SceneInGame()
        {
            //Server server = new OfflineServer();
            map = new Map();
            player = new Player();
            player = map.CreateEntity(player);

            List<PlayerModel> players = new List<PlayerModel>();
            players.Add(player);
            /*

            server.AddPlayers(players);
            server.Run();

            ConnectionFactory.AddKnownTypes(typeof(TalkPacket)); //ToDo: Remove after update.
            clientConnectionContainer = ConnectionFactory.CreateClientConnectionContainer("127.0.0.1", server.ConnectionPort);
            clientConnectionContainer.RegisterPacketHandler(typeof(TalkPacket), messageReceived);
            clientConnectionContainer.ConnectionEstablished += connectionEstablished;
            */

            _camera = new Camera(KappaGame.Instance.GraphicsDevice.Viewport, 1024, 1024, 1, player);
        }