Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer #4

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.idea/

/vendor/
5 changes: 1 addition & 4 deletions LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
## Exceptions

The usage of this library with PocketMine-MP will allow the creation
of derivated non open-source works, without direct usage of RakLib.
Only PocketMine-MP and their plugins will be able to use the library
without license restrictions.


# GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. {http://fsf.org/}
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# RakLib
RakLib
======

UDP network library that follows the RakNet protocol for PHP
> This project is not affiliated with Jenkins Software LLC nor RakNet

UDP network library that follows the RakNet protocol for PHP

_This project is not affiliated with Jenkins Software LLC nor RakNet._

```
This program is free software: you can redistribute it and/or modify
Expand All @@ -18,10 +19,10 @@ GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
```

## Exceptions
The usage of this library with PocketMine-MP will allow the creation
of derivated non open-source works, without direct usage of RakLib.
Only PocketMine-MP and their plugins will be able to use the library
without license restrictions.
```
without license restrictions.
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "pmmp/rak-lib",
"description": "RakNet server implementation written in PHP",
"type": "library",
"license": "GPL-3.0",
"require": {
"ext-pthreads": "3.1.6"
},
"autoload": {
"classmap": ["protocol/", "server/", "RakLib.php", "Binary.php"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be replaced with "autoload": { "psr-4"; { "RakLib\\": "." } }?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Composer docs say you can't use relative directories. I'll give this a try though.

}
}
19 changes: 19 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions protocol/Packet.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ protected function get($len){
return $len === 1 ? $this->buffer{$this->offset++} : substr($this->buffer, ($this->offset += $len) - $len, $len);
}

protected function getLong($signed = true){
return Binary::readLong($this->get(8), $signed);
protected function getLong(){
return Binary::readLong($this->get(8));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irrelevant to this pull request?

}

protected function getInt(){
Expand Down
2 changes: 2 additions & 0 deletions server/SessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class SessionManager{
protected $block = [];
protected $ipSec = [];

protected $serverId;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irrelevant to this pull request?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(for both comments) Composer static analysis

public $portChecking = true;

public function __construct(RakLibServer $server, UDPServerSocket $socket){
Expand Down