Page 12 of 16

compiled but not working

Posted: Wed Jul 11, 2007 7:11 pm
by MerlinCAM
when I use the irrlicht dll that is in the .36 project, i can get it to compile, but i get the following when executing:

Unhandled exception at 0x65727574 in irrNet.exe: 0xC0000005: Access violation reading location 0x65727574.

Posted: Thu Jul 12, 2007 2:17 am
by BlindSide
Hey there the material format has changed in Irrlicht 1.3.1.

The examples on the SVN are up to date I think.

If they are not try to use getMaterial(materialNumber); for retrieving the materials.

What do you mean by using Irrlicht dll from irrnet? Shouldn't you use your own dll that came with the lib that you used to compile with?

Posted: Fri Jul 13, 2007 5:59 am
by .petrus.
why this 3d isn't sticky??

Posted: Fri Jul 13, 2007 9:42 pm
by BlindSide
Im sorry, what? :D (Btw MerlinCAM solved his problem later over pm if anyones interested)

Posted: Wed Jul 18, 2007 10:57 pm
by monkeycracks
I modified irrnet a bit to make it bool setUpClient() instead of void setUpClient()


here's the new function, goes in NetManager.cpp and change the void to bool in NetManager.h

(I realize this isn't the best way to do it probably, but it works for me and you can now do if(netmgr->setUpClient()){loadcraphere}else{return 0;}. Also, if the first connection fails, it won't try to get the playerID).

Code: Select all

bool INetManager::setUpClient()
		{
			isserver = 0;
			
			core::stringc ipaddress;
			u32 port = 0;

			if(customconnect)
			{
				ipaddress = customaddress;
				port = customport;
			}
			else
			{
			IXMLReader* xml = device->getFileSystem()->createXMLReader("ip.xml");
			while(xml && xml->read())
			{ 
				if (core::stringw("config") == xml->getNodeName())
					ipaddress = xml->getAttributeValue(L"address");
				port = xml->getAttributeValueAsInt(L"port");
			}
			}

			printf("Creating client!\n");
			host = enet_host_create(NULL, 1,57600 / 8, 14400 / 8);

			ENetEvent event;

			/* Connect to some.server.net:1234. */
			//printf("Please enter the ip address.\n");
			//std::cin >> i;
			enet_address_set_host (& address, ipaddress.c_str());
			address.port = port;

			/* Initiate the connection, allocating the two channels 0 and 1. */
			printf("Connecting to ");
			printf(ipaddress.c_str());
			printf(":%d\n",port);
			peer = enet_host_connect (host, & address, 2);    

			if (peer == NULL)
			{
				fprintf (stderr, 
					"No available peers for initiating an ENet connection.\n");
				exit (EXIT_FAILURE);
			}

			/* Wait up to 5 seconds for the connection attempt to succeed. */
			if (enet_host_service(host, & event, 5000) > 0 &&
				event.type == ENET_EVENT_TYPE_CONNECT)
			{
				printf("Connection succeeded.\n");

			}
			else
			{
				/* Either the 5 seconds are up or a disconnect event was */
				/* received. Reset the peer in the event the 5 seconds   */
				/* had run out without any significant event.            */
				enet_peer_reset (peer);

				printf ("Connection failed.\n");
				return false;
			}
			//c8 buffer[2];
			//u8 packid = 4;
			//memcpy(buffer,(char*)&packid,1);
			//ENetPacket * packet;
			//packet = enet_packet_create (buffer,1,ENET_PACKET_FLAG_RELIABLE);
			//enet_host_broadcast (host, 0, packet);
			if (enet_host_service(host, & event, 5000) > 0 && event.type == ENET_EVENT_TYPE_RECEIVE)
			{
				buff = event.packet->data;
				u8 packiden = 0;
				memcpy((char*)&packiden,buff,1);
				if (packiden == 4){
					memcpy((char*)&playernumber,buff+1,2);
					printf ("Player ID is %d\n", playernumber);
				}
				return true;
			}
			else
			{
				printf ("Failed to recieve Player ID.\n");
				return false;
			}
		}

