+ Reply to Thread
Results 1 to 8 of 8

Thread: Electroserver UDP Method Call missing from DLL Unity C# Client API

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Exclamation Electroserver UDP Method Call missing from DLL Unity C# Client API

    I am trying to use this method for communicating with a client via UDP directly to a user, I believe I need this method and to specify that it is "reliability.unreliable". However:

    sendPluginMessageToUser(string userName, EsObjectRO)

    This method is in the dll files but I do not think the alternate call for the same method with reliability parameter, is in the dll.

    sendPluginMessageToUser(string userName, com.electrotank.electroserver5.messages.Message.Re liability reliability, EsObjectRO)

    Here is the definition from the C#/Unity client API.

    PluginPrivateMessageResponse sendPluginMessageToUser(String userName,
    com.electrotank.electroserver5.messages.Message.Re liability reliability,
    EsObjectRO variables)
    Sends a plugin message to a user. With the associated EsObject, almost anything can be sent.
    Parameters:
    userName - the name of the user
    variables - the EsObject to send as part of the message
    Returns:
    a response indicating the status of the delivery
    See Also:
    sendPluginMessageToRoom, sendPluginMessageToRooms, sendPluginMessageToServer, sendPluginMessageToUsers, sendPluginMessageToZone, sendPluginMessageToZones, PluginPublicMessageResponse, EsObjectRO

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,209
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    I'm confused as to what you are trying to do. To use UDP with ES5, you have to have a UDP connection in addition to your TCP connection, and you need a plugin on the server that is set up to use UDP. The server can't send a UDP message to a user unless that user has already sent a UDP message to the server first, so that the server knows that the UDP is working.

    After that is all set up, to send a UDP message from a client to another client you have to have the first client send the message to the plugin, and then the plugin sends it to the other client.

    PluginPrivateMessageResponse sendPluginMessageToUser is in the Java server api, not in any of the client apis.

    Have you looked at the code example UDPExample? That's probably the best place to get started. If you use the Unity web player then you will need to use a custom policy file on the ES5 - I can explain how to do that later if you need it.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Server API

    Sorry, was my mistake, I meant to say this was the command I am trying to use to resend a UDP message to a single user from the server and the method is not available. So, I have a message being sent to a plugin, and I want the plugin to respond to that particular user only. In order to send it as a udp i would need this method so that I can indicate that it is unreliable.

    I took a screenshot of the message I see below:

    method.jpg

    Here is another of the auto syntax:

    method2.jpg

    Also, I looked through the examples and all I found was UDP responding to the entire room using its room/zone id.

    I do have the udp connection established already and can send and receive using this command that sends to the room.

    getApi().sendPluginMessageToRoom(getApi().getZoneI d(), getApi().getRoomId(),Reliability.Unreliable, messageIn);
    Last edited by EsquireMD; 12-10-2011 at 08:58 PM.

  4. #4
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,209
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    The current version of the ES5 server api does have the method that you need:
    PluginPrivateMessageResponse sendPluginMessageToUser(String userName,
    com.electrotank.electroserver5.messages.Message.Re liability reliability,
    EsObjectRO variables)

    This was added in either ES5.2.3 or ES5.3. What version of ES5 are you running on the server? And check that your Java project is using the ElectroServer5.jar file from that server, so that you do get the latest api available. If you have NetBeans or Eclipse configured to use an old library jar, then it won't find that method.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  5. The Following User Says Thank You to tcarr For This Useful Post:

    EsquireMD (12-11-2011)

  6. #5
    Junior Member
    Join Date
    Nov 2011
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks, that never crossed my mind as a solution as I thought I had the latest release. I will double check when I get home and see what version of the jar and the server I am running and report back. Thanks for your help though, it is greatly appreciated.

  7. #6
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,209
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    I've done it many a time myself - probably more often than most developers, because when I add a feature to the server api, I then either create a new code example or I modify an existing one, so that I can test the new feature. I've lost count of the number of times I've done getApi(). and then couldn't find the method that was just added, and THEN realized I had forgotten to put the latest ElectroServer5.jar file into the lib folder for the test extension.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  8. The Following User Says Thank You to tcarr For This Useful Post:

    EsquireMD (12-11-2011)

  9. #7
    Junior Member
    Join Date
    Nov 2011
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Yes this was the problem I had the jar for 5.2.3 and the method was added in the 5.3 release. Thanks a million!

  10. #8
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,209
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    Huzzah! Glad you got it solved!
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts