0

什么时候发生 Lidgren.Network.NetException:“此消息已发送!使用 NetPeer.SendMessage() 有效地发送多个收件人”?

                                else if (CounfOfPlayers == 1)
                            {
                                Player2Connection = inc.SenderConnection;
                                Console.WriteLine(Player2Connection.RemoteEndPoint.ToString());
                                CounfOfPlayers++;
                                Console.WriteLine("Accepted second player");
                                outmsg.Write((byte)PacketType.RDY);
                                Server.SendMessage(outmsg, Player1Connection, NetDeliveryMethod.ReliableOrdered);
                                Server.SendMessage(outmsg, Player2Connection, NetDeliveryMethod.ReliableOrdered);
                            }
4

1 回答 1

0

您只能发送NetOutgoingMessage一次。

您应该使用NetClient.CreateMessage()根据this创建每个实例。

于 2018-05-19T17:17:17.027 回答