Archived

This forum has been archived. Please start a new discussion on GitHub.

Conception

Hi,

Using Ice is not easy, and conceive a good program neither... :)
I explain you what I want to do, and I hope some advice :rolleyes:

It's about a mmorpg. I got a server. Inside I got a server class ( inherited from an Ice interface), which accept Player connexion, with bidirectionnal stuff.
I got a world class, containing vector of Zone objects ( piece of world), containing vector of people object.

The client program ask every second ( what is the time elapsed has no importance), to the server a list of people for a determined Zone.

1) Every people object have to have an Ice::Identity.
2) Client contacts Server object like for newConnexion to ask list of people object
3) Server object creates a vector of ID and send back to the client ( Ice method vector<people *> Myserver::returnlist(string zone, Current &)....)

2 mains questions :
1) people objects have to registered to an adapter? Each object must have an adapter?
2) How the client can contact an server object with only its Ice::Identity?

Thanks a lot

Comments

  • matthew
    matthew NL, Canada
    1) people objects have to registered to an adapter? Each object must have an adapter?

    No, you can register multiple objects on one object adapter.
    2) How the client can contact an server object with only its Ice::Identity?

    Why would you do that? You should have a proxy to the server object not just the identity.
  • 1) It was what I m thinking. In this way, Do i can attach my object to a main Adapter ( servermain's one)?

    2) In fact, I declare a function which return vector of identity. My client use myVector=myserverProxy->returnMeVectorOfIdentity();

    So, I got a vector of identity. But, I mistake something in my conception, I think, but now I got identities, how do I contact the object from identity information?
  • If you have an identity, you can create a proxy for it at any time provide that you either know the endpoint (address and port) at which the server is running, or, if the server uses IcePack, you know the adapter name. Check out the documentation for createProxy() and the chapter on IcePack.

    Cheers,

    Michi.
  • hi, michi,
    If you have an identity, you can create a proxy for it at any time provide that you either know the endpoint (address and port) at which the server is running

    In dibir circumstance ( as shimrod said in his first post),to create a proxy, only the address and port of server is enough? if also need the remote address and port provide that a fixed proxy is wanted?
  • matthew
    matthew NL, Canada
    If you are really developing an MMO you don't want the client & the server backend to talk directly. You will always want to use glacier2, and therefore this is a non-issue.

    You must protect the server backend, and furthermore this protection must be built into the interfaces right from the beginning. You cannot shoe-horn in security after you have the application written.

    For example, in the above set of interfaces if I am player X, and get hold of a proxy to player Y what prevents me from calling on this player and making player Y do something (such as attack the giant spider of leaping death)?
  • hi,Matthrew,
    Maybe you are right. Actually I am not interested in MMO at all for the time being. What I want is to be confirmed about the fixed proxy issue because I am struggled with that.
    Please allow me to repeat my question again and hope getting your advice. In bidir circumstance, I keep the client callback proxy in the server into a freeze. when the server restarts, I wish that the privious callback proxy could be unmarshalled out from freeze without needing the client's re-regiestering to the server.
    However, this seems not feasible as Marc has pointed out because I can not acquire the same connection as before. That is, even thoght I can have the same identity, the same server IP, the same server Port, even the same client IP, I can not ensure to get the same client port therefore the same connection, and eventually fail to create the same fixed proxy as before.
    Sorry for my this question. It has departured from the initial thread. ;).
    This may be a very simple question but it really swallowed me much time to understand it. I feel it is the two createproxy functions , ObjectAdapter's and Connection's , which have some subtle differenece between them and make me confused.
    Hope getting your further calrifying.

    Thanks in advance.
    OrNot
  • matthew
    matthew NL, Canada
    I don't really understand what you are asking. If the client doesn't re-register you want the server to be able to talk with it? That's not possible, since the bi-directional connection originates with the client -- therefore the client *must* re-register in order for the server to talk with it.
  • @#$$&amp;&*& :p
    Yes, Matthrew. You are right. My needed answer is now very claer: It is impossible to create a identical prxoy in bidir circumstance after the server restared.
    Thank you very much. ;)
    OrNot
  • Thanks... I will experiment soon. Reply my feedback next...

    See you soon :)