Spoofing events: send data using "CustomData", not "parameters"
This question is related to this question.
I'm trying to spoof the PUN-event with event-code 1 (UpdateNestedObjectEvent) using a photon server/plugin.
This page describes really well how to create/spoof events.
Photon.Hive.Plugin.IPluginHist#BroadcastEvent(..., Dictionary<byte, object> data, ...) allows you to spoof an event, the data needs to be supplied in the form of a Dictionary<byte, object>.
The problem:
Dictionary<byte, object> data is received via "parameters" in ExitGames.Client.Photon.EventData while a non-spoofed event uses "CustomData".
Is there any way to force the use of/edit "CustomData" in EventData?
I know that this problem can be solved by changing code in either:
NestedObjectRoot#OnEvent(EventData eventData)
NestedObjectRoot#LateUpdate()
to also support my spoofed packets with their data in "parameters".
But is far from ideal as it is not really spoofing. I just send 2 different types of events under the same event-code.
I'm trying to spoof the PUN-event with event-code 1 (UpdateNestedObjectEvent) using a photon server/plugin.
This page describes really well how to create/spoof events.
Photon.Hive.Plugin.IPluginHist#BroadcastEvent(..., Dictionary<byte, object> data, ...) allows you to spoof an event, the data needs to be supplied in the form of a Dictionary<byte, object>.
The problem:
Dictionary<byte, object> data is received via "parameters" in ExitGames.Client.Photon.EventData while a non-spoofed event uses "CustomData".
Is there any way to force the use of/edit "CustomData" in EventData?
I know that this problem can be solved by changing code in either:
NestedObjectRoot#OnEvent(EventData eventData)
NestedObjectRoot#LateUpdate()
to also support my spoofed packets with their data in "parameters".
But is far from ideal as it is not really spoofing. I just send 2 different types of events under the same event-code.
0
Best Answer
-
Hey @ReplayMaker,
not sure I understand the use of the word "spoofing" correctly.
anyway, I think you missed this which is also available from the page you linked, here, see blue box.
And one question: UpdateNestedObjectEvent (1) is your custom type right?1
Answers
-
Hey @ReplayMaker,
not sure I understand the use of the word "spoofing" correctly.
anyway, I think you missed this which is also available from the page you linked, here, see blue box.
And one question: UpdateNestedObjectEvent (1) is your custom type right?1 -
With spoofing I mean sending an event from the server while pretending it is from a player.
I read that part, but it somehow completely missed it. But this is exactly what I need, thanks!
And yeah got a bit confused with what was my own code and what was photon's code, UpdateNestedObjectEvent is my own custom type.1