Search Unity

Raknet Reading packet->data[0] sending from unity?

Discussion in 'Multiplayer' started by dklompmaker, Oct 14, 2009.

  1. dklompmaker

    dklompmaker

    Joined:
    Sep 12, 2008
    Posts:
    80
    Hello,

    My question is with Raknet, you have network messages like "CONNECTION_REQUEST" etc... But If I have my own messages I would like to send from unity to my server, how would I go about sending them... would I have to use OnNetworkSerialize? or...
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    you can't, you have no access to raknet functionality

    either you need to add your own networking or you need to teach your server the automatic syncronization or rpc mechanisms correctly.
     
  3. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    I have an item in the wish list for them to add in a way for us to add to the list of user packet enumerators our own packet enumerators. Check it out and vote for it because this would be extremely helpful.
     
  4. dklompmaker

    dklompmaker

    Joined:
    Sep 12, 2008
    Posts:
    80
    Forgive me if I am wrong though,

    In unity you can customize the bit streaming of information correct? for your own values?

    So.. if the first bit is the enum... could I just send my own enum over as long as it is defined in the server?
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    If you assign a component to a network view, you can stream whatever you want in the bitstream, correct.

    But those data are always meant to be the same data, ie constant size block for each view.
    Basing on that, the delta compression will only send what has changed.

    If you change the size it will actually go bogus if you try to raise the size.

    Unity has no generic network stream in its own networking. If you want that I would recommend to check out the System.Net functionality, the TCP and UDP sockets