Posted: Thu Jul 19, 2007 7:26 am
by BlindSide
Thanks for your contribution monkeycracks. I can add you to the dev team on the sourceforge page if you make an account there.

Cheers

Posted: Wed Aug 22, 2007 5:42 pm
by XFactor
Hi. Where can I get the linux version?

Posted: Wed Aug 22, 2007 11:24 pm
by BlindSide
It should work fine on linux, just compile it. There may be some errors but they are easy to fix. Tell me if there is anything wrong when compiling and I will try to help. Please use the SVN version from the Sourceforge page (The address is on the first post), But for Enet use the version supplied with the zip file from the first post.

Posted: Thu Aug 23, 2007 5:11 am
by XFactor
Hey Blindside, I used enet from where you said and only got 2 errors this time (compared to 92).

But I can't fix this one:

Code: Select all

static const SFrameRange NULLRANGE;
error: uninitialized const irr::net::NULLRANGE;

Posted: Thu Aug 23, 2007 11:46 am
by BlindSide
Just change this to

Code: Select all

static const SFrameRange NULLRANGE = {};
But this was already done in the SVN! So check that you are using the newest revision of SVN as it has some very helpful functions (There is some documentation about them in the NetManager.h header file).

Cheers

Posted: Sat Aug 25, 2007 6:00 pm
by Lonesome Ducky
Hi I just downloaded irrnet. I use microsoft visual c++ 2005 and i gives me these errors when i compile:1>------ Build started: Project: Project, Configuration: Debug Win32 ------
1>Compiling...
1>example1.cpp
1>Linking...
1>example1.obj : error LNK2019: unresolved external symbol "public: class irr::scene::ISceneNode * __thiscall irr::net::INetManager::getSceneNodeFromNetId(unsigned short)" (?getSceneNodeFromNetId@INetManager@net@irr@@QAEPAVISceneNode@scene@3@G@Z) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::setLocalVelocity(class irr::scene::ISceneNode *,class irr::core::vector3d<float>)" (?setLocalVelocity@INetManager@net@irr@@QAEXPAVISceneNode@scene@3@V?$vector3d@M@core@3@@Z) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::sendCustomVar(class irr::scene::ISceneNode *,unsigned short,unsigned int)" (?sendCustomVar@INetManager@net@irr@@QAEXPAVISceneNode@scene@3@GI@Z) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall irr::net::INetManager::getCustomVar(class irr::scene::ISceneNode *,unsigned short)" (?getCustomVar@INetManager@net@irr@@QAEIPAVISceneNode@scene@3@G@Z) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::updateServer(void)" (?updateServer@INetManager@net@irr@@QAEXXZ) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::sendVelocity(class irr::scene::ISceneNode *,class irr::core::vector3d<float>,bool)" (?sendVelocity@INetManager@net@irr@@QAEXPAVISceneNode@scene@3@V?$vector3d@M@core@3@_N@Z) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::updateClient(void)" (?updateClient@INetManager@net@irr@@QAEXXZ) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::sendPositionAuto(class irr::scene::ISceneNode *,unsigned int)" (?sendPositionAuto@INetManager@net@irr@@QAEXPAVISceneNode@scene@3@I@Z) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: class irr::scene::ISceneNode * __thiscall irr::net::INetManager::addNetSphereSceneNode(float,int,class irr::core::vector3d<float>,class irr::core::vector3d<float>,class irr::core::vector3d<float>)" (?addNetSphereSceneNode@INetManager@net@irr@@QAEPAVISceneNode@scene@3@MHV?$vector3d@M@core@3@00@Z) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::setUpServer(void)" (?setUpServer@INetManager@net@irr@@QAEXXZ) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::setUpClient(void)" (?setUpClient@INetManager@net@irr@@QAEXXZ) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::net::INetManager::setVerbose(bool)" (?setVerbose@INetManager@net@irr@@QAEX_N@Z) referenced in function _main
1>example1.obj : error LNK2019: unresolved external symbol "public: __thiscall irr::net::INetManager::INetManager(class irr::IrrlichtDevice *)" (??0INetManager@net@irr@@QAE@PAVIrrlichtDevice@2@@Z) referenced in function _main
1>C:\irrNet V036\irrNet\Examples\Source\Project\Debug\Project.exe : fatal error LNK1120: 13 unresolved externals
1>Build log was saved at "file://c:\irrNet V036\irrNet\Examples\Source\Project\Debug\BuildLog.htm"
1>Project - 14 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========





