Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- Player
- Shop
- Sounds
- Specializations
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- streamGetNumOfUnreadBits
- streamGetReadOffset
- streamGetWriteOffset
- streamReadBool
- streamReadFloat32
- streamReadInt16
- streamReadInt32
- streamReadInt8
- streamReadIntN
- streamReadManualTimestamp
- streamReadString
- streamReadUInt16
- streamReadUInt8
- streamReadUIntN
- streamSetReadOffset
- streamSetWriteOffset
- streamWriteBool
- streamWriteFloat32
- streamWriteInt16
- streamWriteInt32
- streamWriteInt8
- streamWriteIntN
- streamWriteManualTimestamp
- streamWriteStream
- streamWriteString
- streamWriteUInt16
- streamWriteUInt8
- streamWriteUIntN
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
FillUnitUnloadEvent
DescriptionEvent for turned on stateParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function FillUnitUnloadEvent:emptyNew() |
14 | local self = Event:new(FillUnitUnloadEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object)Arguments
table | object | object |
21 | function FillUnitUnloadEvent:new(object) |
22 | local self = FillUnitUnloadEvent:emptyNew() |
23 | self.object = object |
24 | return self |
25 | end |
newServerToClient
DescriptionDefinitionnewServerToClient()Code
29 | function FillUnitUnloadEvent:newServerToClient() |
30 | local self = FillUnitUnloadEvent:emptyNew() |
31 | return self |
32 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
38 | function FillUnitUnloadEvent:readStream(streamId, connection) |
39 | if not connection:getIsServer() then |
40 | self.object = NetworkUtil.readNodeObject(streamId) |
41 | end |
42 | self:run(connection) |
43 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
58 | function FillUnitUnloadEvent:run(connection) |
59 | if not connection:getIsServer() then |
60 | if self.object ~= nil then |
61 | local success = self.object:unloadFillUnits(true) |
62 | if not success then |
63 | connection:sendEvent(FillUnitUnloadEvent:newServerToClient()) |
64 | end |
65 | end |
66 | else |
67 | g_currentMission:addIngameNotification(FSBaseMission.INGAME_NOTIFICATION_INFO, g_i18n:getText("fillUnit_unload_nospace")) |
68 | end |
69 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
49 | function FillUnitUnloadEvent:writeStream(streamId, connection) |
50 | if connection:getIsServer() then |
51 | NetworkUtil.writeNodeObject(streamId, self.object) |
52 | end |
53 | end |