You are here: Home

XNA Community Thailand

XNA Webboard
ยินดีต้อนรับ, ผู้เยี่ยมชม
กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน.    ลืมรหัสผ่าน?
ติด code คร่า รันไม่ผ่าน ทำไงดี (1 viewing) (1) ผู้เยี่ยมชม
Go to bottom รายการถูกบันทึก: 0
หัวข้อ: ติด code คร่า รันไม่ผ่าน ทำไงดี
#1458
sago (สมาชิก)
Junior Boarder
กระทู้: 21
graphgraph
สมาชิกที่ไม่ได้ออนไลน์ Click here to see the profile of this user
ติด code คร่า รันไม่ผ่าน ทำไงดี 7 เดือน ที่ผ่านมา กรรม: 0  
รันไม่ผ่านคร่า มันคืออะไรอ่ะค่า



foreach (LocalNetworkGamer gamer in networkSession.LocalGamers)
{
UpdateLocalGamer(gamer);
}
if (networkSession.IsHost)
{
UpdateServer();
}



ติดตรง networkSession.LocalGamers



method UpdateLocalGamer

/////////////
void UpdateLocalGamer(LocalNetworkGamer gamer)
{


if (!networkSession.IsHost)
{
packetWriter.Write("Client send " + count);

gamer.SendData(packetWriter, SendDataOptions.InOrder, networkSession.Host);
}
}



ขึ้นตัวขีดเหลืองว่า NullReferenceException was unhandled
มันแปลว่าอะไรค่า......
 
การบันทึก การบันทึก  
 
Last Edit: 2010/02/08 19:13 By sago.
  The administrator has disabled public write access.
#1459
sago (สมาชิก)
Junior Boarder
กระทู้: 21
graphgraph
สมาชิกที่ไม่ได้ออนไลน์ Click here to see the profile of this user
Re:ติด code คร่า รันไม่ผ่าน ทำไงดี 7 เดือน ที่ผ่านมา กรรม: 0  
 
การบันทึก การบันทึก  
  The administrator has disabled public write access.
#1460
mankajib (ผู้ดูแลระบบ)
Moderator
กระทู้: 320
graph
สมาชิกที่ไม่ได้ออนไลน์ Click here to see the profile of this user
Re:ติด code คร่า รันไม่ผ่าน ทำไงดี 7 เดือน ที่ผ่านมา กรรม: 3  
จาก error มันบอกว่า networkSession น่าจะยังไม่ได้ถูกสร้าง หรือสร้างไม่ได้ มันคงมีค่าเป็น null

ลองไปเช็คดู บรรทัดที่ networkSession = ....
 
การบันทึก การบันทึก  
  The administrator has disabled public write access.
#1464
mighe (สมาชิก)
Fresh Boarder
กระทู้: 14
graphgraph
สมาชิกที่ไม่ได้ออนไลน์ Click here to see the profile of this user
Re:ติด code คร่า รันไม่ผ่าน ทำไงดี 7 เดือน ที่ผ่านมา กรรม: 0  
ดันความคิดเห็นข้างบนครับ เห็นด้วย networkSession น่าจะยังไม่ถูกสร้างหรือว่าคุณไปก๊อปโค้ดเค้ามาแล้วเปลี่ยนชื่อ
มีอีกอันคือ มันเป็น method ของ networkSession ซึ่งมันไม่มีการ using network มา มันเลยไม่สามารถเรียกใช้คลาส networkSession ได้ครับ
 
การบันทึก การบันทึก  
 
Last Edit: 2010/02/09 20:30 By mighe.
  The administrator has disabled public write access.
Go to top