am i missing a library?

Posted: Sun Aug 26, 2007 9:09 am
by BlindSide
Yes you are missing irrNet :lol: You must add it to your project files in MSVC by selecting add->existing files. And add all the irrnet files. Then you must also add all the supplied Enet .c files. Make sure you define #win32 and you should be sweet. :D

Cheers

Posted: Thu Aug 30, 2007 9:58 pm
by interceptor
ok, just a (maybe dumb) random question: how many players could you have on the server? and, if there is not a limit, could you set one?

Posted: Fri Aug 31, 2007 8:00 pm
by BlindSide
interceptor wrote:ok, just a (maybe dumb) random question: how many players could you have on the server? and, if there is not a limit, could you set one?
There is no real limit (You can have up to a very large amount just by changing some values) and yes you can easily impose a custom limit on the amount of players.

Posted: Sat Sep 01, 2007 4:42 pm
by interceptor
Thanks.. but ehh.. DevC++ errors..

Code: Select all

NetManager.cpp: In constructor `irr::net::INetManager::INetManager(irr::IrrlichtDevice*)':
NetManager.cpp:44: error: `printf_s' undeclared (first use this function)

NetManager.cpp:44: error: (Each undeclared identifier is reported only once for each function it appears in.)

NetManager.cpp: In member function `void irr::net::INetManager::updateClient()':
NetManager.cpp:195: error: invalid conversion from `const void*' to `void*'

NetManager.cpp:581: error: invalid conversion from `irr::c8' to `char*'

NetManager.cpp:581: error:   initializing argument 1 of `void irr::net::InPacket::getNextItem(char*, int)'

NetManager.cpp:582: error: invalid conversion from `irr::c8' to `char*'

NetManager.cpp:582: error:   initializing argument 1 of `void irr::net::InPacket::getNextItem(char*, int)'

NetManager.cpp:622: error: invalid conversion from `irr::u32' to `char*'

NetManager.cpp:622: error:   initializing argument 1 of `void irr::net::InPacket::getNextItem(char*, int)'

NetManager.cpp:648: warning: cast from pointer to integer of different size

NetManager.cpp: In member function `void irr::net::INetManager::updateServer()':
NetManager.cpp:859: warning: cast to pointer from integer of different size

NetManager.cpp:908: warning: cast from pointer to integer of different size

NetManager.cpp:908: warning: cast from pointer to integer of different size

NetManager.cpp:1138: warning: cast from pointer to integer of different size

NetManager.cpp:1253: warning: cast from pointer to integer of different size

NetManager.cpp:1290: warning: cast from pointer to integer of different size

NetManager.cpp:1327: warning: cast from pointer to integer of different size

NetManager.cpp:1425: error: invalid conversion from `irr::u32' to `char*'

NetManager.cpp:1425: error:   initializing argument 1 of `void irr::net::InPacket::getNextItem(char*, int)'

NetManager.cpp:1455: warning: cast from pointer to integer of different size

NetManager.cpp:1489: warning: cast from pointer to integer of different size

NetManager.cpp:1490: warning: cast from pointer to integer of different size

NetManager.cpp:1502: warning: cast from pointer to integer of different size

NetManager.cpp: In member function `ENetPeer* irr::net::INetManager::getPlayerById(irr::u16)':

NetManager.cpp:1816: warning: cast to pointer from integer of different size

NetManager.cpp: In member function `void irr::net::INetManager::sendOutPacket(irr::net::OutPacket*, irr::u16)':
NetManager.cpp:2324: warning: cast to pointer from integer of different size

NetManager.cpp: In member function `void irr::net::INetManager::sendOutPacketUnreliable(irr::net::OutPacket*, irr::u16)':
NetManager.cpp:2345: warning: cast to pointer from integer of different size

make.exe: *** [NetManager.o] Error 1
Using code from the SVN, all files included in project.. win32 defined.. help?