Script v1.4.4.0
Engine v7.0.0.2
- General
- Entity
- Node
- Scenegraph
- Lighting
- Camera
- Shape
- Particle System
- Physics
- Spline
- Animation
- Overlays
- Sound
- Input
- XML
- Network
- Callbacks
- Text Rendering
- Terrain Detail
- Tire Track
- Editor
- Rendering
- String
- Math
- I3D
- Fillplanes
Foundation Reference
SetPipeStateEvent
DescriptionEvent for pipe stateFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
15 | function SetPipeStateEvent:emptyNew() |
16 | local self = Event:new(SetPipeStateEvent_mt); |
17 | return self; |
18 | end; |
new
DescriptionCreate new instance of eventDefinition
new(table object, integer pipeState)Arguments
table | object | object |
integer | pipeState | pipe state |
24 | function SetPipeStateEvent:new(object, pipeState) |
25 | local self = SetPipeStateEvent:emptyNew() |
26 | self.object = object; |
27 | self.pipeState = pipeState; |
28 | assert(self.pipeState >= 0 and self.pipeState < 8); |
29 | return self; |
30 | end; |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
36 | function SetPipeStateEvent:readStream(streamId, connection) |
37 | self.object = readNetworkNodeObject(streamId); |
38 | self.pipeState = streamReadUIntN(streamId, 3); |
39 | self:run(connection); |
40 | end; |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
46 | function SetPipeStateEvent:writeStream(streamId, connection) |
47 | writeNetworkNodeObject(streamId, self.object); |
48 | streamWriteUIntN(streamId, self.pipeState, 3); |
49 | end; |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
54 | function SetPipeStateEvent:run(connection) |
55 | self.object:setPipeState(self.pipeState, true); |
56 | if not connection:getIsServer() then |
57 | g_server:broadcastEvent(SetPipeStateEvent:new(self.object, self.pipeState), nil, connection, self.object); |
58 | end; |
59 | end; |