コード例 #1
0
        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);
        }
コード例 #2
0
        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;
                }
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 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);
 }