and i am using a database table for the languages and types for the messages. it was simpler to do this way then add a whole lot of extra config code for each language.
The database table server_message.sql
Code: Select all
/*
MySQL Data Transfer
Source Host: localhost
Source Database: database
Target Host: localhost
Target Database: database
Date: 9/19/2013 9:29:35 AM
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for server_message
-- ----------------------------
CREATE TABLE `server_message` (
`server_message` varchar(230) NOT NULL DEFAULT 'Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you',
`id` int(1) unsigned NOT NULL DEFAULT '1',
`lang_name` varchar(200) NOT NULL DEFAULT 'noname',
PRIMARY KEY (`server_message`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `server_message` VALUES ('FFXI - Aplha開発プロジェクトへようこそ!', '1', 'Japanese');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '2', 'English');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '3', 'Englsih Japanese');
INSERT INTO `server_message` VALUES ('Bitte besuchen Sie für die neuesten Informationen über das Projekt. \ NAuch http://forums.dspt.info/, zögern Sie nicht uns im IRC-Netzwerk Rizon # darkstarproject \ nDanke beitreten', '4', 'German');
INSERT INTO `server_message` VALUES ('Bitte besuchen Sie für die neuesten Informationen über das Projekt. \ NAuch http://forums.dspt.info/, zögern Sie nicht uns im IRC-Netzwerk Rizon # darkstarproject \ nDanke beitreten', '5', 'German Japanese');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '6', 'English German');
INSERT INTO `server_message` VALUES ('Veuillez visiter http://forums.dspt.info/ pour les dernières informations sur le projet. \ NVérifiez également, n'hésitez pas à nous rejoindre sur IRC Rizon réseau # darkstarproject \ nMerci', '8', 'French ');
INSERT INTO `server_message` VALUES ('Veuillez visiter http://forums.dspt.info/ pour les dernières informations sur le projet. \ NVérifiez également, n'hésitez pas à nous rejoindre sur IRC Rizon réseau # darkstarproject \ nMerci', '9', 'French Japanese ');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '10', 'English French ');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '11', 'Englsih French Japanese');
INSERT INTO `server_message` VALUES ('Bienvenue dans un FFXI - Projet de développement Aplha!', '12', 'French Greman');
INSERT INTO `server_message` VALUES ('Bienvenue dans un FFXI - Projet de développement Aplha!', '13', 'French German Japanese ');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '14', 'Englsih French German');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '15', 'Englsih French German Japanese');
INSERT INTO `server_message` VALUES (' ברוכים הבאים ל- FFXI פרויקט פיתוח Aplha!', '16', 'Other');
INSERT INTO `server_message` VALUES ('FFXI - Aplha開発プロジェクトへようこそ!', '17', 'Japanese Other');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '18', 'Englsih Other');
INSERT INTO `server_message` VALUES ('Bitte besuchen Sie für die neuesten Informationen über das Projekt. \ NAuch http://forums.dspt.info/, zögern Sie nicht uns im IRC-Netzwerk Rizon # darkstarproject \ nDanke beitreten', '20', 'German Other');
INSERT INTO `server_message` VALUES ('Bitte besuchen Sie für die neuesten Informationen über das Projekt. \ NAuch http://forums.dspt.info/, zögern Sie nicht uns im IRC-Netzwerk Rizon # darkstarproject \ nDanke beitreten', '21', 'German Japanese Other');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '23', 'English German Japanese Other');
INSERT INTO `server_message` VALUES ('Bienvenue dans un FFXI-Projet de développement Aplha!', '24', 'French Other');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '26', 'Englsih French Other');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '27', 'English French Japanese Other');
INSERT INTO `server_message` VALUES ('Veuillez visiter http://forums.dspt.info/ pour les dernières informations sur le projet. \ NVérifiez également, n'hésitez pas à nous rejoindre sur IRC Rizon réseau # darkstarproject \ nMerci', '28', 'French German Other');
INSERT INTO `server_message` VALUES ('Veuillez visiter http://forums.dspt.info/ pour les dernières informations sur le projet. \ NVérifiez également, n'hésitez pas à nous rejoindre sur IRC Rizon réseau # darkstarproject \ nMerci', '29', 'French German Japanese Other');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '30', 'English French German Other');
INSERT INTO `server_message` VALUES ('Please visit http://forums.dspt.info/ for the latest information on the project.\nAlso, feel free to join us on IRC Rizon network #darkstarproject\nThank you', '31', 'English French German Japanese Other');
the pack im using is this one it seems to display the message every time on login.
Code: Select all
void SmallPacket0x0DB(map_session_data_t* session, CCharEntity* PChar, int8* data)
{
//server_message server_message
PChar->search.language = RBUFB(data,(0x24));
string_t server_message = "Welcome To Darkstar";
const char * Query = "SELECT server_message FROM server_message WHERE id= '%u';"; //YOU CAN DO THIS WILL IT TO GET THE ID OF THE PLAYER LANGUAGE TO THEN SUBMIT THE CORRECT MESSAGE
int32 ret3 = Sql_Query(SqlHandle,Query,PChar->search.language);
if (ret3 != SQL_ERROR && Sql_NumRows(SqlHandle) != 0 && Sql_NextRow(SqlHandle) == SQL_SUCCESS)//START DATABASE SELECTION
{
server_message = Sql_GetData(SqlHandle,0);
char buf[230];//I THIN K MAX CHARS CAN BE 230 THATS WHAT THE MAP.conf Said!
sprintf(buf,"%s",server_message.c_str());
PChar->pushPacket(new CServerMessagePacket(("%s",buf),PChar->search.language));
}
else
{
PChar->pushPacket(new CServerMessagePacket(("%s",server_message.c_str()),PChar->search.language));
}
return;
}