예제 #1
0
        public Player(MiNetServer server, IPEndPoint endPoint, Level level, int mtuSize)
            : base(-1, level)
        {
            Rtt = 300;
            Width = 0.6;
            Length = 0.6;
            Height = 1.80;

            Popups = new List<Popup>();

            Server = server;
            EndPoint = endPoint;
            _mtuSize = mtuSize;
            Level = level;

            Permissions = new PermissionManager(UserGroup.User);
            Permissions.AddPermission("*"); //All users can use all commands. (For debugging purposes)

            Inventory = new PlayerInventory(this);

            _chunksUsed = new Dictionary<Tuple<int, int>, McpeBatch>();

            IsSpawned = false;
            IsConnected = true;

            SpawnPosition = Level.SpawnPoint;
            KnownPosition = new PlayerLocation
            {
                X = SpawnPosition.X,
                Y = SpawnPosition.Y,
                Z = SpawnPosition.Z,
                Yaw = 91,
                Pitch = 28,
                HeadYaw = 91
            };

            GameMode = level.GameMode;

            _sendTicker = new Timer(SendQueue, null, 10, 10); // RakNet send tick-time
        }