コード例 #1
0
        public override void OnConnected(Network.IConnection connection)
        {
            Context.Time.Start();

            connection.Player = Player = Context.CreatePlayer(0, connection);

            log.Info("Connected");

            if (OnClientConnected != null)
            {
                OnClientConnected(this);
            }
        }
コード例 #2
0
ファイル: Server.cs プロジェクト: parkheeyoung/SlimNet
        public override void OnConnected(Network.IConnection connection)
        {
            Assert.NotNull(connection, "connection");

            ushort playerId;

            if (playerIdPool.Acquire(out playerId))
            {
                log.Info("Connected {0}", Context.CreatePlayer(playerId, connection));
            }
            else
            {
                connection.Disconnect();
            }
        }