Skip to content

Commit

Permalink
Add GUmpStudio plugin and refactor class name Object to UObject
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnunes committed Sep 20, 2018
1 parent 70bf18e commit 5fe72ff
Show file tree
Hide file tree
Showing 156 changed files with 334 additions and 185 deletions.
2 changes: 1 addition & 1 deletion core/types/anvil.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeAnvil extends Object {
class TypeAnvil extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/archerybutte.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeArcheryButte extends Object {
class TypeArcheryButte extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/armor.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeArmor extends Object {
class TypeArmor extends UObject {
public function typeStart() {
$this->equiped = false;
$this->layer = LayersDefs::INNER_TORSO;
Expand Down
2 changes: 1 addition & 1 deletion core/types/armorleather.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeArmorLeather extends Object {
class TypeArmorLeather extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/bandage.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBandage extends Object {
class TypeBandage extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/beard.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBeard extends Object {
class TypeBeard extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/bed.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBed extends Object {
class TypeBed extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/bedroll.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBedroll extends Object {
class TypeBedroll extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/beehive.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBeeHive extends Object {
class TypeBeeHive extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/blood.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBlood extends Object {
class TypeBlood extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/board.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBoard extends Object {
class TypeBoard extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/bone.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBone extends Object {
class TypeBone extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/book.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeBook extends Object {
class TypeBook extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/campfire.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeCampfire extends Object {
class TypeCampfire extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/carpentry.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeCarpentry extends Object {
class TypeCarpentry extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/chair.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeChair extends Object {
class TypeChair extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/clock.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeClock extends Object {
class TypeClock extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/cloth.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeCloth extends Object {
class TypeCloth extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/clothbolt.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeClothBolt extends Object {
class TypeClothBolt extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/clothing.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeClothing extends Object {
class TypeClothing extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/coin.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeCoin extends Object {
class TypeCoin extends UObject {
public function typeStart() {}
}
56 changes: 28 additions & 28 deletions core/types/container.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeContainer extends Object {
class TypeContainer extends UObject {
public $gump;
/* access properties */
public $owner;
Expand All @@ -14,8 +14,8 @@ class TypeContainer extends Object {
/* Weight properties */
public $maxWeightCapacity;
public $actualWeight;
/* Inside objects */
public $objects = [];
/* Inside UObjects */
public $UObjects = [];

public function typeStart() {
$this->actualCarry = 0;
Expand All @@ -29,15 +29,15 @@ public function click($client = null) {
return false;
}

return $this->message($this->name . " (".count($this->objects)." item ". (count($this->objects) > 1 ? "s" : "") .")", 0, 3, $client);
return $this->message($this->name . " (".count($this->UObjects)." item ". (count($this->UObjects) > 1 ? "s" : "") .")", 0, 3, $client);
}

public function dclick($client = null) {
return $this->open($client);
}

public function addItem($client = false, Object $object, $position = false, $noUpdate = false) {
if (!$object || !$client) {
public function addItem($client = false, UObject $UObject, $position = false, $noUpdate = false) {
if (!$UObject || !$client) {
return false;
}

Expand All @@ -48,47 +48,47 @@ public function addItem($client = false, Object $object, $position = false, $noU
];
}

$object->position['x'] = $position['x'];
$object->position['y'] = $position['y'];
$object->position['z'] = null;
$object->position['map'] = null;
$object->holder = $this->serial;
$object->save();
$UObject->position['x'] = $position['x'];
$UObject->position['y'] = $position['y'];
$UObject->position['z'] = null;
$UObject->position['map'] = null;
$UObject->holder = $this->serial;
$UObject->save();

$this->objects[] = $object->serial;
$this->UObjects[] = $UObject->serial;
$this->save();

if (Map::isValidSerial($object->serial)) {
Map::updateObjectHolder($object);
if (Map::isValidSerial($UObject->serial)) {
Map::updateUObjectHolder($UObject);
} else {
Map::addHoldedObject($object);
Map::addHoldedUObject($UObject);
}

if (Map::isValidSerial($this->serial)) {
Map::updateObjectHolder($this);
Map::updateUObjectHolder($this);
} else {
Map::addHoldedObject($this);
Map::addHoldedUObject($this);
}

if (!$noUpdate) {
$this->addItemToOpenedContainer($client, $object);
$this->addItemToOpenedContainer($client, $UObject);
// $this->renderItems($client);
}

return true;
}

public function removeItem($client = false, $objectSerial = false) {
if (!$objectSerial || !$client) {
public function removeItem($client = false, $UObjectSerial = false) {
if (!$UObjectSerial || !$client) {
return false;
}

if(($key = array_search($objectSerial, $this->objects)) !== false) {
unset($this->objects[$key]);
if(($key = array_search($UObjectSerial, $this->UObjects)) !== false) {
unset($this->UObjects[$key]);
$this->save();
}

Map::updateObjectHolder($this);
Map::updateUObjectHolder($this);
return true;
}

Expand All @@ -103,21 +103,21 @@ public function drawContainer($client) {
$packet .= "007F";
Sockets::out($client, $packet);

if (count($this->objects) > 0) {
if (count($this->UObjects) > 0) {
$this->renderItems($client);
}

return true;
}

public function addItemToOpenedContainer($client = false, Object $instance) {
public function addItemToOpenedContainer($client = false, UObject $instance) {
$packet = new packet_0x25($client, $instance);
$packet->send();
}

public function renderItems($client) {
$tmpPacket = str_pad(dechex(count($this->objects)), 4, "0", STR_PAD_LEFT);
foreach ($this->objects as $key => $serial) {
$tmpPacket = str_pad(dechex(count($this->UObjects)), 4, "0", STR_PAD_LEFT);
foreach ($this->UObjects as $key => $serial) {
$instance = Map::getBySerial($serial);

$tmpPacket .= str_pad($instance->serial, 8, "0", STR_PAD_LEFT);
Expand Down
2 changes: 1 addition & 1 deletion core/types/corpse.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeCorpse extends Object {
class TypeCorpse extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/cotton.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeCotton extends Object {
class TypeCotton extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/crops.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeCrops extends Object {
class TypeCrops extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/crystalball.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeCrystalBall extends Object {
class TypeCrystalBall extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/deed.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeDeed extends Object {
class TypeDeed extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/dirt.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeDirt extends Object {
class TypeDirt extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/door.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeDoor extends Object {
class TypeDoor extends UObject {
public function typeStart() {}
}
2 changes: 1 addition & 1 deletion core/types/drink.type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Ultima PHP - OpenSource Ultima Online Server written in PHP
* Version: 0.1 - Pre Alpha
*/
class TypeDrink extends Object {
class TypeDrink extends UObject {
public function typeStart() {}
}
Loading

0 comments on commit 5fe72ff

Please sign in to comment.