Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. static PyObject *sendPacket(PyObject *self, PyObject *args)
  2. {
  3. packetbuf p(MAXTRANS,ENET_PACKET_FLAG_RELIABLE);
  4.  
  5. for(Py_ssize_t i=0;i<PyTuple_Size(args);i++)
  6. {
  7. int data=PyInt_AsLong(PyTuple_GetItem(args,i));
  8. std::cout<<data<<" ";
  9. putint(p, data);
  10. }
  11.  
  12. sendpacket(-1, 1, p.finalize(), -1);
  13. std::cout<<"\n";
  14. Py_INCREF(Py_None);
  15. return Py_None;
  16. }
  17. Prints:
  18. 40 1312 504 1 1 1 8 5 0 2 0 2 3 -1 1 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement