opentnl-general Mailing List for Torque Network Library (Page 7)
Brought to you by:
mark_frohnmayer,
s_alanet
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(39) |
May
(34) |
Jun
(5) |
Jul
(5) |
Aug
(3) |
Sep
|
Oct
(8) |
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(2) |
Feb
(8) |
Mar
(18) |
Apr
(6) |
May
(12) |
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(8) |
Nov
(1) |
Dec
|
2006 |
Jan
(5) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(1) |
Feb
|
Mar
(10) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(3) |
2009 |
Jan
(24) |
Feb
(2) |
Mar
(2) |
Apr
(26) |
May
(75) |
Jun
(85) |
Jul
(46) |
Aug
(18) |
Sep
(14) |
Oct
(24) |
Nov
(8) |
Dec
(3) |
2010 |
Jan
(1) |
Feb
(1) |
Mar
(40) |
Apr
(57) |
May
(80) |
Jun
(58) |
Jul
(45) |
Aug
(49) |
Sep
(28) |
Oct
(6) |
Nov
(1) |
Dec
(3) |
2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(3) |
Jun
(10) |
Jul
(7) |
Aug
(7) |
Sep
(2) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
(11) |
Aug
(13) |
Sep
(8) |
Oct
(4) |
Nov
|
Dec
(1) |
2013 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(2) |
May
(2) |
Jun
(2) |
Jul
|
Aug
(14) |
Sep
(44) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
(4) |
Feb
(42) |
Mar
(3) |
Apr
(1) |
May
(7) |
Jun
(5) |
Jul
(14) |
Aug
(2) |
Sep
(2) |
Oct
(54) |
Nov
(43) |
Dec
(36) |
2015 |
Jan
(48) |
Feb
(64) |
Mar
(52) |
Apr
(24) |
May
(52) |
Jun
(60) |
Jul
(6) |
Aug
(15) |
Sep
(1) |
Oct
|
Nov
(7) |
Dec
(12) |
2016 |
Jan
(17) |
Feb
(2) |
Mar
(6) |
Apr
|
May
(66) |
Jun
(40) |
Jul
(51) |
Aug
(42) |
Sep
(24) |
Oct
(10) |
Nov
(46) |
Dec
(7) |
2017 |
Jan
(14) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(31) |
Jun
(8) |
Jul
(10) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Ville A. B. <vbe...@cc...> - 2006-01-26 14:48:46
|
On Wed, 25 Jan 2006, Aaron Dalton wrote: > I am running FreeBSD5.4-RELEASE and GCC 3.4.2. I have been trying to compile > the TNL library but with a number of difficulties. > 5) I shout for joy as the libtnl is finally linked but then frown deeply when > I get the following error in the libtomcrypt directory: > cc -c -I./ -Wall -Wsign-compare -W -Wno-unused -Wshadow -Werror -Os -c -o > tiger.o tiger.c > tiger.c:544: warning: conflicting types for built-in function 'round' > gmake[1]: *** [tiger.o] Error 1 With newer GCCs, "round" seems to be a reserved name (although why this is a warning instead of an error escapes me). You can fix this by adding the following #define/#undef pair around tiger.c: #define round HACK_round // tiger.c goes here #undef round BTW, this has been fixed in newer libtomcrypt versions. Time to upgrade? Cheers, Ville -- Ville Bergholm http://www.hut.fi/u/vberghol/ mobile +358-44-5722802 |
From: Aaron D. <aa...@da...> - 2006-01-26 01:27:52
|
I am running FreeBSD5.4-RELEASE and GCC 3.4.2. I have been trying to compile the TNL library but with a number of difficulties. 1) I extracted the source and typed 'gmake.' 2) The first error I encounter is: $ gmake gmake[1]: Entering directory `/home/aaron/devscratch/tnl/tnl/tnl' g++ -g -DTNL_DEBUG -DTNL_ENABLE_LOGGING -I../libtomcrypt -c assert.cpp In file included from tnlUDP.h:35, from tnl.h:51, from assert.cpp:27: tnlVector.h: In member function `T& TNL::Vector<T>::front()': tnlVector.h:302: error: there are no arguments to `begin' that depend on a template parameter, so a declaration of `begin' must be available tnlVector.h:302: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) tnlVector.h: In member function `const T& TNL::Vector<T>::front() const': tnlVector.h:307: error: there are no arguments to `begin' that depend on a template parameter, so a declaration of `begin' must be available tnlVector.h: In member function `T& TNL::Vector<T>::back()': tnlVector.h:312: error: there are no arguments to `end' that depend on a template parameter, so a declaration of `end' must be available tnlVector.h: In member function `const T& TNL::Vector<T>::back() const': tnlVector.h:317: error: there are no arguments to `end' that depend on a template parameter, so a declaration of `end' must be available gmake[1]: *** [assert.o] Error 1 I didn't understand this error so added the -fpermissive directive to the tnl/Makefile. 3) I now get almost to the very end but the compile halts at udp.cpp with the following (above warnings snipped): udp.cpp:105:21: wsipx.h: No such file or directory udp.cpp: At global scope: udp.cpp:158: error: `SOCKADDR' has not been declared udp.cpp:158: error: `socklen_t' has not been declared udp.cpp:159: warning: ISO C++ forbids declaration of `sockAddr' with no type udp.cpp:159: warning: ISO C++ forbids declaration of `addressSize' with no type udp.cpp: In function `void TNL::TNLToSocketAddress(const TNL::Address&, int*, int*)': udp.cpp:162: error: `SOCKADDR_IN' undeclared (first use this function) udp.cpp:162: error: (Each undeclared identifier is reported only once for each function it appears in.) udp.cpp:163: error: expected primary-expression before ')' token udp.cpp:163: error: expected `)' before "sockAddr" udp.cpp:164: error: expected primary-expression before ')' token udp.cpp:164: error: expected `)' before "sockAddr" udp.cpp:165: error: expected primary-expression before ')' token udp.cpp:165: error: expected `)' before "sockAddr" udp.cpp:171: error: `SOCKADDR_IPX' undeclared (first use this function) --HUGE SNIP-- gmake[1]: *** [udp.o] Error 1 So I now add the -DNO_IPX_SUPPORT to the tnl/Makefile (even though udp.cpp appears to define it already). 4) The compiler no longer looks for wsipx.h, but I still get all the other errors. So I now add -DTNL_OS_LINUX to the tnl/Makefile. 5) I shout for joy as the libtnl is finally linked but then frown deeply when I get the following error in the libtomcrypt directory: cc -c -I./ -Wall -Wsign-compare -W -Wno-unused -Wshadow -Werror -Os -c -o tiger.o tiger.c tiger.c:544: warning: conflicting types for built-in function 'round' gmake[1]: *** [tiger.o] Error 1 6) At this point I choose to give up and ask for assistance. The documentation and website say that FreeBSD is supported, but it doesn't appear so. I would love to add an opentnl port to the Ports tree, but I need to overcome these issues first. Any help you can offer would be greatly appreciated. Thank you for your time. -- Aaron Dalton | Super Duper Games aa...@da... | http://superdupergames.org |
From: <pet...@et...> - 2005-11-02 08:34:22
|
Hello =20 I've tested the Hello World tutorial and it works fine. However, if I disable the setting of the gQuit flag and in the client execute the message sending again there is a reply from the server for each send. The server, however, does not send to the client when re-executing the send code 'rpcMessageServerToClient("server send")' on the server. My aim is to be able to send in both directions (not only once) with this application. One server and one client only. Any hints? =20 Regards Peter |
From: Benjamin R. <bro...@cy...> - 2005-10-26 12:32:32
|
Hi, I'm currently working on a client-server architecture for a game. My clients are supposed to send their inputs to the server, and the server then sends it back to all other clients. I don't care about short-circuit for the moment. Every 50 ms, the client posts 5 netevents (unguaranteed ) to the connection to the server. Each time I pack a netevent, I pack about 32 bytes of data. My processConnections et CheckIncomingPackets are called on the OnIdle() of my application. The thing is, my server receives packets more and more delayed ( time difference between input timestamp, and world current time: at the begginning, a difference of 0.7s, which is always growing, whereas it should be constant, and about the value of the ping). I am working with 2 computers on a LAN. I suspect I don't use setFixedParameters correctly. The default values just don't seem to fit my needs. Any ideas, people having similar problems ? Thanks Ben |
From: boB G. <boB@Gage.net> - 2005-10-26 01:40:47
|
I've found a bizarre situation and I'm hoping it's only happening because I'm compiling with TNL_DEBUG turned on. When I change something in my ghosted data or add an RPC to my server, it changes the underlying connection structure enough so that both client and server have to be re-built before a sane connection is possible. This is not the problem. When an old version client connects to my new version server, the client crashes. This also is not the problem. A short time later (about the time my master server notices the connection drop??) my server crashes. THAT is the problem. Is this just an extreme reaction because I have TNL_DEBUG turned on or should I be worried about hackers that get something built on the TNL library that's close enough to almost connect, but not quite? What is the recommended way to implement version control using TNL objects? Thanks in advance, boB |
From: Mark F. <ma...@ga...> - 2005-10-20 20:07:58
|
TNL doesn't build with VC6. You'll have to pull one of the earlier (pre-1.5 builds) off of SourceForge. - Mark pe...@et... wrote: > Hello > > I'm getting many compilation errors in tnlmethoddispatch.h with Visual > C++ 6 SP5: > tnlmethoddispatch.h(208) : error C2989: 'FunctorDecl<void (__thiscall > ::*)(void)>' : template class has already been defined as a > non-template class > Each line of struct FunctorDecl generates this. > > Anyone have a solution to this? > > Regards > Peter > |
From: <pe...@et...> - 2005-10-20 13:24:40
|
Hello =20 I'm getting many compilation errors in tnlmethoddispatch.h with Visual C++ 6 SP5: tnlmethoddispatch.h(208) : error C2989: 'FunctorDecl<void (__thiscall ::*)(void)>' : template class has already been defined as a non-template class Each line of struct FunctorDecl generates this. =20 Anyone have a solution to this? =20 Regards Peter =20 |
From: Erol Y. <ero...@he...> - 2005-10-13 15:56:32
|
Hi, I get the error below after the 'make' comand, any ideas? Thanks.. make[1]: Leaving directory `/home/erol/Desktop/tnl-1.5.0-source/tnl/tnl' make[1]: Entering directory `/home/erol/Desktop/tnl-1.5.0-source/tnl/libtomcrypt' cc -c -I./ -Wall -Wsign-compare -W -Wno-unused -Wshadow -Werror -Os -c -o tiger.o tiger.c tiger.c:544: warning: shadowing built-in function `round' make[1]: *** [tiger.o] Error 1 make[1]: Leaving directory `/home/erol/Desktop/tnl-1.5.0-source/tnl/libtomcrypt' make: *** [default] Error 2 |
From: Ben G. <be...@ga...> - 2005-10-04 17:58:34
|
Ivan Vorobeychyk wrote: >Hi. >Thanks for this magic library - very impressive, especially RPCs. >I'm new to OpenTNL, so please, correct me, if I'm wrong. >I'm trying to send big data chunk, using ByteBufferPtr as parameter >in one of RPCs. It works fine for buffers<1500 Bytes but fails for larger >data buffers. I found that TNL uses PacketStream with internal >buffer of 1500 Bytes to send data, but I was really wondered that TNL >can't break large buffer to small packets. > > Hi Ivan, As it happens, you have to break your own data into chunks. TNL doesn't try to hide the nature of the transport from you, so as a result it won't work behind the scenes to allow you to do things like span data over multiple packets. In general for a realtime network connection doing that is a bad idea - if you get half of an update and the other half gets stalled somewhere out in the internet, then you might be in a great deal of trouble till it gets resolved! If you're trying to transfer large buffers in a non-realtime setting, then the easiest thing to do is cut the buffer up into, say, 300-400 byte chunks and send it by a series of guaranteed RPC calls or events. I've implemented some file transfer apps this way; it's quick and easy. If it's a very large file you might want to only try to keep a dozen or so calls/events in flight, and wait till one has been received before sending the next. Regards, Ben Garney |
From: Ivan V. <iv...@gm...> - 2005-10-04 11:05:32
|
Hi. Thanks for this magic library - very impressive, especially RPCs. I'm new to OpenTNL, so please, correct me, if I'm wrong. I'm trying to send big data chunk, using ByteBufferPtr as parameter in one of RPCs. It works fine for buffers<1500 Bytes but fails for larger data buffers. I found that TNL uses PacketStream with internal buffer of 1500 Bytes to send data, but I was really wondered that TNL can't break large buffer to small packets. Am I doing something wrong? Any better ways to send large data blocks? Thanks in advance! Ivan V |
From: boB G. <boB@Gage.net> - 2005-10-02 23:25:21
|
Argh! Hep me hep me! I had some problems with my project crashing and I thought I'd be doing some good if I updated to 1.5.0. Well, that may not have been the best idea, perhaps if I'd gotten my program stable before upgrading it would have gone better. I've updated several (I think all) RPC calls that were using parameters that are no longer valid (ByteBufferRef, actually most __Ref types, ...) but am still having some serious issues. I've added loads of debuging code (is TNLLogMessageV's) into the core TNL code to see what's going on, but so far it's a lot of data but no knowledge. The problem is the client & server don't connect, though the connect arrangement with the master seems to go fine. The gory details points are: - Both client & server are sending and receiving punch packets. Each packet received *is* what the other has sent (ie they aren't corrupted) - The punch packets are being discarded at either end because the Nonces do not match - Tracking the addPendingConnection() method shows that each is adding a pending connection with it's own nonces (ie not equal). - The nonces used in the addPendingConnection() method are the ones being sent in the punch packets, but since client & server each have their own nonces, they do not match at either end. - For awhile, data passed as ByteBufferPtr into RPCs was not being transferred accurately, but that has been fixed (my bad usage). I've attached the logs from one run. Translating to OpenTNL jargon: Auth is the master server, Realm is the server, and Client is the client. A possibly related, and truly odd, problem I had with the initial upgrade is that when I linked I got umpteen unresolved names -- everything in tnlMethodDispatch.cpp. I triple checked, and the .o file is listed in the OBJECTS definition in the makefile, and even can be seen (seriously mangled) in libtnl.a using 'nm'. BUT, the only way I got my programs to link was to explicitly link that one object file in addition to linking in libtnl.a Any clues would be greatly appreciated. Thanks in advance, boB Gage |
From: Roger C. <roc...@ch...> - 2005-09-26 05:37:50
|
confirm 411832 |
From: Mattias W. <mat...@ho...> - 2005-08-16 21:30:15
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello! My question is, before debugging any further: Should TNL be able to handle NetObjects created on both server and on clients at the same time, and use NetObject RPCs at the same time (in any direction)? I had some problems with this. I solved it by not using RPCs. But, now i need RPCs again.. Anyway, TNL is a great library! /Mattias Wallin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDAlwyrOcWDVxDO0YRArm6AJ9fzEYX2pcwyydEAiID+XMbIkN5fgCeK0iY 68T+5y5yBLVv+jPJ7/RUFpY= =UtsW -----END PGP SIGNATURE----- |
From: Ville A. B. <vbe...@cc...> - 2005-08-10 15:29:41
|
Hi, It seems OpenTNL 1.5.0 refuses to work with GCC 4.0: tnlTypes.h:299:8: error: #error "TNL: Unsupported version of GCC (see tnlMethodDispatch.cpp)" Here's the GCC I'm using: $ g++ --version g++ (GCC) 4.0.2 20050725 (prerelease) (Debian 4.0.1-3) If this is a simple thing to fix (like just adding a new pair of #elif/#define lines in tnlTypes.h), please commit this change to the HEAD revision at least. Thanks! Cheers, Ville -- Ville Bergholm http://www.hut.fi/u/vberghol/ mobile +358-44-5722802 |
From: Mark F. <ma...@ga...> - 2005-05-24 14:49:16
|
boB Gage wrote: > Mark, > > You said having a common Player & descending PlayerServer and > PlayerClient is not recommended... does that imply that having two > classes named Player but implemented differently is the preferred > method? Also, in the PlayerClient/PlayerServer method, you mention > the alphabetical sorting, does that mean if there's a PlayerDeath > object, for example, that it would cause problems because it would > land between PlayerClient & PlayerServer when sorted? Yes, this is the problem with that approach. Which is why having 2 Player classes (one on the client, one on the server) is the preferred way to do it. > > But I'm not sure I understand how to handle the situation when one of > these threads needs to reposition an object, or record damage, or just > about anything else that requires mucking around with the object's > data... I can mutex every object to allow only one of the server > threads access at a time. But, what's to stop OpenTNL from changing > things that I'm also changing ( like clearing dirty bits because it > just sent an update ). > > Wait.....an epiphany! Since OpenTNL is not multi-threaded it will > only update net object classes during, what, the interface->tick() > call? I can mutex around that call to ensure I'm not mucking with > data at the same time as OpenTNL . Will that do the trick?? :-) This will work, but you may end up blocking for a long time waiting for the network interface to process all the incoming packets, etc. A more optimal solution would involve message passing from the background (non-network) threads that update the state on the object in predictable ways. You could use the TNL ThreadQueue class to pass messages back to objects on the main thread. Another solution would involve using a zone type system where zone processes ghost objects to the main process, and the main process ghosts all objects to players, as well as border objects between zones. |
From: boB G. <boB@Gage.net> - 2005-05-24 11:39:07
|
Mark, Thanks for many good comments and excellent responses! But you're only encouraging me to ask more. :-) I coulda sworn I'd tried that, but I did have several other issues going on at the time and may have made some bad assumptions as to what was causing which problem. When I made that test I was still launching a "game thread" on the server that ticks the game class -- which was one of my big threading issues. I've since moved the game's tick() call into the server's main loop, which gets us past the multi-threading issue (for now at least). So maybe it's time to try the different classes again. :-) You said having a common Player & descending PlayerServer and PlayerClient is not recommended... does that imply that having two classes named Player but implemented differently is the preferred method? Also, in the PlayerClient/PlayerServer method, you mention the alphabetical sorting, does that mean if there's a PlayerDeath object, for example, that it would cause problems because it would land between PlayerClient & PlayerServer when sorted? Going back to your earlier comment: >Simply fixing setMaskBits is not going to be enough to make TNL threadsafe I have to agree. I mutexed (is that a word?) netObject.cpp to ensure no multiple call issues existed within that object and my test still Seg Faulted -- though it took well over 28 hours to do it. I think I've combined our two topics now.... Our designers have decided against a "zone" server solution because of the player's perceived "bounce" at zone edges, so we're locked into a single server handling the entire world (ie one NetInterface). Our plan is to have one or more AI threads, a physics thread, a weather thread, a decay thread, yadda yadda... Each of these threads will need to access data within the various objects that define the things in our world. But I'm not sure I understand how to handle the situation when one of these threads needs to reposition an object, or record damage, or just about anything else that requires mucking around with the object's data... I can mutex every object to allow only one of the server threads access at a time. But, what's to stop OpenTNL from changing things that I'm also changing ( like clearing dirty bits because it just sent an update ). Wait.....an epiphany! Since OpenTNL is not multi-threaded it will only update net object classes during, what, the interface->tick() call? I can mutex around that call to ensure I'm not mucking with data at the same time as OpenTNL . Will that do the trick?? :-) Thanks again! boB >Mark Frohnmayer wrote: > >It would be possible to have > > >Player > PlayerServer > PlayerClient > > >If the client executable does a TNL_IMPLEMENT_NETOBJECT of the >PlayerClient class and the server does a TNL_IMPLEMENT_NETOBJECT of the >PlayerServer class, then ghosts of PlayerServer objects will be >constructed on the client as PlayerClient objects. This is NOT >recommended - it merely takes advantage of the knowledge that all class >names are sorted alphabetically in order to generate mapping ids. > > >You could also have a class named Player in the client executable, and >one in the server and just have different definitions for each class. > > >boB Gage wrote: > > > > I'm having some issues with ghosted objects. In all the examples a > > world object, say a Player class that has TNL::NetObject at the base > > of its inheritance tree, has the same object on both server & client > > sides, meaning that the client has local methods that do server > > operations and vice-versa. > > > > This results in a lot of methods of the form { if (isServer) { ... } > > else { ... } } Since we have separate teams developing server and > > client code it also means that both teams are inside the same files a > > lot, leading to a lot more CVS conflicts than "normal." ( whatever > > that is :) It would be preferable for us to have TNL play with > > abstract classes, with each application defining a final descendant, > > including all server|client-specific code at that level. > > > > By default, TNL appears to require the same object on both sides of > > the connection, but is there a way to allow each application to have > > their own class that TNL plays with as the parent class?? ( much like > > the masterserver example uses an 'interface' class that each side > > descends it's own connection class from ). > > > > Or did I have something completely different going on when I decided > > we couldn't define both ServerGame and ClientGame descended from a > > common Game object that TNL does all its magic on? :-) > > > > > > Thanks in advance! > > boB |
From: Mark F. <ma...@ga...> - 2005-05-23 14:48:58
|
You'll need to explain a little more about the domain of your game, as there are several multithreading strategies you could use, depending on the type of game you have. You could have one process control an area or "zone" - and have each zone process have its own NetInterface. All communication server side between zones would be via TNL connections. When a client crosses zone boundaries it connects to the server controlling that zone. You could have one NetInterface control all client connections and object positioning information, and then have other threads for AI processing. The AI threads would communicate with the network/physics thread through well defined synchronization points. Simply fixing setMaskBits is not going to be enough to make TNL threadsafe -- there are many other concerns that would make it non-optimal to allow multiple threads to start mucking around with the network state. Still, with a cleanly designed server application, there's no reason why TNL shouldn't work well in a multithreaded/multiprocess environment. - Mark boB Gage wrote: > Huh... Seems like that would be an important point to have somewhere > in the documentation so we would have known about this *before* > deciding on OpenTNL for our project. > > So, how exactly would you suggest I write a multi-threaded server > using OpenTNL??? The game we're developing is very server-intensive > (all decisions are made there) and producing this server as a single > thread application will never work for our MMORPG. > > boB > >> You are correct -- TNL is not thread safe. Only one thread should ever >> set mask bits on an object, etc... >> >> >> We may look at making a threadsafe compile option. >> >> >> - Mark > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Opentnl-general mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opentnl-general |
From: Mark F. <ma...@ga...> - 2005-05-23 14:38:00
|
It would be possible to have Player PlayerServer PlayerClient If the client executable does a TNL_IMPLEMENT_NETOBJECT of the PlayerClient class and the server does a TNL_IMPLEMENT_NETOBJECT of the PlayerServer class, then ghosts of PlayerServer objects will be constructed on the client as PlayerClient objects. This is NOT recommended - it merely takes advantage of the knowledge that all class names are sorted alphabetically in order to generate mapping ids. You could also have a class named Player in the client executable, and one in the server and just have different definitions for each class. boB Gage wrote: > I'm having some issues with ghosted objects. In all the examples a > world object, say a Player class that has TNL::NetObject at the base > of its inheritance tree, has the same object on both server & client > sides, meaning that the client has local methods that do server > operations and vice-versa. > > This results in a lot of methods of the form { if (isServer) { ... } > else { ... } } Since we have separate teams developing server and > client code it also means that both teams are inside the same files a > lot, leading to a lot more CVS conflicts than "normal." ( whatever > that is :) It would be preferable for us to have TNL play with > abstract classes, with each application defining a final descendant, > including all server|client-specific code at that level. > > By default, TNL appears to require the same object on both sides of > the connection, but is there a way to allow each application to have > their own class that TNL plays with as the parent class?? ( much like > the masterserver example uses an 'interface' class that each side > descends it's own connection class from ). > > Or did I have something completely different going on when I decided > we couldn't define both ServerGame and ClientGame descended from a > common Game object that TNL does all its magic on? :-) > > > Thanks in advance! > boB > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Opentnl-general mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opentnl-general |
From: boB G. <boB@Gage.net> - 2005-05-23 12:00:29
|
I'm having some issues with ghosted objects. In all the examples a world object, say a Player class that has TNL::NetObject at the base of its inheritance tree, has the same object on both server & client sides, meaning that the client has local methods that do server operations and vice-versa. This results in a lot of methods of the form { if (isServer) { ... } else { ... } } Since we have separate teams developing server and client code it also means that both teams are inside the same files a lot, leading to a lot more CVS conflicts than "normal." ( whatever that is :) It would be preferable for us to have TNL play with abstract classes, with each application defining a final descendant, including all server|client-specific code at that level. By default, TNL appears to require the same object on both sides of the connection, but is there a way to allow each application to have their own class that TNL plays with as the parent class?? ( much like the masterserver example uses an 'interface' class that each side descends it's own connection class from ). Or did I have something completely different going on when I decided we couldn't define both ServerGame and ClientGame descended from a common Game object that TNL does all its magic on? :-) Thanks in advance! boB |
From: boB G. <boB@Gage.net> - 2005-05-23 11:09:27
|
Huh... Seems like that would be an important point to have somewhere in the documentation so we would have known about this *before* deciding on OpenTNL for our project. So, how exactly would you suggest I write a multi-threaded server using OpenTNL??? The game we're developing is very server-intensive (all decisions are made there) and producing this server as a single thread application will never work for our MMORPG. boB >You are correct -- TNL is not thread safe. Only one thread should ever >set mask bits on an object, etc... > > >We may look at making a threadsafe compile option. > > >- Mark |
From: Mark F. <ma...@ga...> - 2005-05-22 16:54:10
|
You are correct -- TNL is not thread safe. Only one thread should ever set mask bits on an object, etc... We may look at making a threadsafe compile option. - Mark boB Gage wrote: > I'm fairly new to OpenTNL and am getting fairly good results so far > EXCEPT that I keep seeing assertions out of netObject.cpp. > > Specifically the TNLAssert() on exit from NetObject::setMaskBits() > fails even though the TNLAssert() at the beginning of the method with > the same conditions was fine, a strong indication that the method was > re-entered from another task before the first call finished. I > changed the assert to an if() with debugging output with both current > and "on entry" status of several pointers & dirty bits -- the exit > conditions do not match what the code would do with the given entry > conditions (another strong indicator of method re-entry). > > Looking at the code it appears that this object is very thread unsafe. > > Multiple methods affect a global gDirtyList without any kind of > semaphore or critical section usage at all. Putting in a "poor man's > semaphore" (ie a boolean and a while loop) made the code much more > stable on my machine (a single CPU linux box) but was still very > unstable on my co-worker's multi-CPU box (which is our eventual target > platform). He was able to make the code stable on his machine by > binding it to CPU 0 only. > > So, the question is, is OpenTNL thread-safe? If not, do I need to > maintain my own thread-safe dirty list and feed it to OpenTNL from a > single thread? > > Thanks in advance! > boB Gage > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Opentnl-general mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opentnl-general |
From: boB G. <bo...@sh...> - 2005-05-22 15:00:16
|
I'm fairly new to OpenTNL and am getting fairly good results so far EXCEPT that I keep seeing assertions out of netObject.cpp. Specifically the TNLAssert() on exit from NetObject::setMaskBits() fails even though the TNLAssert() at the beginning of the method with the same conditions was fine, a strong indication that the method was re-entered from another task before the first call finished. I changed the assert to an if() with debugging output with both current and "on entry" status of several pointers & dirty bits -- the exit conditions do not match what the code would do with the given entry conditions (another strong indicator of method re-entry). Looking at the code it appears that this object is very thread unsafe. Multiple methods affect a global gDirtyList without any kind of semaphore or critical section usage at all. Putting in a "poor man's semaphore" (ie a boolean and a while loop) made the code much more stable on my machine (a single CPU linux box) but was still very unstable on my co-worker's multi-CPU box (which is our eventual target platform). He was able to make the code stable on his machine by binding it to CPU 0 only. So, the question is, is OpenTNL thread-safe? If not, do I need to maintain my own thread-safe dirty list and feed it to OpenTNL from a single thread? Thanks in advance! boB Gage |
From: Mark F. <ma...@ga...> - 2005-05-15 18:59:41
|
Hey Tess, You were on to the right solution with the NetClassGroups. You'll need to edit the tnlNetBase.h file to look like: enum NetClassGroup { NetClassGroupLogin, ///< Group for community server/authentication classes NetClassGroupBob, ///< Group for messages known by Bob and the client. NetClassGroupJoe, ///< Group for messages known by Joe and the client. NetClassGroupSally, ///< Group for messages known by Sally and the client. NetClassGroupInvalid = NetClassGroupCount, }; enum NetClassMask { NetClassGroupLoginMask = 1 << NetClassGroupLogin, NetClassGroupBobMask = 1 << NetClassGroupBob, NetClassGroupJoeMask = 1 << NetClassGroupJoe, NetClassGroupSallyMask = 1 << NetClassGroupSally, NetClassGroupAllMask = (1 << NetClassGroupCount) - 1, }; You can easily add new service providers by adding a new net class group and mask pair. You'll need to define seperate connection classes for each of the connections to the servers, and then implement them with: TNL_IMPLEMENT_NETCONNECTION(BobConnection, NetClassGroupBob, true); TNL_IMPLEMENT_NETCONNECTION(JoeConnection, NetClassGroupJoe, true); TNL_IMPLEMENT_NETCONNECTION(SallyConnection, NetClassGroupSally, true); Let's say further that there are some messages that all 3 servers know how to respond to -- then it would be possible to do something like: class BaseConnection : public EventConnection { // declare some RPC that all of the connections use TNL_DECLARE_RPC(rpcFOO, (StringPtr bar)); }; class BobConnection : public BaseConnection { }; class JoeConnection : public BaseConnection { }; class SallyConnection : public BaseConnection { }; TNL_IMPLEMENT_RPC(BaseConnection, rpcFOO, (StringPtr bar), (bar), (NetClassGroupBobMask | NetClassGroupJoeMask | NetClassGroupSallyMask), RPCGuaranteedOrdered, RPCDirAny, 0) { printf("FooBAR!!!: %s", bar.getString()); } That make sense? - Mark Ben Garney wrote: > Some possible solutions: > > - Give each one stubs for what it has not. And accept it will break > if you talk about such to it. > - Synchronize the class list on connect. > - Use RPCs and define an interface such that you don't have to have > them be aware of the classes? > - Use a mask system to define what sets of classes different > objects know about? > > Mark might also have some ideas. > > Ben > > Tess Snider wrote: > >> Oh my aching head. >> >> Okay, now, suppose, for the moment, that I had some sort of complex >> distributed server. It was built using a small number of discrete >> server applications that communicate amongst themselves, and some of >> them communicate with the client. We'll give some names to the server >> apps: >> >> Login >> Bob >> Joe >> Sally >> >> So, the client knows about numerous game objects, including Widgets >> and Foodlesnorts. Bob knows about Widgets and Joe knows about >> Foodlesnorts, but neither knows about both. Seeing as how these are >> gameplay-related objects, they've been assigned to NetClassGroupGame. >> But there's one little problem. Since the client knows about both >> Widgets and Foodlesnorts, its mEventClassCount for the >> NetClassGroupGame doesn't match Bob's count or Joe's count. Thus, >> when the client attempts to connect to Bob, BobConnection's >> readConnectAccept fails on isVersionBorderCount, because the counts >> don't match up. >> >> Well, we could hijack NetClassGameMaster, and move the Foodlesnorts >> into that, even though it feels horribly, horribly wrong. However, >> it's not an extensible solution to the problem. The next time we run >> into this problem (say, Sally knows about something Bob knows about, >> but Joe doesn't), we're in the same pickle, and we're out of >> NetClassGroups (Login uses Community). >> >> So, what's the RIGHT solution to this problem? Any clues? >> >> Tess >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by Oracle Space Sweepstakes >> Want to be the first software developer in space? >> Enter now for the Oracle Space Sweepstakes! >> http://ads.osdn.com/?ad_ids93&alloc_id281&op=click >> _______________________________________________ >> Opentnl-general mailing list >> Ope...@li... >> https://lists.sourceforge.net/lists/listinfo/opentnl-general >> >> >> >> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click > _______________________________________________ > Opentnl-general mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opentnl-general |
From: Ben G. <bg...@pb...> - 2005-05-15 09:55:49
|
Some possible solutions: - Give each one stubs for what it has not. And accept it will break if you talk about such to it. - Synchronize the class list on connect. - Use RPCs and define an interface such that you don't have to have them be aware of the classes? - Use a mask system to define what sets of classes different objects know about? Mark might also have some ideas. Ben Tess Snider wrote: >Oh my aching head. > >Okay, now, suppose, for the moment, that I had some sort of complex >distributed server. It was built using a small number of discrete >server applications that communicate amongst themselves, and some of >them communicate with the client. We'll give some names to the server >apps: > >Login >Bob >Joe >Sally > >So, the client knows about numerous game objects, including Widgets >and Foodlesnorts. Bob knows about Widgets and Joe knows about >Foodlesnorts, but neither knows about both. Seeing as how these are >gameplay-related objects, they've been assigned to NetClassGroupGame. >But there's one little problem. Since the client knows about both >Widgets and Foodlesnorts, its mEventClassCount for the >NetClassGroupGame doesn't match Bob's count or Joe's count. Thus, >when the client attempts to connect to Bob, BobConnection's >readConnectAccept fails on isVersionBorderCount, because the counts >don't match up. > >Well, we could hijack NetClassGameMaster, and move the Foodlesnorts >into that, even though it feels horribly, horribly wrong. However, >it's not an extensible solution to the problem. The next time we run >into this problem (say, Sally knows about something Bob knows about, >but Joe doesn't), we're in the same pickle, and we're out of >NetClassGroups (Login uses Community). > >So, what's the RIGHT solution to this problem? Any clues? > >Tess > > >------------------------------------------------------- >This SF.Net email is sponsored by Oracle Space Sweepstakes >Want to be the first software developer in space? >Enter now for the Oracle Space Sweepstakes! >http://ads.osdn.com/?ad_ids93&alloc_id281&op=click >_______________________________________________ >Opentnl-general mailing list >Ope...@li... >https://lists.sourceforge.net/lists/listinfo/opentnl-general > > > > |
From: Tess S. <ma...@gm...> - 2005-05-15 06:54:54
|
Oh my aching head. Okay, now, suppose, for the moment, that I had some sort of complex distributed server. It was built using a small number of discrete server applications that communicate amongst themselves, and some of them communicate with the client. We'll give some names to the server apps: Login Bob Joe Sally So, the client knows about numerous game objects, including Widgets and Foodlesnorts. Bob knows about Widgets and Joe knows about Foodlesnorts, but neither knows about both. Seeing as how these are gameplay-related objects, they've been assigned to NetClassGroupGame.=20 But there's one little problem. Since the client knows about both Widgets and Foodlesnorts, its mEventClassCount for the NetClassGroupGame doesn't match Bob's count or Joe's count. Thus, when the client attempts to connect to Bob, BobConnection's readConnectAccept fails on isVersionBorderCount, because the counts don't match up. Well, we could hijack NetClassGameMaster, and move the Foodlesnorts into that, even though it feels horribly, horribly wrong. However, it's not an extensible solution to the problem. The next time we run into this problem (say, Sally knows about something Bob knows about, but Joe doesn't), we're in the same pickle, and we're out of NetClassGroups (Login uses Community). So, what's the RIGHT solution to this problem? Any clues? Tess |