BaleUnpackEvent
BaleUnpackEvent
Description
Event for bale unpacking
Parent
Functions
emptyNew
Description
Create instance of Event class
Definition
emptyNew()
Return Values
| any | self | instance of class event |
|---|
Code
function BaleUnpackEvent.emptyNew()
local self = Event.new( BaleUnpackEvent _mt)
return self
end
new
Description
Create new instance of event
Definition
new(table bale)
Arguments
| table | bale | bale |
|---|
Return Values
| table | instance | instance of event |
|---|
Code
function BaleUnpackEvent.new(bale)
local self = BaleUnpackEvent.emptyNew()
self.bale = bale
return self
end
readStream
Description
Called on client side on join
Definition
readStream(integer streamId, Connection connection)
Arguments
| integer | streamId | streamId |
|---|---|---|
| Connection | connection | connection |
Code
function BaleUnpackEvent:readStream(streamId, connection)
if not connection:getIsServer() then
self.bale = NetworkUtil.readNodeObject(streamId)
end
self:run(connection)
end
run
Description
Run action on receiving side
Definition
run(Connection connection)
Arguments
| Connection | connection | connection |
|---|
Code
function BaleUnpackEvent:run(connection)
self.bale:unpack()
end
writeStream
Description
Called on server side on join
Definition
writeStream(integer streamId, Connection connection)
Arguments
| integer | streamId | streamId |
|---|---|---|
| Connection | connection | connection |
Code
function BaleUnpackEvent:writeStream(streamId, connection)
if connection:getIsServer() then
NetworkUtil.writeNodeObject(streamId, self.bale)
end
end