Jump to content
Lorenz94

Serialization Problem

Recommended Posts

Hi guys! I have another kind question for you!

 

I'm having a problem with a FPS counter that gives a problem about "serialization not supported" only to certain clients and only on a dedicated server.

 

The counter is composed by an .hpp and two sqfs (one to collect server side FPS, the other for client's FPS).

 

Each sqf file begin with "disableSerialization" and similar interfaces (similar in structure to this particular hpp) work ok without problems.

 

What am I doing wrong?

Thank you for your help!

 

Spoiler

//HPP

class fps_counter
{
	idd = 16050;
	name = "fps_counter";
	movingEnable = 0;
	fadein = 0;
	fadeout = 0;
	duration = 1e+011;
	onLoad = "disableSerialization; uiNamespace setVariable ['fpsCounter', param [0]]";
	onUnLoad = "disableSerialization; uiNamespace setVariable ['fpsCounter', nil]";
....
};

//Get Server FPS
disableSerialization;

[] spawn {
	while {true} do {
		if (isServer) then {
			serverFPS = diag_fps;
			publicVariable "serverFPS";
		};
		//Refresh Rate
		sleep 5;
	};
};

//Display counter
disableSerialization;

//5" after mission start
sleep 5;

[] spawn {
	while {true} do {

		_fpsCounter = findDisplay 16050;
		_clientFPS = round diag_fps;

		if (isNil "_fpsCounter" || isNull _fpsCounter) then {
			"fps_counter" cutRsc ["fps_counter", "PLAIN"];
			_fpsCounter = uiNamespace getVariable "fpsCounter";
		};

		//Client
		(_fpsCounter displayCtrl 14050) ctrlSetText str _clientFPS;
		(_fpsCounter displayCtrl 14050) ctrlSetTextColor [1,1,1,0.68];

		//Server
		(_fpsCounter displayCtrl 14051) ctrlSetText str (round serverFPS);
		(_fpsCounter displayCtrl 14051) ctrlSetTextColor [1,1,1,0.68];
		//Refresh Rate
		sleep 3;
	};
};

 

 

Share this post


Link to post
Share on other sites

I think you need to put the disableSerialization inside the spawns

 

 

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, gc8 said:

I think you need to put the disableSerialization inside the spawns

 

 

Also tried this, forgot to mention! The fact is that the error is prompted to random peolple, not all guys playing! Very strange

Share this post


Link to post
Share on other sites

As @gc8 stated, you need to put it inside. The last one that is. It should work. Remove all other use of the command, especially in the onLoad and onUnload part.

[] spawn
{
	disableSerialization;
	_fpsCounter = findDisplay 16050;
	while {true} do
	{

Note how I also moved the _fpsCounter variable outside of the while loop. It isn't needed there.

  • Like 1

Share this post


Link to post
Share on other sites
11 hours ago, HazJ said:

As @gc8 stated, you need to put it inside. The last one that is. It should work. Remove all other use of the command, especially in the onLoad and onUnload part.


[] spawn
{
	disableSerialization;
	_fpsCounter = findDisplay 16050;
	while {true} do
	{

Note how I also moved the _fpsCounter variable outside of the while loop. It isn't needed there.

Tried, this morning with two other guys I got no error, the other two still have it! We have the same startup parameters.

Share this post


Link to post
Share on other sites

How do you call the file? Can you pack your mission and upload it somewhere so I can have a look?

Share this post


Link to post
Share on other sites
17 hours ago, HazJ said:

How do you call the file? Can you pack your mission and upload it somewhere so I can have a look?

"//Get Server FPS" is execVMed from initServer.sqf, and "//Display Counter" is execVMed from initPlayerLocal.sqf.

 

I can't pack the mission right now, sorry! Anyway, hosted multiplayer DOES NOT throw the error, it's a dedicated server issue only (and as I said before, most every other is having this error, but not me! I have no custom parameters activated).

 

The counter anyway works for everybody, but it's nasty to have an error for "no reason".

 

Thank you.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×