当前位置: 首页>>代码示例>>C#>>正文


C# RemoteClient.connect方法代码示例

本文整理汇总了C#中RemoteClient.connect方法的典型用法代码示例。如果您正苦于以下问题:C# RemoteClient.connect方法的具体用法?C# RemoteClient.connect怎么用?C# RemoteClient.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RemoteClient的用法示例。


在下文中一共展示了RemoteClient.connect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConnectionState

 public ConnectionState()
 {
     network_client = new DFHack.RemoteClient(df_network_out);
     is_connected = network_client.connect();
     if (!is_connected) return;
     net_block_request = new RemoteFortressReader.BlockRequest();
     MaterialListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MaterialList>();
     MaterialListCall.bind(network_client, "GetMaterialList", "RemoteFortressReader");
     TiletypeListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.TiletypeList>();
     TiletypeListCall.bind(network_client, "GetTiletypeList", "RemoteFortressReader");
     BlockListCall = new RemoteFunction<RemoteFortressReader.BlockRequest, RemoteFortressReader.BlockList>();
     BlockListCall.bind(network_client, "GetBlockList", "RemoteFortressReader");
     HashCheckCall = new RemoteFunction<dfproto.EmptyMessage>();
     HashCheckCall.bind(network_client, "CheckHashes", "RemoteFortressReader");
     UnitListCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.UnitList>();
     UnitListCall.bind(network_client, "GetUnitList", "RemoteFortressReader");
     ViewInfoCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.ViewInfo>();
     ViewInfoCall.bind(network_client, "GetViewInfo", "RemoteFortressReader");
     MapInfoCall = new RemoteFunction<dfproto.EmptyMessage, RemoteFortressReader.MapInfo>();
     MapInfoCall.bind(network_client, "GetMapInfo", "RemoteFortressReader");
     MapResetCall = new RemoteFunction<dfproto.EmptyMessage>();
     MapResetCall.bind(network_client, "ResetMapHashes", "RemoteFortressReader");
 }
开发者ID:Chronovore,项目名称:armok-vision,代码行数:23,代码来源:ConnectionState.cs

示例2: ConnectAndInit

    // Connect to DF, fetch initial data, start things running
    void ConnectAndInit()
    {
        blockRequest = new RemoteFortressReader.BlockRequest();
        blockRequest.blocks_needed = BlocksToFetch;
        pendingBlocks = new Util.UniqueQueue<DFCoord, RemoteFortressReader.MapBlock>();
        networkClient = new DFHack.RemoteClient(dfNetworkOut);
        bool success = networkClient.connect();
        if (!success)
        {
            networkClient.disconnect();
            networkClient = null;
            throw new UnityException("DF Connection Failure");
        }
        BindMethods();
        FetchUnchangingInfo();

        networkClient.suspend_game();
        viewInfoCall.execute(null, out _netViewInfo);
        unitListCall.execute(null, out _netUnitList);
        worldMapCall.execute(null, out _netWorldMap);
        regionMapCall.execute(null, out _netRegionMaps);
        networkClient.resume_game();

        mapResetCall.execute();
        InitStatics();

        foreach (System.Action callback in connectionCallbacks)
        {
            callback.Invoke();
        }
        connectionCallbacks.Clear();
        connectionMode = ConnectionMode.GetConnectionMode(this, RunOnAlternateThread);
    }
开发者ID:christopherbauer,项目名称:armok-vision,代码行数:34,代码来源:DFConnection.cs


注:本文中的RemoteClient.connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。