Skip to content

Commit

Permalink
Added non-existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
shoghicp committed Jun 30, 2014
1 parent fe2e7ec commit 3af5d70
Show file tree
Hide file tree
Showing 6 changed files with 248 additions and 0 deletions.
Binary file added resources/server-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions src/shoghicp/BigBrother/network/protocol/BlockChangePacket.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/*
* BigBrother plugin for PocketMine-MP
* Copyright (C) 2014 shoghicp <https://github.com/shoghicp/BigBrother>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

namespace shoghicp\BigBrother\network\protocol;

use shoghicp\BigBrother\network\Packet;

class BlockChangePacket extends Packet{

public $x;
public $y;
public $z;
public $blockId;
public $blockMeta;

public function pid(){
return 0x23;
}

public function encode(){
$this->putInt($this->x);
$this->putByte($this->y);
$this->putInt($this->z);
$this->putVarInt($this->blockId);
$this->putByte($this->blockMeta);
}

public function decode(){

}
}
39 changes: 39 additions & 0 deletions src/shoghicp/BigBrother/network/protocol/EntityHeadLookPacket.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/*
* BigBrother plugin for PocketMine-MP
* Copyright (C) 2014 shoghicp <https://github.com/shoghicp/BigBrother>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

namespace shoghicp\BigBrother\network\protocol;

use shoghicp\BigBrother\network\Packet;

class EntityHeadLookPacket extends Packet{

public $eid;
public $yaw;

public function pid(){
return 0x19;
}

public function encode(){
$this->putInt($this->eid);
$this->putByte((int) ($this->yaw * (256 / 360)));
}

public function decode(){

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

/*
* BigBrother plugin for PocketMine-MP
* Copyright (C) 2014 shoghicp <https://github.com/shoghicp/BigBrother>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

namespace shoghicp\BigBrother\network\protocol;

use shoghicp\BigBrother\network\Packet;

class PlayerBlockPlacementPacket extends Packet{

public $x;
public $y;
public $z;
public $direction;
/** @var \pocketmine\item\Item */
public $heldItem;
public $cursorX;
public $cursorY;
public $cursorZ;

public function pid(){
return 0x08;
}

public function encode(){

}

public function decode(){
$this->x = $this->getInt();
$this->y = $this->getByte();
$this->z = $this->getInt();
$this->direction = $this->getByte();
$this->heldItem = $this->getSlot();
$this->cursorX = $this->getByte();
$this->cursorY = $this->getByte();
$this->cursorZ = $this->getByte();
}
}
45 changes: 45 additions & 0 deletions src/shoghicp/BigBrother/network/protocol/PlayerDiggingPacket.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/*
* BigBrother plugin for PocketMine-MP
* Copyright (C) 2014 shoghicp <https://github.com/shoghicp/BigBrother>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

namespace shoghicp\BigBrother\network\protocol;

use shoghicp\BigBrother\network\Packet;

class PlayerDiggingPacket extends Packet{

public $status;
public $x;
public $y;
public $z;
public $face;

public function pid(){
return 0x07;
}

public function encode(){

}

public function decode(){
$this->status = $this->getByte();
$this->x = $this->getInt();
$this->y = $this->getByte();
$this->z = $this->getInt();
$this->face = $this->getByte();
}
}
67 changes: 67 additions & 0 deletions src/shoghicp/BigBrother/utils/AES.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

/*
* BigBrother plugin for PocketMine-MP
* Copyright (C) 2014 shoghicp <https://github.com/shoghicp/BigBrother>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

namespace shoghicp\BigBrother\utils;

class AES{
private $key, $keyLenght, $IV, $IVLenght, $enc, $dec, $mode, $algorithm;

function __construct($bits, $mode, $blockSize){
$this->algorithm = "rijndael-".intval($bits);
$this->mode = strtolower($mode);
$mcrypt = mcrypt_module_open($this->algorithm, "", $this->mode, "");
$this->IVLenght = mcrypt_enc_get_iv_size($mcrypt);
mcrypt_module_close($mcrypt);
$this->keyLenght = $bits >> 3;
$this->setKey();
$this->setIV();
$this->init();
}

public function init(){
if(is_resource($this->enc)){
mcrypt_generic_deinit($this->enc);
mcrypt_module_close($this->enc);
}
$this->enc = mcrypt_module_open($this->algorithm, "", $this->mode, "");
mcrypt_generic_init($this->enc, $this->key, $this->IV);

if(is_resource($this->dec)){
mcrypt_generic_deinit($this->dec);
mcrypt_module_close($this->dec);
}
$this->dec = mcrypt_module_open($this->algorithm, "", $this->mode, "");
mcrypt_generic_init($this->dec, $this->key, $this->IV);
}

public function setKey($key = ""){
$this->key = str_pad($key, $this->keyLenght, "\x00", STR_PAD_RIGHT);
}

public function setIV($IV = ""){
$this->IV = str_pad($IV, $this->IVLenght, "\x00", STR_PAD_RIGHT);
}

public function encrypt($plaintext){
return mcrypt_generic($this->enc, $plaintext);
}

public function decrypt($ciphertext){
return mdecrypt_generic($this->dec, $ciphertext);
}

}

0 comments on commit 3af5d70

Please sign in to comment.