本文整理汇总了C#中PeerBase.SendEvent方法的典型用法代码示例。如果您正苦于以下问题:C# PeerBase.SendEvent方法的具体用法?C# PeerBase.SendEvent怎么用?C# PeerBase.SendEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PeerBase
的用法示例。
在下文中一共展示了PeerBase.SendEvent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PublishCounterData
private static void PublishCounterData(PeerBase peer, ICollection<CounterSampleMessage> counterSamples)
{
IEnumerable<CounterAggregation> aggregations = CounterAggregation.Create(counterSamples);
foreach (CounterAggregation aggregation in aggregations)
{
var @event = new CounterDataEvent
{
Name = aggregation.CounterName,
TimeStamps = aggregation.Timestamps.ToArray(),
Values = aggregation.Values.ToArray()
};
var eventData = new EventData((byte)EventCode.CounterData, @event);
// already in right fiber, we would use peer.SendEvent otherwise
peer.SendEvent(eventData, new SendParameters { ChannelId = Settings.DiagnosticsEventChannel });
}
}
示例2: RadarChannel_OnItemEventMessage
private static void RadarChannel_OnItemEventMessage(PeerBase peer, ItemEventMessage message)
{
// already in right fiber, we would use peer.SendEvent otherwise
peer.SendEvent(message.EventData, message.SendParameters);
}
示例3: PublishStatisticEvent
private void PublishStatisticEvent(PeerBase peer)
{
var lobbyList = this.lobbyFactory.GetLobbies(this.maxLobbyStatsCount);
var lobbyStats = LobbyListToLobbyStatsData(lobbyList);
var eventData = new EventData((byte)EventCode.LobbyStats, lobbyStats);
peer.SendEvent(eventData, new SendParameters());
}
示例4: PublishGameList
private void PublishGameList(PeerBase peer)
{
var e = new GameListEvent { Data = this.GameList.GetAllGames(MasterServerSettings.Default.MaxGamesInLobbyList) };
var eventData = new EventData((byte)EventCode.GameList, e);
peer.SendEvent(eventData, new SendParameters());
}