PunctureSyncRequestEvent = {}
local PunctureSyncRequestEvent_mt = Class(PunctureSyncRequestEvent, Event)
InitEventClass(PunctureSyncRequestEvent, "MudSystemPhysics.PunctureSyncRequestEvent")

function PunctureSyncRequestEvent.emptyNew()
    return Event.new(PunctureSyncRequestEvent_mt)
end

function PunctureSyncRequestEvent.new()
    return PunctureSyncRequestEvent.emptyNew()
end

function PunctureSyncRequestEvent:readStream(streamId, connection)
    self:run(connection)
end

function PunctureSyncRequestEvent:writeStream(streamId, connection)
end

function PunctureSyncRequestEvent:run(connection)
    if g_server ~= nil and connection ~= nil and not connection:getIsServer()
        and PunctureSystem ~= nil then
        PunctureSystem:sendFullState(connection)
    end
end

function PunctureSyncRequestEvent.send()
    if g_server == nil and g_client ~= nil and g_client:getServerConnection() ~= nil then
        g_client:getServerConnection():sendEvent(PunctureSyncRequestEvent.new())
    end
end

