High-level networking.

Hello everyone,

So, i need a networking in my project but i don’t wont go to the low-lewel. As i saw there is a lot of high-level networking classes in Panda such as DistributedNode, DistributedActor etc. But there is no tutorials how to use it and there is no description of this classes in manual at all. On forums i also did’nt find any useful information about how to use this classes. Maybe anyone can provide me with information how works this high-level network classes?

Nikita Leonov

Anybody can upload some code examples of DistributedNode use?

i think you have to look though the source… while you do that could you write reference for the rest of us™?

The whole distributed network code is more or less “property” of Disney. Documentation there was rare ever since. Its their playground and it seems to be that they don’t intend in making it too much public since its one of the features that is used intensively for (e.g) ToonTown.
The forums give a few hints about the “distributed” model used in Panda3D, but its suggested to use a lower level network code. Some examples can be found either in the showcase or in the code snipplet section.

It might be easier to write an own protocol instead of trying to understand the way Disney uses their “distributed” network model. - However, this can just be a suggestion. You are of course welcome to dive into it and share your experiences. :slight_smile:

Regards, Bigfoot29


As has been pointed out, the distributed object model is barely documented and if you are looking for a bunch of helpful examples, you will be sorely disappointed.

That being said, I use the distributed system, it works and in some ways it is better than writing your own network protocols by hand. It really depends on what you want to do, but if you want to use the distributed system, you should expect to get your hands dirty in the source because (a) there are no docs, (b) there are bugs lurking in there.

There was an old version of Panda that shipped with a chat room sample program, I think it was Panda 1.05. The sample has long since disappeared from the distribution but if you grab 1.05 it is at least a place to start. I seem to recall that the example does not work on the latest versions of Panda, but I also recall it being pretty trivial to fix. I can dig it out and have a look if you can’t figure it out.

Anyways, the classes you are going to want to investigate to brgin with are ServerRepository, ClientRepository and DistributedObject. The idea is that the ServerRepository runs on the server and keeps track of all the distributed objects living among your clients, and works as a proxy to move packets between the ClientRepository classes, which will live on all of your clients (and probably an instance on the server, too). DistributedObjects (or objects derived from DistributedObject, such as DistributedNode, DistributedActor, or your own classes) are instantiated through your ClientRepository (createWithRequired method), are pushed up to the ServerRepository, and then are pushed out to all the other ClientRepository. The DistributedObjects use sendUpdate calls to push remote procedure calls or property updates up to the server repository and out to the other clients. Oh, and the last aspect you will need to understand is the .dc (distributed class) files which you must write along with each DistributedObject-derived class, which define what methods are exported over the network, and what sort of arguments they accept.

Of course this is all a fairly abstract explanation, I recommend you dig out Panda 1.05 as I mentioned and study the chat room example for a while. And as I said, you will almost inevitably have to get familiar with the Panda source, because this stuff just isn’t documented.

Oh, and by the way, you may also want to look at the source editing forums since I think I have posted some bug fixes to the engine itself in there. Some of them have been rolled into the CVS repository for Panda 1.4, some of them not.