void AlertVerbose(string alertFormat, IPEndPoint endpoint, MyEventEnum eventType) { var player = MyMultiplayerPeers.Static[endpoint]; string playerInfo = String.Format(" UserId: {0}, GameUserId: {1}, EndPoint: {2}", player.UserId, player.GameId, player.EndPoint); MyTrace.Send(TraceWindow.MultiplayerAlerts, eventType.ToString() + ": " + alertFormat + playerInfo); }
private void LogMessage <T>(MyEventEnum eventType, T inst) where T : struct, IMyEvent { MyLoggingTypeEnum loggingType; if (m_loggedMessages.TryGetValue((int)eventType, out loggingType)) { switch (loggingType) { case MyLoggingTypeEnum.NONE: break; case MyLoggingTypeEnum.NAME: MyTrace.Send(TraceWindow.Multiplayer, "Received event " + eventType.ToString() + ", from " + (inst.SenderEndpoint != null ? inst.SenderEndpoint.ToString() : "null")); break; case MyLoggingTypeEnum.FULL: MyTrace.Send(TraceWindow.Multiplayer, inst.ToString()); break; default: break; } } }
void AlertVerbose(string alertFormat, IPEndPoint endpoint, MyEventEnum eventType) { var player = Peers.Players.FirstOrDefault(p => p.Connection.RemoteEndpoint == endpoint); if (player != null) { string playerInfo = String.Format(" UserId: {0}, GameUserId: {1}, EndPoint: {2}", player.UserId, player.PlayerId, player.Connection.RemoteEndpoint); MyTrace.Send(TraceWindow.MultiplayerAlerts, eventType.ToString() + ": " + alertFormat + playerInfo); } }