Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
1 | -- Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved. |
2 | |
3 | ChainsawCutEvent = {}; |
4 | ChainsawCutEvent_mt = Class(ChainsawCutEvent, Event); |
5 | |
6 | InitStaticEventClass(ChainsawCutEvent, "ChainsawCutEvent", EventIds.EVENT_CHAINSAW_CUT); |
7 | |
8 | function ChainsawCutEvent:emptyNew() |
9 | local self = Event:new(ChainsawCutEvent_mt); |
10 | return self; |
11 | end; |
12 | |
13 | function ChainsawCutEvent:new(splitShapeId, x,y,z, nx,ny,nz, yx,yy,yz, cutSizeY, cutSizeZ) |
14 | local self = ChainsawCutEvent:emptyNew() |
15 | self.splitShapeId = splitShapeId; |
16 | self.x,self.y,self.z = x,y,z; |
17 | self.nx,self.ny,self.nz = nx,ny,nz; |
18 | self.yx,self.yy,self.yz = yx,yy,yz; |
19 | self.cutSizeY,self.cutSizeZ = cutSizeY,cutSizeZ; |
20 | return self; |
21 | end; |
22 | |
23 | function ChainsawCutEvent:readStream(streamId, connection) |
24 | if not connection:getIsServer() then |
25 | local splitShapeId = readSplitShapeIdFromStream(streamId); |
26 | local x = streamReadFloat32(streamId); |
27 | local y = streamReadFloat32(streamId); |
28 | local z = streamReadFloat32(streamId); |
29 | local nx = streamReadFloat32(streamId); |
30 | local ny = streamReadFloat32(streamId); |
31 | local nz = streamReadFloat32(streamId); |
32 | local yx = streamReadFloat32(streamId); |
33 | local yy = streamReadFloat32(streamId); |
34 | local yz = streamReadFloat32(streamId); |
35 | local cutSizeY = streamReadFloat32(streamId); |
36 | local cutSizeZ = streamReadFloat32(streamId); |
37 | if splitShapeId ~= 0 then |
38 | ChainsawUtil.cutSplitShape(splitShapeId, x,y,z, nx,ny,nz, yx,yy,yz, cutSizeY, cutSizeZ); |
39 | end |
40 | end |
41 | end; |
42 | |
43 | function ChainsawCutEvent:writeStream(streamId, connection) |
44 | if connection:getIsServer() then |
45 | writeSplitShapeIdToStream(streamId, self.splitShapeId); |
46 | streamWriteFloat32(streamId, self.x); |
47 | streamWriteFloat32(streamId, self.y); |
48 | streamWriteFloat32(streamId, self.z); |
49 | streamWriteFloat32(streamId, self.nx); |
50 | streamWriteFloat32(streamId, self.ny); |
51 | streamWriteFloat32(streamId, self.nz); |
52 | streamWriteFloat32(streamId, self.yx); |
53 | streamWriteFloat32(streamId, self.yy); |
54 | streamWriteFloat32(streamId, self.yz); |
55 | streamWriteFloat32(streamId, self.cutSizeY); |
56 | streamWriteFloat32(streamId, self.cutSizeZ); |
57 | end |
58 | end; |
59 | |
60 | function ChainsawCutEvent:run(connection) |
61 | print("Error: ChainsawCutEvent is not allowed to be executed on a local client"); |
62 | end;
|
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de