You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 07:06:30 +09:00
Changed return value of SendMessage to bool for consistency
Added a number of verbose debug messages (to be removed later)
This commit is contained in:
@@ -185,6 +185,8 @@ namespace Lidgren.Network
|
||||
if (unfin <= 0)
|
||||
m_owner.Recycle(send.Message); // every sent has been acked; free the message
|
||||
|
||||
m_owner.LogVerbose("Received ack for " + tp + "#" + seqNr);
|
||||
|
||||
m_unackedSends.Remove(send);
|
||||
|
||||
// TODO: recycle send
|
||||
|
||||
@@ -176,6 +176,7 @@ namespace Lidgren.Network
|
||||
{
|
||||
if (now > send.NextResend)
|
||||
{
|
||||
m_owner.LogVerbose("Resending " + send);
|
||||
m_unsentMessages.EnqueueFirst(send);
|
||||
send.SetNextResend(this);
|
||||
}
|
||||
@@ -356,6 +357,7 @@ namespace Lidgren.Network
|
||||
{
|
||||
m_owner.VerifyNetworkThread();
|
||||
|
||||
m_owner.LogVerbose("Received over wire: " + mtp + "#" + channelSequenceNumber);
|
||||
try
|
||||
{
|
||||
NetDeliveryMethod ndm = NetPeer.GetDeliveryMethod(mtp);
|
||||
@@ -549,7 +551,7 @@ namespace Lidgren.Network
|
||||
im.m_senderEndpoint = m_remoteEndpoint;
|
||||
}
|
||||
|
||||
// m_owner.LogVerbose("Releasing " + im);
|
||||
m_owner.LogVerbose("Releasing " + im);
|
||||
m_owner.ReleaseMessage(im);
|
||||
}
|
||||
|
||||
@@ -588,6 +590,8 @@ namespace Lidgren.Network
|
||||
info.Received[nr] = true;
|
||||
info.TotalReceived++;
|
||||
|
||||
m_owner.LogVerbose("Got fragment " + nr + "/" + info.TotalFragmentCount + " (num received: " + info.TotalReceived + ")");
|
||||
|
||||
return info.TotalReceived >= info.TotalFragmentCount;
|
||||
}
|
||||
|
||||
@@ -649,9 +653,9 @@ namespace Lidgren.Network
|
||||
m_unsentMessages.Enqueue(send);
|
||||
}
|
||||
|
||||
public void SendMessage(NetOutgoingMessage msg, NetDeliveryMethod method)
|
||||
public bool SendMessage(NetOutgoingMessage msg, NetDeliveryMethod method)
|
||||
{
|
||||
SendMessage(msg, method, 0);
|
||||
return SendMessage(msg, method, 0);
|
||||
}
|
||||
|
||||
public bool SendMessage(NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel)
|
||||
|
||||
@@ -46,5 +46,10 @@ namespace Lidgren.Network
|
||||
|
||||
NextResend = NetTime.Now + totalDelay;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "[NetSending " + MessageType + "#" + SequenceNumber + " NumSends: " + NumSends + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace ImageServer
|
||||
|
||||
Server = new NetServer(config);
|
||||
|
||||
System.IO.File.Delete("C:\\tmp\\clientlog.txt");
|
||||
System.IO.File.Delete("C:\\tmp\\serverlog.txt");
|
||||
|
||||
Application.Idle += new EventHandler(AppLoop);
|
||||
Application.Run(MainForm);
|
||||
|
||||
Reference in New Issue
Block a user