Plugin and (IRaiseEventCallInfo.data) What kind of data?
Options
I am starting my study on creating plugins, and I came across this question.
I am following the example ready "BanTestPlugin":
I searched the documentation and own sources files available, but just i can not find information about this.
Please. Please. Can someone enlighten me this question?
I am following the example ready "BanTestPlugin":
base.OnRaiseEvent(info); var data = (Hashtable) info.Request.Data; //------> ????????What are the variables that this table is receiving? if ((bool) data[0]) { //lets ban this.PluginHost.RemoveActor((int)data[1], RemoveActorReason.Banned, "bb"); }var data = (Hashtable) info.Request.Data -> What are the variables that this table is receiving?
I searched the documentation and own sources files available, but just i can not find information about this.
Please. Please. Can someone enlighten me this question?
0
Best Answers
-
Hi @neoneper,
Those Plugin Tests or Test Plugins were intended for internal use so we did not think about writing docs about them.
To answer your question by interpreting the code only:
key: value
0: boolean, no idea about its purpose other than when it's true then plugin can remove actor
1: ActorNr of actor to remove/ban
Think of this a basic simple custom event.
@chvetsov may have more info regarding this.5 -
for more info you may take a look at BanPlayerTest() in LBApiTestsImpl.cs. BanPlugin shows just what you need to call to ban user. and it was done for tests. so, you should not attach to question: why it is like this? what is the sacred sense of this code? You should understand that there is nothing special with it. we just did this way for test. in real live code you will need something else5
-
Now I understand. These tests are only examples of how to proceed on the side of the plugin, but it's up to me to develop the logic of the event they will be receiving.
In the case of BanTest, I made my own modifications, creating an appropriate hasTable with variables that are functional for me.
I apologize for asking so simple. The photon content is quite extensive, I'm with quite stuff to learn here, and sometimes my mind bug.. lol.
In any case, thank you for the attention you have given me. I hope soon be contributing to the community.6
Answers
-
Hi @neoneper,
Those Plugin Tests or Test Plugins were intended for internal use so we did not think about writing docs about them.
To answer your question by interpreting the code only:
key: value
0: boolean, no idea about its purpose other than when it's true then plugin can remove actor
1: ActorNr of actor to remove/ban
Think of this a basic simple custom event.
@chvetsov may have more info regarding this.5 -
for more info you may take a look at BanPlayerTest() in LBApiTestsImpl.cs. BanPlugin shows just what you need to call to ban user. and it was done for tests. so, you should not attach to question: why it is like this? what is the sacred sense of this code? You should understand that there is nothing special with it. we just did this way for test. in real live code you will need something else5
-
Now I understand. These tests are only examples of how to proceed on the side of the plugin, but it's up to me to develop the logic of the event they will be receiving.
In the case of BanTest, I made my own modifications, creating an appropriate hasTable with variables that are functional for me.
I apologize for asking so simple. The photon content is quite extensive, I'm with quite stuff to learn here, and sometimes my mind bug.. lol.
In any case, thank you for the attention you have given me. I hope soon be contributing to the community.6 -
Where can i get that bantest plugin?0
-
Hi @rizwanbabar,
Thank you for choosing Photon!
We forgot to add it to the Plugins SDK but it's under "src-server\Plugins\TestPlugins" in the Photon Server SDK.0