spaces.are.evil
New Member
I have been attempting to get looping messages from the database on my epoch server. I have run into a snag and cannot figure this out. Hopefully with the help of the community we can get this figured out and working on the Epoch servers.
First and foremost, we need a table in the database to store our messages, as this does not come with epoch. I am hosted with Dayz.st and created this table through phpmyadmin the first time. I was in the dayz.st IRC chat and someone linked a pastebin of a CREATE TABLE sql statement for the message. I slightly modified it (removed foreign key relations) so that it will insert into an Epoch database. Here is the statement:
This should create the message table in the database. Of course you will need to add a message to the database. This is a copy from the dayz.st wiki on the fields when inserting values
ID - This is sequential, start with the number 1 (will auto-increment if left blank)
PAYLOAD - the actual message you want displayed
LOOP_INTERVAL - how many SECONDS before this message displays again
START_DELAY - how many SECONDS before this message starts the first display
INSTANCE_ID - select your instance ID, do NOT leave it null
Next I tried using the dayz.st wiki page on looping messages through database, which required modification to the sever_cleanup.fsm and server_monitor.sqf files.
Here is a link to 2 different versions, both of which seem to be the same. The instructions for taviana are more separated than the dayz.st wiki, but i tried both ways.
http://dayz.st/w/Loop_Messages_from_DB
http://opendayz.net/threads/taviana-2-0-looping-database-messages-tutorial.11177/
The problem that I get is once the server is up and running, no messages come through and the arma2OAserver.rpt file generates an error:
This error is generated no matter what version I use for adding looping messages, and I cannot figure out for the life of me why it is happening.
The part of code that is bugging on is this:
To me, it seems like the query result is empty even with the message table populated. The name of the tables match, and so do the columns.
Anyone have a clue on this, because I am lost and would really like to see this functionality brought to Epoch servers.
First and foremost, we need a table in the database to store our messages, as this does not come with epoch. I am hosted with Dayz.st and created this table through phpmyadmin the first time. I was in the dayz.st IRC chat and someone linked a pastebin of a CREATE TABLE sql statement for the message. I slightly modified it (removed foreign key relations) so that it will insert into an Epoch database. Here is the statement:
Code:
CREATE TABLE IF NOT EXISTS `message` (
`id` smallint(6) NOT NULL AUTO_INCREMENT,
`payload` varchar(1024) NOT NULL,
`loop_interval` int(10) unsigned NOT NULL DEFAULT '0',
`start_delay` int(10) unsigned NOT NULL DEFAULT '30',
`instance_id` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
This should create the message table in the database. Of course you will need to add a message to the database. This is a copy from the dayz.st wiki on the fields when inserting values
ID - This is sequential, start with the number 1 (will auto-increment if left blank)
PAYLOAD - the actual message you want displayed
LOOP_INTERVAL - how many SECONDS before this message displays again
START_DELAY - how many SECONDS before this message starts the first display
INSTANCE_ID - select your instance ID, do NOT leave it null
Next I tried using the dayz.st wiki page on looping messages through database, which required modification to the sever_cleanup.fsm and server_monitor.sqf files.
Here is a link to 2 different versions, both of which seem to be the same. The instructions for taviana are more separated than the dayz.st wiki, but i tried both ways.
http://dayz.st/w/Loop_Messages_from_DB
http://opendayz.net/threads/taviana-2-0-looping-database-messages-tutorial.11177/
The problem that I get is once the server is up and running, no messages come through and the arma2OAserver.rpt file generates an error:
Code:
23:17:09 Error in expression <compile format ["%1", _data];
_status = _result select 0;
msgList = [];
_msgCou>
23:17:09 Error position: <_result select 0;
msgList = [];
_msgCou>
23:17:09 Error Undefined variable in expression: _result
23:17:09 File z\addons\dayz_server\system\server_monitor.sqf, line 225
This error is generated no matter what version I use for adding looping messages, and I cannot figure out for the life of me why it is happening.
The part of code that is bugging on is this:
Code:
_key = format["CHILD:999:select m.payload, m.loop_interval, m.start_delay from message m where m.instance_id = ?:[%1]:", dayZ_instance];
_data = "HiveEXT" callExtension _key;
diag_log("SERVER: Fetching messages...");
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
To me, it seems like the query result is empty even with the message table populated. The name of the tables match, and so do the columns.
Anyone have a clue on this, because I am lost and would really like to see this functionality brought to Epoch servers.