Cannot get custom plugin to load on room creation.

Options
I keep getting the default plugin bounced back at me even when specifying which one to load on connection. I cannot load any of the test plugins either, if someone could point me in the right direction it would be a great help.

Photon: Warn: opCreateRoom() failed: Plugin Mismatch requested='BasicsTestsPlugin' got='Default'
Return code is always: 32751

Connection code:
RoomOptions myRoomOptions;
myRoomOptions.setCustomRoomProperties(props);
JVector<JString>pluginsRequired;
pluginsRequired.addElement(JString(L"BasicsTestsPlugin")); // DISPlugin for mine
myRoomOptions.setPlugins(&pluginsRequired);
mpDTc->opCreateRoom(RoomName, myRoomOptions);
Logging::get().logToOutput(L"Creating room " + RoomName);
My Plugin
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Photon.Hive.Plugin;

namespace DT.HivePlugin
{
    public class DISPlugin : PluginBase
    {
        public override string Name
        {
            get
            {
                return "DISPlugin";
            }
        }
    }
}
My plugin Factory:
using System;
using System.Collections.Generic;
using Photon.Hive.Plugin;
using Photon.Hive.Plugin.WebHooks;

namespace DT.HivePlugin
{
    public class PluginFactory : Photon.Hive.Plugin.IPluginFactory
    {

        public IGamePlugin Create(IPluginHost sink, string pluginName, Dictionary<string, string> config, out string errorMsg)
        {
            var plugin = new DISPlugin();

            if (plugin.SetupInstance(sink, config, out errorMsg))
            {
                return  plugin;
            }

            return null;
        }
    }
}
Settings
  <PluginSettings Enabled="true">
    <Plugins>
      <Plugin
              Name="{#PluginName#}"
              Version=""
              AssemblyName="{#PluginAssemblyName#}"
              Type="{#PluginType#}"
              BaseUrl="{#PluginBaseUrl#}"
              IsPersistent="true"
              HasErrorInfo="true"
              PathClose="GameClose"
              PathCreate="GameCreate"
              PathEvent="GameEvent"
              PathGameProperties="GameProperties"
              PathJoin="GameJoin"
              PathLeave="GameLeave"
              PathLoad="GameCreate" />
    </Plugins>
  </PluginSettings>

  <WebRpcSettings Enabled="true">
    <BaseUrl Value="{#PluginBaseUrl#}" />
  </WebRpcSettings>

Property:
  
  <PropertyGroup>
    <PluginName>DISPlugin</PluginName>
    <PluginAssemblyName>DISPlugin.dll</PluginAssemblyName>
    <PluginType>DT.HivePlugin.PluginFactory</PluginType>

    <PluginBaseUrl></PluginBaseUrl>
    
  </PropertyGroup>
Output in config file:
 <PluginSettings Enabled="true">
    <Plugins>
      <Plugin
              Name="DISPlugin"
              Version=""
              AssemblyName="DISPlugin.dll"
              Type="DT.HivePlugin.PluginFactory"
              BaseUrl=""
              IsPersistent="true"
              HasErrorInfo="true"
              PathClose="GameClose"
              PathCreate="GameCreate"
              PathEvent="GameEvent"
              PathGameProperties="GameProperties"
              PathJoin="GameJoin"
              PathLeave="GameLeave"
              PathLoad="GameCreate" />
    </Plugins>
  </PluginSettings>

  <WebRpcSettings Enabled="true">
    <BaseUrl Value="" />
  </WebRpcSettings>
I'm a bit lost.

