[問題] 可以幫我看看這段程式碼嗎?
我現在在寫一段連線遊戲的小程式
書上的例子有一段不是很清楚她在幹嘛
private void Listen(){
byte[] byteReceieve = new byte[1024];
byte[] byteSend = new byte[1024];
EndPoint oldEP = ClientSocket.RemoteEndPoint;
Thread tempthread = _thread1;
int ii, six = 0, c_conn = 0, disconnect = 0, Disconnect = 0, Show = 0,
update = 0;
string strAll;
while (true){
try{
ii = ClientSocket.ReceiveFrom(byteReceieve, 0, byteReceieve.Length,
SocketFlags.None, ref oldEP);
strAll = Encoding.Unicode.GetString(byteReceieve, 0, ii);
if (strAll == "c_conn") c_conn = 1;
else if (strAll == "Show") Show = 1;
else if (strAll == "disconnect") disconnect = 1;
else if (strAll == "Disconnect") Disconnect = 1;
else if (strAll == "six") six = 1;
if ((c_conn == 1) && (strAll != "") && (strAll != "c_conn") &&
(strAll != "Show") && (strAll != "Disconnect") &&
(strAll != "disconnect") && (strAll != "score")){
c_conn = 0;
Show_listBox_3();
Show_label4(strAll);
}
if ((Show == 1) && (strAll != "") && (strAll != "Show") &&
(strAll != "disconnect") && (strAll != "Disconnect") &&
(strAll != "c_conn") && (strAll != "score")){
Show = 0;
Show_listBox_1(strAll);
}
if ((disconnect == 1) && (strAll != "") && (strAll != "disconnect") &&
(strAll != "Disconnect") && (strAll != "Show") &&
(strAll != "c_conn") && (strAll != "score")){
disconnect = 0;
Show_label4(strAll);
}
if ((Disconnect == 1) && (strAll != "") && (strAll != "Disconnect") &&
(strAll != "score") && (strAll != "disconnect") &&
(strAll != "Show") && (strAll != "c_conn") ){
Disconnect = 0;
Show_listBox_2(strAll);
}
if ((six == 1) && (strAll != "") && (strAll != "disconnect") &&
(strAll != "Disconnect") && (strAll != "Show") &&
(strAll != "c_conn") && (strAll != "six")){
six = 0;
f2.NAMESCORE = strAll;
}
}
catch{
;
}
}
}
煩請各位教教我><"
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.251.196.73
→
05/19 02:05, , 1F
05/19 02:05, 1F
→
05/19 02:58, , 2F
05/19 02:58, 2F
→
05/19 02:59, , 3F
05/19 02:59, 3F
推
05/19 04:44, , 4F
05/19 04:44, 4F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章