Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- getMaterialCustomShaderFilename
- getMaterialCustomShaderVariation
- getMaterialDiffuseMapFilename
- getMaterialDiffuseMapHasAlpha
- getMaterialEmissiveMapFilename
- getMaterialEmissiveMapHasAlpha
- getMaterialGlossMapFilename
- getMaterialHasRefractionMap
- getMaterialIsAlphaBlended
- getMaterialIsAlphaTested
- getMaterialNormalMapFilename
- getMaterialNormalMapFormat
- getMaterialReflectionMapScaling
- setMaterialCustomMapFromFile
- setMaterialCustomShaderVariation
- setMaterialDiffuseMapFromFile
- setMaterialGlossMapFromFile
- setMaterialNormalMapFromFile
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
ProductionPointProductionStateEvent
DescriptionEvent for production point production state changeParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function ProductionPointProductionStateEvent.emptyNew() |
14 | local self = Event.new(ProductionPointProductionStateEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new()Code
20 | function ProductionPointProductionStateEvent.new(productionPoint, productionId, isEnabled) |
21 | local self = ProductionPointProductionStateEvent.emptyNew() |
22 | self.productionPoint = productionPoint |
23 | self.productionId = productionId |
24 | self.isEnabled = isEnabled |
25 | return self |
26 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream()Code
30 | function ProductionPointProductionStateEvent:readStream(streamId, connection) |
31 | self.productionPoint = NetworkUtil.readNodeObject(streamId) |
32 | self.productionId = streamReadString(streamId) |
33 | self.isEnabled = streamReadBool(streamId) |
34 | self:run(connection) |
35 | end |
run
DescriptionRun action on receiving sideDefinition
run()Code
47 | function ProductionPointProductionStateEvent:run(connection) |
48 | if not connection:getIsServer() then |
49 | g_server:broadcastEvent(self, false, connection) |
50 | end |
51 | |
52 | if self.productionPoint ~= nil then |
53 | self.productionPoint:setProductionState(self.productionId, self.isEnabled, true) |
54 | end |
55 | end |
sendEvent
DescriptionBroadcast event from server to all clients, if called on client call function on server and broadcast it to all clientsDefinition
sendEvent()Code
59 | function ProductionPointProductionStateEvent.sendEvent(productionPoint, productionId, isEnabled, noEventSend) |
60 | if noEventSend == nil or noEventSend == false then |
61 | if g_server ~= nil then |
62 | g_server:broadcastEvent(ProductionPointProductionStateEvent.new(productionPoint, productionId, isEnabled)) |
63 | else |
64 | g_client:getServerConnection():sendEvent(ProductionPointProductionStateEvent.new(productionPoint, productionId, isEnabled)) |
65 | end |
66 | end |
67 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream()Code
39 | function ProductionPointProductionStateEvent:writeStream(streamId, connection) |
40 | NetworkUtil.writeNodeObject(streamId, self.productionPoint) |
41 | streamWriteString(streamId, self.productionId) |
42 | streamWriteBool(streamId, self.isEnabled) |
43 | end |