Comments

  • chvetsov
    Options
    Hi, @eza

    from config point of view, everything is right.
    Could you provide logs?
    also you should know that plugins binaries should be placed at special place either LoadBalancing/Plugins folder or deploy/Plugins folder

    best,
    ilya
  • eza
    Options
    I have post build copies in my plugin just like the test plugin project:

    xcopy /Y /Q "$(TargetDir)*.*" "$(SolutionDir)..\..\deploy\Plugins\DISPlugin\bin\"
    xcopy /Y /Q "$(TargetDir)*.*" "$(SolutionDir)..\LoadBalancing\Plugins\DISPlugin\bin\"

    How do I enable plugin logging? I found the following but I'm not sure it is working.
      <logger name="Photon.Hive.HiveGame.HiveHostGame.Plugin" additivity="false">
        <level value="DEBUG" />
        <appender-ref ref="PluginLogFileAppender" />
      </logger>
    I have two Photons servers I am trying this with, one is my modified one and one is the standard SDK, my modified SDK is no longer logging, gives me an error that there have been no new log files for 12 hours. I cannot seem to get it to create the log files. Maybe I deleted something critical?

    Anyways, logging works on the non-modified server, here is what I get when I try to load a testplugin:

    2019-02-22 11:28:57,653 [1] INFO Photon.LoadBalancing.GameServer.GameApplication - Setup: serverId=8f082cf4-01a4-48ad-ba2e-3ebc0d342f22
    2019-02-22 11:28:57,823 [1] INFO Photon.Hive.Plugin.PluginManager - Plugin configured: name=TestPlugins
    2019-02-22 11:28:57,853 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: BaseUrl=http://photon-forward.webscript.io
    2019-02-22 11:28:57,881 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: IsPersistent=true
    2019-02-22 11:28:57,910 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: HasErrorInfo=true
    2019-02-22 11:28:57,939 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: PathClose=GameClose
    2019-02-22 11:28:57,966 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: PathCreate=GameCreate
    2019-02-22 11:28:57,993 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: PathEvent=GameEvent
    2019-02-22 11:28:58,020 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: PathGameProperties=GameProperties
    2019-02-22 11:28:58,048 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: PathJoin=GameJoin
    2019-02-22 11:28:58,075 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: PathLeave=GameLeave
    2019-02-22 11:28:58,103 [1] INFO Photon.Hive.Plugin.PluginManager - Attribute: PathLoad=GameCreate
    2019-02-22 11:28:58,231 [1] INFO Photon.Hive.Plugin.PluginManager - Loaded Assembly Name=TestPlugins, Version=4.0.28.11221, Culture=, PublicKey token=, Path=C:\Photon\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Plugins\TestPlugins\\bin\TestPlugins.dll
    2019-02-22 11:28:58,259 [1] INFO Photon.Hive.Plugin.PluginManager - Referenced Assembly Name=mscorlib, Version=4.0.0.0, Culture=, PublicKey token=B7-7A-5C-56-19-34-E0-89, Path=
    2019-02-22 11:28:58,287 [1] INFO Photon.Hive.Plugin.PluginManager - Referenced Assembly Name=PhotonHivePlugin, Version=1.0.15.11060, Culture=, PublicKey token=, Path=
    2019-02-22 11:28:58,315 [1] INFO Photon.Hive.Plugin.PluginManager - Referenced Assembly Name=Newtonsoft.Json, Version=6.0.0.0, Culture=, PublicKey token=30-AD-4F-E6-B2-A6-AE-ED, Path=
    2019-02-22 11:28:58,344 [1] INFO Photon.Hive.Plugin.PluginManager - Referenced Assembly Name=PhotonHive, Version=4.0.28.11221, Culture=, PublicKey token=, Path=
    2019-02-22 11:28:58,372 [1] INFO Photon.Hive.Plugin.PluginManager - Referenced Assembly Name=PhotonHive.WebHooksPlugin1.2, Version=4.0.28.11221, Culture=, PublicKey token=, Path=
    2019-02-22 11:28:58,401 [1] INFO Photon.Hive.Plugin.PluginManager - Referenced Assembly Name=nunit.framework, Version=2.6.3.13283, Culture=, PublicKey token=96-D0-9A-1E-B7-F4-4A-77, Path=
    2019-02-22 11:28:58,431 [1] INFO Photon.Hive.Plugin.PluginManager - Plugin Type TestPlugins.PluginFactory from assembly TestPlugins, Version=4.0.28.11221, Culture=neutral, PublicKeyToken=null was successfuly created
    2019-02-22 11:28:58,460 [1] INFO Photon.Hive.Plugin.PluginManager - Plugin manager (version=1.0.15.11060) is setup. type=TestPlugins.PluginFactory;path=C:\Photon\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Plugins\TestPlugins\\bin\TestPlugins.dll;version=1.0.15.11060
    2019-02-22 11:28:59,484 [1] INFO Photon.SocketServer.Diagnostics.HttpQueuePerformanceCounters - HTTP Queue performance counters successfully initialized
    2019-02-22 11:28:59,515 [1] INFO Photon.SocketServer.Diagnostics.HttpQueuePerformanceCounters - Internal HTTP Queue performance counters successfully created
    2019-02-22 11:28:59,556 [1] INFO Photon.LoadBalancing.GameServer.GameApplication - TokenCreator intialized with an expiration of 02:46:40
    2019-02-22 11:28:59,642 [1] WARN Photon.Common.LoadBalancer.LoadShedding.FeedbackControlSystem - Could not initialize Feedback Control System from configuration: Invalid configuration file C:\Photon\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Workload.config. Using default settings... (Could not find file 'C:\Photon\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Workload.config'.)
    2019-02-22 11:28:59,693 [1] INFO Photon.Common.LoadBalancer.ServerStateManager - Watching for application state file in C:\Photon\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\ServerState.txt
    2019-02-22 11:28:59,723 [1] INFO Photon.Common.LoadBalancer.ServerStateManager - Server state is set to online
    2019-02-22 11:28:59,752 [1] INFO Photon.LoadBalancing.GameServer.GameApplication - Initializing master server connection ...
    2019-02-22 11:28:59,810 [1] INFO Photon.LoadBalancing.GameServer.MasterServerConnectionBase - Connecting to master at 127.0.0.1:4520, serverId=8f082cf4-01a4-48ad-ba2e-3ebc0d342f22
    2019-02-22 11:28:59,898 [1] INFO Photon.SocketServer.ApplicationBase - Application start: AppId=Game; AppPath=C:\Photon\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\LoadBalancing\GameServer, Type=Photon.LoadBalancing.GameServer.GameApplication
    2019-02-22 11:28:59,943 [1] INFO Photon.SocketServer.Diagnostics.CounterPublisher - CounterPublisher started publishing ExitGames.Diagnostics.Monitoring.CounterSamplePublisher to ExitGames.Diagnostics.Monitoring.CounterSampleSender
    2019-02-22 11:29:02,635 [10] INFO Photon.LoadBalancing.GameServer.MasterServerConnectionBase - Master connection established: address:127.0.0.1
    2019-02-22 11:29:02,664 [10] INFO Photon.Common.LoadBalancer.ServerStateManager - Server state is set to online
    2019-02-22 11:29:02,703 [10] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - Registering game server with address 134.117.55.90, TCP 4531, UDP 5056, WebSocket 9091, Secure WebSocket 19091, HTTP 80, ServerID 8f082cf4-01a4-48ad-ba2e-3ebc0d342f22, Hostname localhost, IPv6Address
    2019-02-22 11:29:02,952 [12] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - Successfully registered at master server: serverId=8f082cf4-01a4-48ad-ba2e-3ebc0d342f22
    2019-02-22 11:29:14,927 [13] INFO Photon.Hive.Plugin.PluginManager - Plugin successfully created:Type:TestPlugins.PluginFactory, path:C:\Photon\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Plugins\TestPlugins\\bin\TestPlugins.dll
    2019-02-22 11:29:15,011 [13] WARN Photon.Hive.HiveHostGame - Game 'Foyer' userId '91a0569f-a088-4c44-b0ed-f0c5f90e3f51' failed to create game. msg:Plugin Mismatch requested='BasicsTestsPlugin' got='Default' -- peer:GameClientPeer: PID 1, IsConnected: True, IsDisposed: False, Last Activity: Operation 227 at UTC 2019-02-22 4:29:14 PM in Room , IP 134.117.55.94:58792,


  • eza
    Options
    OK I solved the logging issue. Switching between server SDKs leaves some lingering stuff and I was not shutting it down properly.

    With my server, with the TestPlugins removed and my custom plugin added this is the log:
    2019-02-22 12:32:21,491 [1] INFO  Photon.LoadBalancing.GameServer.GameApplication - Setup: serverId=a5ae7faa-0b60-4963-a4ef-f38a075951ac
    2019-02-22 12:32:21,647 [1] INFO  Photon.Hive.Plugin.PluginManager - Plugin configured: name=DISPlugin
    2019-02-22 12:32:21,676 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: BaseUrl=
    2019-02-22 12:32:21,705 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: IsPersistent=true
    2019-02-22 12:32:21,733 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: HasErrorInfo=true
    2019-02-22 12:32:21,762 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: PathClose=GameClose
    2019-02-22 12:32:21,792 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: PathCreate=GameCreate
    2019-02-22 12:32:21,820 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: PathEvent=GameEvent
    2019-02-22 12:32:21,848 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: PathGameProperties=GameProperties
    2019-02-22 12:32:21,875 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: PathJoin=GameJoin
    2019-02-22 12:32:21,904 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: PathLeave=GameLeave
    2019-02-22 12:32:21,932 [1] INFO  Photon.Hive.Plugin.PluginManager - 	Attribute: PathLoad=GameCreate
    2019-02-22 12:32:22,061 [1] INFO  Photon.Hive.Plugin.PluginManager - Loaded Assembly Name=DISPlugin, Version=0.0.0.0, Culture=, PublicKey token=, Path=C:\Projects\DigitalTwin\DT-Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Plugins\DISPlugin\\bin\DISPlugin.dll
    2019-02-22 12:32:22,089 [1] INFO  Photon.Hive.Plugin.PluginManager - Referenced Assembly Name=mscorlib, Version=4.0.0.0, Culture=, PublicKey token=B7-7A-5C-56-19-34-E0-89, Path=
    2019-02-22 12:32:22,116 [1] INFO  Photon.Hive.Plugin.PluginManager - Referenced Assembly Name=PhotonHivePlugin, Version=1.0.15.11060, Culture=, PublicKey token=, Path=
    2019-02-22 12:32:22,146 [1] INFO  Photon.Hive.Plugin.PluginManager - Plugin Type DT.HivePlugin.PluginFactory from assembly DISPlugin, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null was successfuly created
    2019-02-22 12:32:22,174 [1] INFO  Photon.Hive.Plugin.PluginManager - Plugin manager (version=1.0.15.11060) is setup. type=DT.HivePlugin.PluginFactory;path=C:\Projects\DigitalTwin\DT-Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Plugins\DISPlugin\\bin\DISPlugin.dll;version=1.0.15.11060
    2019-02-22 12:32:23,048 [1] INFO  Photon.SocketServer.Diagnostics.HttpQueuePerformanceCounters - HTTP Queue performance counters successfully initialized
    2019-02-22 12:32:23,079 [1] INFO  Photon.SocketServer.Diagnostics.HttpQueuePerformanceCounters - Internal HTTP Queue performance counters successfully created
    2019-02-22 12:32:23,118 [1] INFO  Photon.LoadBalancing.GameServer.GameApplication - TokenCreator intialized with an expiration of 02:46:40
    2019-02-22 12:32:23,201 [1] WARN  Photon.Common.LoadBalancer.LoadShedding.FeedbackControlSystem - Could not initialize Feedback Control System from configuration: Invalid configuration file C:\Projects\DigitalTwin\DT-Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Workload.config. Using default settings... (Could not find file 'C:\Projects\DigitalTwin\DT-Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Workload.config'.)
    2019-02-22 12:32:23,250 [1] INFO  Photon.Common.LoadBalancer.ServerStateManager - Watching for application state file in C:\Projects\DigitalTwin\DT-Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\ServerState.txt
    2019-02-22 12:32:23,282 [1] INFO  Photon.Common.LoadBalancer.ServerStateManager - Server state is set to online
    2019-02-22 12:32:23,313 [1] INFO  Photon.LoadBalancing.GameServer.GameApplication - Initializing master server connection ...
    2019-02-22 12:32:23,369 [1] INFO  Photon.LoadBalancing.GameServer.MasterServerConnectionBase - Connecting to master at 127.0.0.1:4520, serverId=a5ae7faa-0b60-4963-a4ef-f38a075951ac
    2019-02-22 12:32:23,456 [1] INFO  Photon.SocketServer.ApplicationBase - Application start: AppId=Game; AppPath=C:\Projects\DigitalTwin\DT-Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\LoadBalancing\GameServer, Type=Photon.LoadBalancing.GameServer.GameApplication 
    2019-02-22 12:32:23,501 [1] INFO  Photon.SocketServer.Diagnostics.CounterPublisher - CounterPublisher started publishing ExitGames.Diagnostics.Monitoring.CounterSamplePublisher to ExitGames.Diagnostics.Monitoring.CounterSampleSender
    2019-02-22 12:32:26,224 [12] INFO  Photon.LoadBalancing.GameServer.MasterServerConnectionBase - Master connection established: address:127.0.0.1
    2019-02-22 12:32:26,260 [12] INFO  Photon.Common.LoadBalancer.ServerStateManager - Server state is set to online
    2019-02-22 12:32:26,298 [12] INFO  Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - Registering game server with address 127.0.0.1, TCP 4531, UDP 5056, WebSocket 9091, Secure WebSocket 19091, HTTP 80, ServerID a5ae7faa-0b60-4963-a4ef-f38a075951ac, Hostname localhost, IPv6Address 
    2019-02-22 12:32:26,534 [10] INFO  Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - Successfully registered at master server: serverId=a5ae7faa-0b60-4963-a4ef-f38a075951ac
    Now I getting a " Photon: Connection failed with error 1040 " error. Not sure if the plugin load is failing and the connect is timing out.


  • eza
    Options
    This issue was again from not turning the service on and off properly. Stopping the service, building the plugin, and starting the service solved the problem.