IrrNet - Irrlicht Network Framework 0.36 (Now Windows/Linux)
compiled but not working
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.
Unhandled exception at 0x65727574 in irrNet.exe: 0xC0000005: Access violation reading location 0x65727574.
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?
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?
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
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).
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;
}
}
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.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
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:
error: uninitialized const irr::net::NULLRANGE;
But I can't fix this one:
Code: Select all
static const SFrameRange NULLRANGE;
IRRLICHT ROCKS!!!!
Just change this to
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
Code: Select all
static const SFrameRange NULLRANGE = {};
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
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?
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?
Yes you are missing irrNet 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.
Cheers
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 22
- Joined: Thu Aug 23, 2007 12:39 pm
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.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?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 22
- Joined: Thu Aug 23, 2007 12:39 pm
Thanks.. but ehh.. DevC++ errors..
Using code from the SVN, all files included in project.. win32 defined.. help?
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