Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 550 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 550 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 26 - File: global.php(872) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/global.php(872) : eval()'d code 26 errorHandler->error
/global.php 872 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error

Mutliplayer - Printable Version
The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 550 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 550 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 811 - File: global.php PHP 8.1.27 (FreeBSD)
File Line Function
/global.php 811 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 26 - File: global.php(872) : eval()'d code PHP 8.1.27 (FreeBSD)
File Line Function
/global.php(872) : eval()'d code 26 errorHandler->error
/global.php 872 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (FreeBSD)
File Line Function
/printthread.php 165 errorHandler->error



Official Murl Engine Forum
Mutliplayer - Printable Version

+- Official Murl Engine Forum (https://murlengine.com/forum)
+-- Forum: Murl Engine (https://murlengine.com/forum/forumdisplay.php?fid=5)
+--- Forum: Murl Platform (https://murlengine.com/forum/forumdisplay.php?fid=10)
+--- Thread: Mutliplayer (/showthread.php?tid=43)



Mutliplayer - SteZZz - 23 Aug 2013

I figured that this is a new project, and I just have to say I love it!
I guess I wanna make a multiplayer game, and I have seen in the API that there are some server client functions build into this framework.
But for the rest no tutorials or documentation besides the api.
So is it possible to build a multiplayer game with MurlEngine?

Many thnxs in advanced and keep up the good work ;-)


RE: Mutliplayer - Andy - 28 Aug 2013

(23 Aug 2013, 0:43)SteZZz Wrote: I figured that this is a new project, and I just have to say I love it!
I guess I wanna make a multiplayer game, and I have seen in the API that there are some server client functions build into this framework.
But for the rest no tutorials or documentation besides the api.
So is it possible to build a multiplayer game with MurlEngine?

Many thnxs in advanced and keep up the good work ;-)

Thanks for your reply!
Yes it is possible to create a multiplayer game and you are right, there is currently no tutorial for network support available (that's one of the reasons why the engine is still in public beta).

We have some regression tests using the client/server classes, see the attached source files. Unfortunately the test code is undocumented, but if you are familiar with C++ programming and networking you should get the idea.

To add the classes to a tutorial logic code you can simply implement the following (hello_world v3):

In your hello_world_logic.h file:

#include "app_socket_client_logic.h"
#include "app_socket_server_logic.h"

class HelloWorldLogic : public Logic::BaseProcessor
{
public:
HelloWorldLogic(Logic::IFactory* factory);
virtual ~HelloWorldLogic();

protected:
virtual Bool OnInit(const Logic::IState* state);

private:
SocketClientLogic mSocketClientLogic;
SocketServerLogic mSocketServerLogic;
};

In your hello_world_logic.cpp file:

App::HelloWorldLogic::HelloWorldLogic(Logic::IFactory* factory)
: BaseProcessor(factory)
, mSocketClientLogic(factory)
, mSocketServerLogic(factory)
{
}

Bool App::HelloWorldLogic::OnInit(const Logic::IState* state)
{
IAppConfiguration* config = state->GetAppConfiguration();
if (config->GetPlatformConfiguration()->IsTargetClassMatching(IEnums::TARGET_CLASS_COMPUTER))
{
AddChild(mSocketServerLogic);
}
else
{
AddChild(mSocketClientLogic);
}

...
}

Don't forget to add the app_socket_client_logic.cpp and app_socket_server_logic.cpp to the project / makefile.

This example starts the server on a desktop computer and the client on mobile devices.

The test shows only some console outputs, but you can see how it works.

The test server uses broadcasts to announce to the clients, this works only within local networks (depending on your router configuration), so if you want to connect via wide area networks you have to specify the server name/ip on the client side.

I hope this will help you for now.

best regards
Andy