Network
Overview
Effekseer embed the server function on the application side, While the application is running, you can change the effect used by the application from Effekseer in real time.
Setting of the server function
Please refer "Runtime/NetworkServer.sln".
To create a server you call the "::Effekseer::Server::Create" function. To start the server, you call the "::Effekseer::Server::Start" function. You can set the port number when you start the application. Effects make real-time changes after connecting with Effekseer.
static ::Effekseer::Server* g_server = NULL;
// Create a server
g_server = Effekseer::Server::Create();
// Start the server with port number 60000
g_server->Start( 60000 );
Registering of effects
You need to register the effect you want to change from Effekseer on the server. An effect is registered with "Effekseeer::Server::Regist". It is necessary to set a character string when registering. For this string, specify a name that does not include the extension of the source file of the effect you want to edit. For example, please set the character string "test" as the target to send "test.efkproj" change. In other words, if the file name is different only in the directory, the change may not be applied correctly.
Since Regist is incorrect as English, function names may change in the future.
g_server->Regist( (const EFK_CHAR*)L"test", g_effect );
Updating server
The server needs to update every frame before updating "Effekseer::Manager".
g_server->Update();
For example, if you register an effect on the server with the name "test" and edit the file "test.efkproj" The effect displayed in the application will change in real time according to Effekseer's setting. In addition, texture modification is possible if texture exists also on the application side.
Setting of the client function
Please refer "Runtime/NetworkClient.sln"
Although you rarely use it, you can change the effect not only from Effekseer but also with the client function. Using "Effekseer::Client::Create", create a client and make a connection using "Effekseer::Client::Start". Use "Effekseer::Client::Reload" for sending data.
static ::Effekseer::Client* g_client = NULL;
// Create a server
g_client = Effekseer::Client::Create();
// Connet the client with port number 60000
g_client->Start( "127.0.0.1", 60000 );
// Send data
g_client->Reload( g_manager, (const EFK_CHAR*)L"test_reload.efk", (const EFK_CHAR*)L"test" );