Skip to main content
Skip to main content

PlaceableObjectStorageStoreEvent

PlaceableObjectStorageStoreEvent

Description

Event from client to server to store the manual objects in the trigger

Parent

Event

Functions

emptyNew

Description

Create instance of Event class

Definition

emptyNew()

Return Values

anyselfinstance of class event

Code

function PlaceableObjectStorageStoreEvent.emptyNew()
return Event.new( PlaceableObjectStorageStoreEvent _mt)
end

new

Description

Create new instance of event

Definition

new(Object placeable)

Arguments

Objectplaceableplaceable object

Return Values

Objectself

Code

function PlaceableObjectStorageStoreEvent.new(placeable)
local self = PlaceableObjectStorageStoreEvent.emptyNew()
self.placeable = placeable
return self
end

readStream

Description

Called on client side on join

Definition

readStream(integer streamId, Connection connection)

Arguments

integerstreamIdstreamId
Connectionconnectionconnection

Code

function PlaceableObjectStorageStoreEvent:readStream(streamId, connection)
self.placeable = NetworkUtil.readNodeObject(streamId)
self:run(connection)
end

run

Description

Run action on receiving side

Definition

run(Connection connection)

Arguments

Connectionconnectionconnection

Code

function PlaceableObjectStorageStoreEvent:run(connection)
if self.placeable ~ = nil and self.placeable:getIsSynchronized() and self.placeable.storePendingManualObjects ~ = nil then
self.placeable:storePendingManualObjects()
end
end

writeStream

Description

Called on server side on join

Definition

writeStream(integer streamId, Connection connection)

Arguments

integerstreamIdstreamId
Connectionconnectionconnection

Code

function PlaceableObjectStorageStoreEvent:writeStream(streamId, connection)
NetworkUtil.writeNodeObject(streamId, self.placeable)
end