本文整理汇总了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");
}
示例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);
}