02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Flash</strong> <strong>MX</strong> <strong>2004</strong> <strong>Games</strong><br />

23<br />

24 return;<br />

25 }<br />

26<br />

27 if (strncmp(msg, "PICKBOX", 4)==0){<br />

28 cp = strstr(msg, "ID=");<br />

29 if (!cp) return;<br />

30 cp+=3;<br />

31 pSocket->boxid = a<strong>to</strong>i(cp);<br />

32<br />

33 cp = strstr(msg, "NAME=");<br />

34 if (!cp) return;<br />

35 cp+=5;<br />

36 pSocket->name = cp;<br />

37<br />

38 sprintf(xmlmsg, "",<br />

39 pSocket->boxid, pSocket->name);<br />

40<br />

41 while(pos){<br />

42 socket = (CClientSocket*)m_connectionList.GetNext(pos);<br />

43 if (socket!=pSocket)<br />

44 socket->Send(xmlmsg, strlen(xmlmsg)+1);<br />

45 }<br />

46<br />

47 return;<br />

48 }<br />

49<br />

50 if (strncmp(msg, "MOVEBOX", 4)==0){<br />

51 cp = strstr(msg, "ID=");<br />

52 if (!cp) return;<br />

53 cp+=3;<br />

54 id = a<strong>to</strong>i(cp);<br />

55<br />

56 cp = strstr(msg, "XPOS=");<br />

57 if (!cp) return;<br />

58 cp+=5;<br />

59 xpos = a<strong>to</strong>i(cp);<br />

60<br />

61 cp = strstr(msg, "YPOS=");<br />

62 if (!cp) return;<br />

63 cp+=5;<br />

64 ypos = a<strong>to</strong>i(cp);<br />

65<br />

66 //Pass it on<br />

67 sprintf(xmlmsg, "",<br />

68 id, xpos, ypos);<br />

354

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!