You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-15 22:56:30 +09:00
masterserver sample work
This commit is contained in:
@@ -23,7 +23,7 @@ namespace MSClient
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
string host = comboBox1.SelectedText;
|
||||
string host = comboBox1.SelectedItem.ToString();
|
||||
Program.RequestNATIntroduction(host);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,12 @@ namespace MSClient
|
||||
|
||||
m_hostList.Add(new IPEndPoint[] { hostInternal, hostExternal });
|
||||
|
||||
m_mainForm.comboBox1.Items.Add(hostExternal.ToString());
|
||||
m_mainForm.comboBox1.Items.Add(hostExternal.Address.ToString());
|
||||
}
|
||||
break;
|
||||
case NetIncomingMessageType.NatIntroductionSuccess:
|
||||
MessageBox.Show("Nat introduction success; I just received a message from " + inc.SenderEndpoint);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,6 +96,7 @@ namespace MSClient
|
||||
// write external address of host to request introduction to
|
||||
IPEndPoint hostEp = new IPEndPoint(NetUtility.Resolve(host), CommonConstants.GameServerPort);
|
||||
om.Write(hostEp);
|
||||
om.Write("randomtoken");
|
||||
|
||||
m_client.SendUnconnectedMessage(om, m_masterServer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user