zoukankan      html  css  js  c++  java
  • 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>

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

  • 相关阅读:
    bzoj3293 分金币
    考前模板整理
    CF785D Anton and School
    容斥法解决错排问题
    CF1248F Catowice City
    CF1248E Queue in the Train
    CF1244F Chips
    CF1244C The Football Season
    Noip2016Day1T2 天天爱跑步
    Noip2015Day2T3 运输计划
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11126775.html
Copyright © 2011-2022 走看看