SuperSocket命令程序集定义

是的,SuperSocket是用反射来查找哪些公开的类实现了基本的命令接口,但是它只在你的AppServer类定义的程序集中查找。

举例来说, 你的 AppServer 定义在程序集 GameServer.dll 中, 但是你的 ADD 命令是定义在程序集 BasicModules.dll 中:

GameServer.dll

    + MyGameServer.cs

BasicModules.dll

    + ADD.cs

默认的, 命令 "ADD" 将不会被加载到游戏服务器实例。 如果你想要加载该命令, 你如要在配置中添加程序集 BasicModules.dll 到命令程序集列表之中:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

    <configSections>

        <section name="superSocket" type="SuperSocket.SocketEngine.Configuration.SocketServiceConfig, SuperSocket.SocketEngine"/>

    </configSections>

    <appSettings>

        <add key="ServiceName" value="BroardcastService"/>

    </appSettings>

    <superSocket>

        <servers>

            <server name="SampleServer"

                    serverType="GameServer.MyGameServer, GameServer"

                    ip="Any" port="2012">

              <commandAssemblies>

                <add assembly="BasicModules"></add>

              </commandAssemblies>

            </server>

        </servers>

    </superSocket>

    <startup>

        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />

    </startup>

</configuration>

当然你也可以在配置中添加多个命令程序集。

转载于:https://www.cnblogs.com/fanweisheng/p/11126775.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值