From a7504e657ea68742bfd20ca13de8d07730b678f0 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 9 May 2019 06:57:04 +0800 Subject: [PATCH 01/16] Removed: Deprecated bot chat news manager --- code/ryzom/client/src/net_manager.cpp | 1 - code/ryzom/common/src/game_share/news_types.h | 36 - .../server/src/ai_service/aids_interface.h | 1 - .../src/ai_service/bot_chat_interface.cpp | 1160 ----------------- .../src/ai_service/bot_chat_interface.h | 58 - .../input_output_service.cpp | 2 - .../src/input_output_service/news_manager.cpp | 83 -- .../src/input_output_service/news_manager.h | 60 - .../server/src/input_output_service/stdpch.h | 1 - 9 files changed, 1402 deletions(-) delete mode 100644 code/ryzom/common/src/game_share/news_types.h delete mode 100644 code/ryzom/server/src/ai_service/bot_chat_interface.cpp delete mode 100644 code/ryzom/server/src/ai_service/bot_chat_interface.h delete mode 100644 code/ryzom/server/src/input_output_service/news_manager.cpp delete mode 100644 code/ryzom/server/src/input_output_service/news_manager.h diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 2d5a4e2be..d8ccbc263 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -25,7 +25,6 @@ #include "game_share/generic_xml_msg_mngr.h" #include "game_share/msg_client_server.h" #include "game_share/bot_chat_types.h" -#include "game_share/news_types.h" #include "game_share/mode_and_behaviour.h" #include "game_share/chat_group.h" #include "game_share/character_summary.h" diff --git a/code/ryzom/common/src/game_share/news_types.h b/code/ryzom/common/src/game_share/news_types.h deleted file mode 100644 index e9427766a..000000000 --- a/code/ryzom/common/src/game_share/news_types.h +++ /dev/null @@ -1,36 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#ifndef RY_NEWS_TYPES_H -#define RY_NEWS_TYPES_H - -namespace NEWSTYPE -{ - enum TNewsType - { - Unknown, - General, - FyrosWorker, - FyrosTrainer, - FyrosGeneral, - }; -}; - -#endif // RY_NEWS_TYPES_H - -/* End of news_types.h */ diff --git a/code/ryzom/server/src/ai_service/aids_interface.h b/code/ryzom/server/src/ai_service/aids_interface.h index 21b8c76bd..3e9d9898f 100644 --- a/code/ryzom/server/src/ai_service/aids_interface.h +++ b/code/ryzom/server/src/ai_service/aids_interface.h @@ -23,7 +23,6 @@ // Nel Misc #include "nel/misc/types_nl.h" #include "nel/misc/entity_id.h" -#include "game_share/news_types.h" #include "game_share/bot_chat_types.h" // the class diff --git a/code/ryzom/server/src/ai_service/bot_chat_interface.cpp b/code/ryzom/server/src/ai_service/bot_chat_interface.cpp deleted file mode 100644 index 36dc9aa42..000000000 --- a/code/ryzom/server/src/ai_service/bot_chat_interface.cpp +++ /dev/null @@ -1,1160 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#include "stdpch.h" -#if 0 -#error "Deprecated" -//#include "bot_chat_interface.h" -#include "game_share/synchronised_message.h" -#include "game_share/bot_chat_types.h" - -/* -// Nel Misc -#include "nel/net/unified_network.h" - -// Game share -#include "game_share/news_types.h" -#include "game_share/bot_chat_types.h" - -// Local includes -#include "bot_chat_interface.h" -*/ - -using namespace NLMISC; -using namespace NLNET; -using namespace std; - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -// the parent class for bot chat page type classes - -class CBotChatPageType -{ -public: - // virtual interface ---------------------------------------------------- - virtual bool open(const CEntityId &player, const CEntityId &bot)=0; - virtual bool close(const CEntityId &player, const CEntityId &bot)=0; -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for bot chat pages - -struct SBotChatPage -{ - // ctor ----------------------------------------------------------------- - SBotChatPage( - BOTCHATTYPE::TBotChatInterfaceId clientInterfaceId, - CBotChatPageType * chatPageType, - uint numOptions - ) - { - ClientInterfaceId= clientInterfaceId; - PageType= chatPageType; - NumOptions= numOptions; - } - - // data ----------------------------------------------------------------- - BOTCHATTYPE::TBotChatInterfaceId ClientInterfaceId; // id of interface to display on client - CBotChatPageType * PageType; // type of chat page - uint NumOptions; // number of options for player to click on -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for a state for bot chat automatons - -struct SBotChatAutomatonState -{ - // public data ---------------------------------------------------------- - SBotChatPage *Page; - uint On[5]; // value to return on player click of slot 0..4 - - // ctor ----------------------------------------------------------------- - SBotChatAutomatonState(SBotChatPage *page,uint on0=std::numeric_limits::max(),uint on1=std::numeric_limits::max(),uint on2=std::numeric_limits::max(),uint on3=std::numeric_limits::max(),uint on4=std::numeric_limits::max()) - { - Page=page; - On[0]=on0; - On[1]=on1; - On[2]=on2; - On[3]=on3; - On[4]=on4; - - // make sure the number of arguments supplied corresponds to the - // number of options prresent on the user interfac page - nlassert(page->NumOptions>=0 && page->NumOptions<=4); - nlassert(page->NumOptions==0 || On[page->NumOptions-1]!=std::numeric_limits::max()); - nlassert(page->NumOptions==4 || On[page->NumOptions]==std::numeric_limits::max()); - } -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for a bot chat automatons & a singleton for indexing -// automatons by name - -struct SBotChatAutomaton -{ - // public data ---------------------------------------------------------- - string Name; - SBotChatAutomatonState *States; - uint Size; - - // ctor ----------------------------------------------------------------- - SBotChatAutomaton(string name, SBotChatAutomatonState *states,uint size) - { - Name=name; - States=states; - Size=size; - - if (NameMap.find(name)!=NameMap.end()) - { - nlwarning("SBotChatAutomaton::SBotChatAutomaton(): More than one instance with name: %s",name.c_str()); - return; - } - NameMap[name]=this; - } - - // dtor ----------------------------------------------------------------- - ~SBotChatAutomaton() - { - map ::iterator it=NameMap.find(Name); - if (it!=NameMap.end() && (*it).second==this) - NameMap.erase(it); - // don't try to display a warning in a dtor as the warning system is - // probably already down - } - - - // singleton methods ---------------------------------------------------- - static SBotChatAutomaton *getAutomatonByName(string name) - { - map ::iterator it=NameMap.find(name); - if (it==NameMap.end()) - return NULL; - return (*it).second; - } - - // singleton data ------------------------------------------------------- - static map NameMap; -}; -map SBotChatAutomaton::NameMap; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Implementation of different code modules for handling different bot -// chat page types - -////////////////////////////////////////////////////////////////////////////// -// this is a dummy page used to terminate chats - -class CBotChatPageTypeDone: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return false; // stop the bot chat! - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return false; - } -} -BotChatPageTypeDone; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that contains static text and buttons for -// player to click on/ select - -class CBotChatPageTypeTextOnly: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return true; - } -} -BotChatPageTypeTextOnly; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays NEWS as well as other text - -class CBotChatPageTypeNews: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return true; - } -} -BotChatPageTypeNews; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays a SHOP interface - -class CBotChatPageTypeShop: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("player %s entered trade page", player.toString().c_str()); - CMessage msgout( "TRADE_BEGIN" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("end of trade with player %s", player.toString().c_str()); - CMessage msgout( "TRADE_END" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - sendMessageViaMirror( "EGS", msgout ); - return true; - } -} -BotChatPageTypeShop; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays a MISSION SHOP interface - -class CBotChatPageTypeMissionShop: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("player %s entered mission page", player.toString().c_str()); - CMessage msgout( "MISSION_LIST_BEGIN" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("end of mission page with player %s", player.toString().c_str()); - CMessage msgout( "MISSION_LIST_END" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "EGS", msgout ); - return true; - } -} -BotChatPageTypeMissionShop; - - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Definitions of bot chat pages and automatons - -// define the usable bot chat pages ------------------------------------------ -SBotChatPage BotChatPageIntro (BOTCHATTYPE::Intro, &BotChatPageTypeTextOnly, 4); -SBotChatPage BotChatPageFriendly (BOTCHATTYPE::FriendlyMainPage, &BotChatPageTypeNews, 4); -SBotChatPage BotChatPageNeutral (BOTCHATTYPE::NeutralMainPage, &BotChatPageTypeNews, 3); -SBotChatPage BotChatPageHostile (BOTCHATTYPE::NastyMainPage, &BotChatPageTypeTextOnly, 1); -SBotChatPage BotChatPageMoreNews (BOTCHATTYPE::MoreNewsPage, &BotChatPageTypeNews, 2); -SBotChatPage BotChatPageShop (BOTCHATTYPE::BuySellPage, &BotChatPageTypeShop, 2); -SBotChatPage BotChatPageMissionShop (BOTCHATTYPE::MissionsPage, &BotChatPageTypeMissionShop, 2); -SBotChatPage BotChatPageDone (BOTCHATTYPE::Done, &BotChatPageTypeDone, 0); - -// the default automaton ----------------------------------------------------- -SBotChatAutomatonState BotChatStatesDefault[]= -{ - SBotChatAutomatonState(&BotChatPageIntro,2,3,4,1), // 0 - friendly/ neutral/ hostile/ done - SBotChatAutomatonState(&BotChatPageDone), // 1 - SBotChatAutomatonState(&BotChatPageFriendly,5,6,7,1), // 2 - more news/ buy sell/ mission/ done - SBotChatAutomatonState(&BotChatPageNeutral,6,7,1), // 3 - buy sell/ mission/ done - SBotChatAutomatonState(&BotChatPageHostile,1), // 4 - done - SBotChatAutomatonState(&BotChatPageMoreNews,2,1), // 5 - friendly/ done - SBotChatAutomatonState(&BotChatPageShop,3,1), // 6 - neutral/ done - SBotChatAutomatonState(&BotChatPageMissionShop,3,1), // 7 - neutral/ done -}; -SBotChatAutomaton BotChatDefault("default",BotChatStatesDefault,sizeof(BotChatStatesDefault)/sizeof(BotChatStatesDefault[0])); - -// the automaton for merchants ----------------------------------------------- -SBotChatAutomatonState BotChatStatesMerchant[]= -{ - SBotChatAutomatonState(&BotChatPageMoreNews,2,1), // 0 - shop/ done - SBotChatAutomatonState(&BotChatPageDone), // 1 - SBotChatAutomatonState(&BotChatPageShop,0,1), // 2 - news/ done -}; -SBotChatAutomaton BotChatMerchant("merchant",BotChatStatesMerchant,sizeof(BotChatStatesMerchant)/sizeof(BotChatStatesMerchant[0])); - -// the automaton for walkers and talkers ------------------------------------- -SBotChatAutomatonState BotChatStatesWalkerTalker[]= -{ - SBotChatAutomatonState(&BotChatPageHostile,1), // 0 - SBotChatAutomatonState(&BotChatPageDone) // 1 -}; -SBotChatAutomaton BotChatWalkerTalker("walker talker",BotChatStatesWalkerTalker,sizeof(BotChatStatesMerchant)/sizeof(BotChatStatesMerchant[0])); - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Represetnation of a conversation between a player and a bot -// includes conversation automaton state data - -struct CBotChat -{ - CBotChat () : Player(CEntityId::Unknown), Bot(CEntityId::Unknown) { } - CBotChat (CEntityId player, CEntityId bot, SBotChatAutomaton *automaton) - { - Player=player; - Bot=bot; - setAutomaton(automaton); - } - - void setState(uint32 state) - { - if (state>=Automaton->Size && state!=std::numeric_limits::max()) - { - nlwarning("CBotChatEntry()::setState: Invalid state: %d",state); - return; - } - - // if there is already a page open close it - if (CurrentStateSize) - Automaton->States[CurrentState].Page->PageType->close(Player,Bot); - - // open the new page - CurrentState=state; - if (state==std::numeric_limits::max()) - Done=true; - else - Done=!Automaton->States[CurrentState].Page->PageType->open(Player,Bot); - - // transmit the new page id to the client - uint32 happyness=10; - BOTCHATTYPE::TBotChatInterfaceId interfaceId=Done?BOTCHATTYPE::Done:Automaton->States[CurrentState].Page->ClientInterfaceId; - NEWSTYPE::TNewsType newsType=NEWSTYPE::Unknown; - - CMessage msgout("BOT_CHAT_SELECT_INTERFACE"); - msgout.serial (Player); - msgout.serial (happyness); - msgout.serialEnum (interfaceId); - msgout.serialEnum (newsType); - sendMessageViaMirror("IOS", msgout); - } - - void setAutomaton(SBotChatAutomaton *automaton) - { - Automaton=automaton; - CurrentState=std::numeric_limits::max(); // set this to a ~0 so that setState doesn't try to clse existing page - setState(0); - } - - void selectEntry (sint8 userInput) - { - // select the new page - if ((unsigned)userInput >= Automaton->States[CurrentState].Page->NumOptions) - { - nlwarning ("CBotChatEntry::selectEntry: For player %s: input out of bounds: %d", Player.toString().c_str(), userInput); - return; - } - - // advance through the state table - setState(Automaton->States[CurrentState].On[userInput]); - } - - void endChat () - { - setState(std::numeric_limits::max()); - } - - CEntityId Player; - CEntityId Bot; - SBotChatAutomaton *Automaton; - uint32 CurrentState; - bool Done; -}; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Singleton manager class central to the bot chat system - -class CBotChatManager -{ -public: - - static void newChat(CEntityId player, CEntityId bot) - { - // make sure the player isn't already chatting - map::iterator it = BotChatMap.find (player); - if (it != BotChatMap.end()) - return; - - // a bit of logging - nlinfo ("new chat between player %s and bot %s", player.toString().c_str(), bot.toString().c_str()); - - // call the CbBegin() callback to get the name of the automaton to use - string automatonName; - if (CbBegin!=NULL) - automatonName=CbBegin(player,bot); - else - automatonName="default"; - SBotChatAutomaton *automaton=SBotChatAutomaton::getAutomatonByName(automatonName); - if (automaton==NULL) - { - nlwarning("- ignoring bot chat request as automaton '%s' not found",automatonName.c_str()); - return; - } - - // setup the new chat - BotChatMap[player] = CBotChat(player, bot, automaton); - } - - static void endChat(CEntityId player) - { - CEntityId bot; // for use in callback ... at end of routine - - map::iterator it = BotChatMap.find (player); - if (it != BotChatMap.end()) - { - bot=(*it).second.Bot; - - nlinfo ("end of bot chat between player %s and bot %s", player.toString().c_str(),bot.toString().c_str()); - - // if the chat is still active then stop it - if ((*it).second.Done) - (*it).second.endChat(); - - // remove the map entry - BotChatMap.erase (it); - - // **** this code may be dodgy 'cos its in a dtor - // **** if it is dodgy then we need to migrate from an STL map - // **** to some kind of custom structure that we can guarantee OK - } - - if (CbEnd!=NULL) - CbEnd(player,bot); - } - - static void treatInput(CEntityId player, sint8 userInput) - { - // locate the bot chat for the given player - map::iterator it = BotChatMap.find (player); - if (it == BotChatMap.end()) - { - nlwarning ("No bot chat with the player %s", player.toString().c_str()); - return; - } - - // pass the player input to the bot chat handler - (*it).second.selectEntry(userInput); - - // check whether the bot chat is finished - if ((*it).second.Done) - endChat(player); - } - - - // static data for the singleton ----------------------------------------- - static CBotChatInterface::TCallbackBegin CbBegin; - static CBotChatInterface::TCallbackEnd CbEnd; - static map BotChatMap; -}; -CBotChatInterface::TCallbackBegin CBotChatManager::CbBegin; -CBotChatInterface::TCallbackEnd CBotChatManager::CbEnd; -map CBotChatManager::BotChatMap; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// message callbacks and callback table - -static void cbBotChatStart (CMessage& msgin, const string &serviceName, uint16 serviceId ) -{ - CEntityId player, bot; - - msgin.serial( player ); - msgin.serial( bot ); - - CBotChatManager::newChat (player, bot); -} - -static void cbBotChatSelectAnswer (CMessage& msgin, const string &serviceName, uint16 serviceId ) -{ - CEntityId player, bot; - sint8 answer; - - msgin.serial( player ); - msgin.serial( answer ); - - CBotChatManager::treatInput (player, answer); -} - - -static TUnifiedCallbackItem CbArray[]= -{ - { "BOT_CHAT_START", cbBotChatStart }, - { "BOT_CHAT_SELECT_ANSWER", cbBotChatSelectAnswer }, -}; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Interface class providing API for bot chat system - -void CBotChatInterface::init(CBotChatInterface::TCallbackBegin cbBegin,CBotChatInterface::TCallbackEnd cbEnd) -{ - CBotChatManager::CbBegin=cbBegin; - CBotChatManager::CbEnd=cbEnd; - CUnifiedNetwork::getInstance()->addCallbackArray(CbArray, sizeof (CbArray) / sizeof (CbArray[0])); -} - -void CBotChatInterface::release() -{ -} - -void CBotChatInterface::getBotChatPartners(CEntityId bot,vector &result) -{ - map::iterator it; - for (it=CBotChatManager::BotChatMap.begin();it!=CBotChatManager::BotChatMap.end();++it) - if ((*it).second.Bot==bot) - result.push_back((*it).first); -} - -void CBotChatInterface::endChatForPlayer(CEntityId player) -{ - CBotChatManager::endChat(player); -} - -void CBotChatInterface::endAllChatForBot(CEntityId bot) -{ - map::iterator it=CBotChatManager::BotChatMap.begin(); - while (it!=CBotChatManager::BotChatMap.end()) - { - map::iterator next=it; - if ((*it).second.Bot==bot) - CBotChatManager::endChat((*it).first); - it=next; - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -////////////////////// -/// The following is probably out of date but I'm copying it here just in case... - - - -#if 0 - - - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -// the parent class for bot chat page type classes - -class CBotChatPageType -{ -public: - // virtual interface ---------------------------------------------------- - virtual bool open(const CEntityId &player, const CEntityId &bot)=0; - virtual bool close(const CEntityId &player, const CEntityId &bot)=0; -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for bot chat pages - -struct SBotChatPage -{ - // ctor ----------------------------------------------------------------- - SBotChatPage( - BOTCHATTYPE::TBotChatInterfaceId clientInterfaceId, - CBotChatPageType * chatPageType, - uint numOptions - ) - { - ClientInterfaceId= clientInterfaceId; - PageType= chatPageType; - NumOptions= numOptions; - } - - // data ----------------------------------------------------------------- - BOTCHATTYPE::TBotChatInterfaceId ClientInterfaceId; // id of interface to display on client - CBotChatPageType * PageType; // type of chat page - uint NumOptions; // number of options for player to click on -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for a state for bot chat automatons - -struct SBotChatAutomatonState -{ - // public data ---------------------------------------------------------- - SBotChatPage *Page; - uint On[5]; // value to return on player click of slot 0..4 - - // ctor ----------------------------------------------------------------- - SBotChatAutomatonState(SBotChatPage *page,uint on0=std::numeric_limits::max(),uint on1=std::numeric_limits::max(),uint on2=std::numeric_limits::max(),uint on3=std::numeric_limits::max(),uint on4=std::numeric_limits::max()) - { - Page=page; - On[0]=on0; - On[1]=on1; - On[2]=on2; - On[3]=on3; - On[4]=on4; - - // make sure the number of arguments supplied corresponds to the - // number of options prresent on the user interfac page - nlassert(page->NumOptions>=0 && page->NumOptions<=4); - nlassert(page->NumOptions==0 || On[page->NumOptions-1]!=std::numeric_limits::max()); - nlassert(page->NumOptions==4 || On[page->NumOptions]==std::numeric_limits::max()); - } -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for a bot chat automatons & a singleton for indexing -// automatons by name - -struct SBotChatAutomaton -{ - // public data ---------------------------------------------------------- - string Name; - SBotChatAutomatonState *States; - uint Size; - - // ctor ----------------------------------------------------------------- - SBotChatAutomaton(string name, SBotChatAutomatonState *states,uint size) - { - Name=name; - States=states; - Size=size; - - if (NameMap.find(name)!=NameMap.end()) - { - nlwarning("SBotChatAutomaton::SBotChatAutomaton(): More than one instance with name: %s",name.c_str()); - return; - } - NameMap[name]=this; - } - - // dtor ----------------------------------------------------------------- - ~SBotChatAutomaton() - { - map ::iterator it=NameMap.find(Name); - if (it!=NameMap.end() && (*it).second==this) - NameMap.erase(it); - // don't try to display a warning in a dtor as the warning system is - // probably already down - } - - - // singleton methods ---------------------------------------------------- - static SBotChatAutomaton *getAutomatonByName(string name) - { - map ::iterator it=NameMap.find(name); - if (it==NameMap.end()) - return NULL; - return (*it).second; - } - - // singleton data ------------------------------------------------------- - static map NameMap; -}; -map SBotChatAutomaton::NameMap; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Implementation of different code modules for handling different bot -// chat page types - -////////////////////////////////////////////////////////////////////////////// -// this is a dummy page used to terminate chats - -class CBotChatPageTypeDone: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return false; // stop the bot chat! - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return false; - } -} -BotChatPageTypeDone; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that contains static text and buttons for -// player to click on/ select - -class CBotChatPageTypeTextOnly: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return true; - } -} -BotChatPageTypeTextOnly; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays NEWS as well as other text - -class CBotChatPageTypeNews: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return true; - } -} -BotChatPageTypeNews; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays a SHOP interface - -class CBotChatPageTypeShop: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("player %s entered trade page", player.toString().c_str()); - CMessage msgout( "TRADE_BEGIN" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("end of trade with player %s", player.toString().c_str()); - CMessage msgout( "TRADE_END" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - sendMessageViaMirror( "EGS", msgout ); - return true; - } -} -BotChatPageTypeShop; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays a MISSION SHOP interface - -class CBotChatPageTypeMissionShop: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("player %s entered mission page", player.toString().c_str()); - CMessage msgout( "MISSION_LIST_BEGIN" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("end of mission page with player %s", player.toString().c_str()); - CMessage msgout( "MISSION_LIST_END" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "EGS", msgout ); - return true; - } -} -BotChatPageTypeMissionShop; - - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Definitions of bot chat pages and automatons - -// define the usable bot chat pages ------------------------------------------ -SBotChatPage BotChatPageIntro (BOTCHATTYPE::Intro, &BotChatPageTypeTextOnly, 4); -SBotChatPage BotChatPageFriendly (BOTCHATTYPE::FriendlyMainPage, &BotChatPageTypeNews, 4); -SBotChatPage BotChatPageNeutral (BOTCHATTYPE::NeutralMainPage, &BotChatPageTypeNews, 3); -SBotChatPage BotChatPageHostile (BOTCHATTYPE::NastyMainPage, &BotChatPageTypeTextOnly, 1); -SBotChatPage BotChatPageMoreNews (BOTCHATTYPE::MoreNewsPage, &BotChatPageTypeNews, 2); -SBotChatPage BotChatPageShop (BOTCHATTYPE::BuySellPage, &BotChatPageTypeShop, 2); -SBotChatPage BotChatPageMissionShop (BOTCHATTYPE::MissionsPage, &BotChatPageTypeMissionShop, 2); -SBotChatPage BotChatPageDone (BOTCHATTYPE::Done, &BotChatPageTypeDone, 0); - -// the default automaton ----------------------------------------------------- -SBotChatAutomatonState BotChatStatesDefault[]= -{ - SBotChatAutomatonState(&BotChatPageIntro,2,3,4,1), // 0 - friendly/ neutral/ hostile/ done - SBotChatAutomatonState(&BotChatPageDone), // 1 - SBotChatAutomatonState(&BotChatPageFriendly,5,6,7,1), // 2 - more news/ buy sell/ mission/ done - SBotChatAutomatonState(&BotChatPageNeutral,6,7,1), // 3 - buy sell/ mission/ done - SBotChatAutomatonState(&BotChatPageHostile,1), // 4 - done - SBotChatAutomatonState(&BotChatPageMoreNews,2,1), // 5 - friendly/ done - SBotChatAutomatonState(&BotChatPageShop,3,1), // 6 - neutral/ done - SBotChatAutomatonState(&BotChatPageMissionShop,3,1), // 7 - neutral/ done -}; -SBotChatAutomaton BotChatDefault("default",BotChatStatesDefault,sizeof(BotChatStatesDefault)/sizeof(BotChatStatesDefault[0])); - -// the automaton for merchants ----------------------------------------------- -SBotChatAutomatonState BotChatStatesMerchant[]= -{ - SBotChatAutomatonState(&BotChatPageMoreNews,2,1), // 0 - shop/ done - SBotChatAutomatonState(&BotChatPageDone), // 1 - SBotChatAutomatonState(&BotChatPageShop,0,1), // 2 - news/ done -}; -SBotChatAutomaton BotChatMerchant("merchant",BotChatStatesMerchant,sizeof(BotChatStatesMerchant)/sizeof(BotChatStatesMerchant[0])); - -// the automaton for walkers and talkers ------------------------------------- -SBotChatAutomatonState BotChatStatesWalkerTalker[]= -{ - SBotChatAutomatonState(&BotChatPageHostile,1), // 0 - SBotChatAutomatonState(&BotChatPageDone) // 1 -}; -SBotChatAutomaton BotChatWalkerTalker("walker talker",BotChatStatesWalkerTalker,sizeof(BotChatStatesMerchant)/sizeof(BotChatStatesMerchant[0])); - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Represetnation of a conversation between a player and a bot -// includes conversation automaton state data - -struct CBotChat -{ - CBotChat () : Player(CEntityId::Unknown), Bot(CEntityId::Unknown) { } - CBotChat (CEntityId player, CEntityId bot, SBotChatAutomaton *automaton) - { - Player=player; - Bot=bot; - setAutomaton(automaton); - } - - void setState(uint32 state) - { - if (state>=Automaton->Size && state!=std::numeric_limits::max()) - { - nlwarning("CBotChatEntry()::setState: Invalid state: %d",state); - return; - } - - // if there is already a page open close it - if (CurrentStateSize) - Automaton->States[CurrentState].Page->PageType->close(Player,Bot); - - // open the new page - CurrentState=state; - if (state==std::numeric_limits::max()) - Done=true; - else - Done=!Automaton->States[CurrentState].Page->PageType->open(Player,Bot); - - // transmit the new page id to the client - uint32 happyness=10; - BOTCHATTYPE::TBotChatInterfaceId interfaceId=Done?BOTCHATTYPE::Done:Automaton->States[CurrentState].Page->ClientInterfaceId; - NEWSTYPE::TNewsType newsType=NEWSTYPE::Unknown; - - CMessage msgout("BOT_CHAT_SELECT_INTERFACE"); - msgout.serial (Player); - msgout.serial (happyness); - msgout.serialEnum (interfaceId); - msgout.serialEnum (newsType); - sendMessageViaMirror("IOS", msgout); - } - - void setAutomaton(SBotChatAutomaton *automaton) - { - Automaton=automaton; - CurrentState=std::numeric_limits::max(); // set this to a std::numeric_limits::max() so that setState doesn't try to clse existing page - setState(0); - } - - void selectEntry (sint8 userInput) - { - // select the new page - if ((unsigned)userInput >= Automaton->States[CurrentState].Page->NumOptions) - { - nlwarning ("CBotChatEntry::selectEntry: For player %s: input out of bounds: %d", Player.toString().c_str(), userInput); - return; - } - - // advance through the state table - setState(Automaton->States[CurrentState].On[userInput]); - } - - void endChat () - { - setState(std::numeric_limits::max()); - } - - CEntityId Player; - CEntityId Bot; - SBotChatAutomaton *Automaton; - uint32 CurrentState; - bool Done; -}; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Singleton manager class central to the bot chat system - -class CBotChatManager -{ -public: - - static void newChat(CEntityId player, CEntityId bot) - { - // make sure the player isn't already chatting - map::iterator it = BotChatMap.find (player); - if (it != BotChatMap.end()) - return; - - // a bit of logging - nlinfo ("new chat between player %s and bot %s", player.toString().c_str(), bot.toString().c_str()); - - // call the CbBegin() callback to get the name of the automaton to use - string automatonName; - if (CbBegin!=NULL) - automatonName=CbBegin(player,bot); - else - automatonName="default"; - SBotChatAutomaton *automaton=SBotChatAutomaton::getAutomatonByName(automatonName); - if (automaton==NULL) - { - nlwarning("- ignoring bot chat request as automaton '%s' not found",automatonName.c_str()); - return; - } - - // setup the new chat - BotChatMap[player] = CBotChat(player, bot, automaton); - } - - static void endChat(CEntityId player) - { - CEntityId bot; // for use in callback ... at end of routine - - map::iterator it = BotChatMap.find (player); - if (it != BotChatMap.end()) - { - bot=(*it).second.Bot; - - nlinfo ("end of bot chat between player %s and bot %s", player.toString().c_str(),bot.toString().c_str()); - - // if the chat is still active then stop it - if ((*it).second.Done) - (*it).second.endChat(); - - // remove the map entry - BotChatMap.erase (it); - - // **** this code may be dodgy 'cos its in a dtor - // **** if it is dodgy then we need to migrate from an STL map - // **** to some kind of custom structure that we can guarantee OK - } - - if (CbEnd!=NULL) - CbEnd(player,bot); - } - - static void treatInput(CEntityId player, sint8 userInput) - { - // locate the bot chat for the given player - map::iterator it = BotChatMap.find (player); - if (it == BotChatMap.end()) - { - nlwarning ("No bot chat with the player %s", player.toString().c_str()); - return; - } - - // pass the player input to the bot chat handler - (*it).second.selectEntry(userInput); - - // check whether the bot chat is finished - if ((*it).second.Done) - endChat(player); - } - - - // static data for the singleton ----------------------------------------- - static CBotChatInterface::TCallbackBegin CbBegin; - static CBotChatInterface::TCallbackEnd CbEnd; - static map BotChatMap; -}; -CBotChatInterface::TCallbackBegin CBotChatManager::CbBegin; -CBotChatInterface::TCallbackEnd CBotChatManager::CbEnd; -map CBotChatManager::BotChatMap; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// message callbacks and callback table - -static void cbBotChatStart (CMessage& msgin, const string &serviceName, uint16 serviceId ) -{ - CEntityId player, bot; - - msgin.serial( player ); - msgin.serial( bot ); - - CBotChatManager::newChat (player, bot); -} - -static void cbBotChatSelectAnswer (CMessage& msgin, const string &serviceName, uint16 serviceId ) -{ - CEntityId player, bot; - sint8 answer; - - msgin.serial( player ); - msgin.serial( answer ); - - CBotChatManager::treatInput (player, answer); -} - - -static TUnifiedCallbackItem CbArray[]= -{ - { "BOT_CHAT_START", cbBotChatStart }, - { "BOT_CHAT_SELECT_ANSWER", cbBotChatSelectAnswer }, -}; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Interface class providing API for bot chat system - -void CBotChatInterface::init(CBotChatInterface::TCallbackBegin cbBegin,CBotChatInterface::TCallbackEnd cbEnd) -{ - CBotChatManager::CbBegin=cbBegin; - CBotChatManager::CbEnd=cbEnd; - CUnifiedNetwork::getInstance()->addCallbackArray(CbArray, sizeof (CbArray) / sizeof (CbArray[0])); -} - -void CBotChatInterface::release() -{ -} - -void CBotChatInterface::getBotChatPartners(CEntityId bot,vector &result) -{ - map::iterator it; - for (it=CBotChatManager::BotChatMap.begin();it!=CBotChatManager::BotChatMap.end();++it) - if ((*it).second.Bot==bot) - result.push_back((*it).first); -} - -void CBotChatInterface::endChatForPlayer(CEntityId player) -{ - CBotChatManager::endChat(player); -} - -void CBotChatInterface::endAllChatForBot(CEntityId bot) -{ - map::iterator it=CBotChatManager::BotChatMap.begin(); - while (it!=CBotChatManager::BotChatMap.end()) - { - map::iterator next=it; - if ((*it).second.Bot==bot) - CBotChatManager::endChat((*it).first); - it=next; - } -} - -#endif - -#endif diff --git a/code/ryzom/server/src/ai_service/bot_chat_interface.h b/code/ryzom/server/src/ai_service/bot_chat_interface.h deleted file mode 100644 index 3586b737f..000000000 --- a/code/ryzom/server/src/ai_service/bot_chat_interface.h +++ /dev/null @@ -1,58 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#error "Deprecated" - -#ifndef RYAI_BOT_CHAT_INTERFACE_H -#define RYAI_BOT_CHAT_INTERFACE_H - -// Nel Misc -#include "nel/misc/types_nl.h" -#include "nel/misc/entity_id.h" -#include "game_share/news_types.h" -#include "game_share/bot_chat_types.h" - -// the class -class CBotChatInterface -{ -public: - // the callback type for user callbacks for start of bot chat - // returns the name of the bot chat automaton to use - // if an empty string is returned no bot chat is launched - typedef std::string (*TCallbackBegin)(NLMISC::CEntityId player,NLMISC::CEntityId bot); - - // the callback types for user callback for end of bot chat - // called just after the chat session has been closed - typedef void (*TCallbackEnd)(NLMISC::CEntityId player,NLMISC::CEntityId bot); - -public: - // classic init() and release() - static void init(TCallbackBegin cbBegin=NULL,TCallbackEnd cbEnd=NULL); - static void release(); - - // build a vector of the players currently chatting with a given bot - // this routine may not be very fast as the entire bot chat map is - // parsed in order to build the vector - static void getBotChatPartners(NLMISC::CEntityId bot,std::vector &result); - - // routines to force the end of a bot chat - static void endChatForPlayer(NLMISC::CEntityId player); - static void endAllChatForBot(NLMISC::CEntityId bot); -}; - -#endif diff --git a/code/ryzom/server/src/input_output_service/input_output_service.cpp b/code/ryzom/server/src/input_output_service/input_output_service.cpp index de3d73458..f2cd67d22 100644 --- a/code/ryzom/server/src/input_output_service/input_output_service.cpp +++ b/code/ryzom/server/src/input_output_service/input_output_service.cpp @@ -21,7 +21,6 @@ #include "game_share/tick_event_handler.h" #include "game_share/msg_client_server.h" #include "game_share/mode_and_behaviour.h" //TEMP!!! -#include "game_share/news_types.h" #include "game_share/bot_chat_types.h" #include "game_share/brick_types.h" #include "game_share/loot_harvest_state.h" @@ -35,7 +34,6 @@ #include "nel/misc/command.h" #include "nel/net/message.h" -#include "news_manager.h" #include "string_manager.h" #include "messages.h" //#include "ios_pd.h" diff --git a/code/ryzom/server/src/input_output_service/news_manager.cpp b/code/ryzom/server/src/input_output_service/news_manager.cpp deleted file mode 100644 index b8b093c99..000000000 --- a/code/ryzom/server/src/input_output_service/news_manager.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - -#include "stdpch.h" -#include "news_manager.h" -#include "input_output_service.h" - -//#include "game_share/generic_msg_mngr.h" -#include "game_share/msg_client_server.h" -#include "game_share/news_types.h" - -using namespace std; -using namespace NLMISC; -using namespace NLNET; - -class CNewsEntry -{ -public: - CNewsEntry () : Type(NEWSTYPE::Unknown) { } - CNewsEntry (NEWSTYPE::TNewsType type, const string &stringId, const vector &args) : Type(type), StringId(StringId), Args(args) { } - - NEWSTYPE::TNewsType Type; - string StringId; - vector Args; -}; - -deque News; - -static void cbAddNews (CMessage& msgin, const std::string &serviceName, TServiceId serviceId ) -{ - NEWSTYPE::TNewsType type = NEWSTYPE::Unknown; - string stringId; - vector args; - - msgin.serialEnum (type); - msgin.serial (stringId); - msgin.serialCont (args); - - News.push_back(CNewsEntry(type, stringId, args)); - - nlinfo ("added news %s for type %d from service %s", stringId.c_str(), type, serviceName.c_str()); -} - - -static TUnifiedCallbackItem CbArray[]= -{ - { "ADD_NEWS", cbAddNews }, -}; - - -void CNewsManager::init() -{ - CUnifiedNetwork::getInstance()->addCallbackArray(CbArray, sizeof (CbArray) / sizeof (CbArray[0])); -} - - -void CNewsManager::getNews (NEWSTYPE::TNewsType type, CBitMemStream &bms) -{ - nlassert (type != NEWSTYPE::Unknown); - - sint val = (sint)frand ((float)News.size()); - - string res; - //CChatManager::getStaticDB ().getInfos (News[val].stringId, res, bms); - nlinfo ("sending news '%s' '%s' with %d args", News[val].StringId.c_str(), res.c_str(), News[val].Args.size()); - - //bms.serial (News[val].stringId); - bms.serialCont (News[val].Args); -} diff --git a/code/ryzom/server/src/input_output_service/news_manager.h b/code/ryzom/server/src/input_output_service/news_manager.h deleted file mode 100644 index dee34e5be..000000000 --- a/code/ryzom/server/src/input_output_service/news_manager.h +++ /dev/null @@ -1,60 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#ifndef NEWS_MANAGER_H -#define NEWS_MANAGER_H - - -// misc -#include "nel/misc/types_nl.h" -#include "nel/misc/bit_mem_stream.h" - -// game share -#include "game_share/ryzom_entity_id.h" -//#include "game_share/chat_static_database.h" -//#include "game_share/chat_dynamic_database.h" -#include "game_share/news_types.h" - -// std -#include -#include - - -/** - * CNewsManager - * \author Vianney Lecroart - * \author Nevrax France - * \date 2002 - */ -class CNewsManager -{ -public : - - /** - * Init the manager. - */ - static void init (); - - /// return a news of a given type - static void getNews (NEWSTYPE::TNewsType type, NLMISC::CBitMemStream &bms); -}; - - -#endif // NEWS_MANAGER_H - -/* End of news_manager.h */ diff --git a/code/ryzom/server/src/input_output_service/stdpch.h b/code/ryzom/server/src/input_output_service/stdpch.h index 17f5e6bc5..67599f732 100644 --- a/code/ryzom/server/src/input_output_service/stdpch.h +++ b/code/ryzom/server/src/input_output_service/stdpch.h @@ -74,7 +74,6 @@ #include "game_share/mirror_prop_value.h" #include "game_share/mode_and_behaviour.h" #include "game_share/msg_client_server.h" -#include "game_share/news_types.h" #include "game_share/people.h" #include "game_share/player_visual_properties.h" #include "game_share/power_types.h" From 2b73ed7def0262ce26b403ad0a01c01baea06925 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 11 May 2019 14:55:23 +0800 Subject: [PATCH 02/16] Use proper utf8mb4 for new installations --- code/web/private_php/setup/sql/nel_00001.sql | 10 ++--- code/web/private_php/setup/sql/nel_00002.sql | 2 +- .../private_php/setup/sql/nel_ams_00001.sql | 4 +- .../setup/sql/nel_ams_lib_00001.sql | 44 +++++++++---------- .../setup/sql/nel_ams_lib_00002.sql | 6 +-- .../setup/sql/nel_ams_lib_00005.sql | 2 +- .../setup/sql/nel_ams_lib_00006.sql | 6 +-- .../private_php/setup/sql/nel_tool_00001.sql | 42 +++++++++--------- .../setup/sql/ring_domain_00001.sql | 42 +++++++++--------- .../web/private_php/setup/sql/webig_00001.sql | 12 ++--- 10 files changed, 85 insertions(+), 85 deletions(-) diff --git a/code/web/private_php/setup/sql/nel_00001.sql b/code/web/private_php/setup/sql/nel_00001.sql index 70e14419b..51140342b 100644 --- a/code/web/private_php/setup/sql/nel_00001.sql +++ b/code/web/private_php/setup/sql/nel_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `nel` @@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS `domain` ( `web_host` varchar(255) NOT NULL DEFAULT '', `web_host_php` varchar(255) NOT NULL DEFAULT '', `description` varchar(200) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -53,7 +53,7 @@ CREATE TABLE IF NOT EXISTS `permission` ( `ShardId` int(10) NOT NULL DEFAULT '-1', `AccessPrivilege` set('OPEN','DEV','RESTRICTED') NOT NULL DEFAULT 'OPEN', `prim` int(10) unsigned NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -76,7 +76,7 @@ CREATE TABLE IF NOT EXISTS `shard` ( `State` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', `MOTD` text NOT NULL, `prim` int(10) unsigned NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='contains all shards information for login system'; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='contains all shards information for login system'; -- -------------------------------------------------------- @@ -127,7 +127,7 @@ CREATE TABLE IF NOT EXISTS `user` ( `ValidMerchantCode` varchar(13) NOT NULL DEFAULT '', `PBC` tinyint(1) NOT NULL DEFAULT '0', `ApiKeySeed` varchar(8) DEFAULT NULL -) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='contains all users information for login system'; +) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COMMENT='contains all users information for login system'; -- -- Indexes for dumped tables diff --git a/code/web/private_php/setup/sql/nel_00002.sql b/code/web/private_php/setup/sql/nel_00002.sql index 74a59d980..851abc196 100644 --- a/code/web/private_php/setup/sql/nel_00002.sql +++ b/code/web/private_php/setup/sql/nel_00002.sql @@ -1,4 +1,4 @@ -ALTER TABLE `permission` CHANGE `ClientApplication` `ClientApplication` CHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ; +ALTER TABLE `permission` CHANGE `ClientApplication` `ClientApplication` CHAR( 64 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL ; ALTER TABLE `permission` DROP `prim` ; ALTER TABLE `permission` ADD `PermissionId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ; ALTER TABLE `permission` ADD `DomainId` INT NOT NULL DEFAULT '-1' AFTER `UId` ; diff --git a/code/web/private_php/setup/sql/nel_ams_00001.sql b/code/web/private_php/setup/sql/nel_ams_00001.sql index c2b0a8895..79da7e999 100644 --- a/code/web/private_php/setup/sql/nel_ams_00001.sql +++ b/code/web/private_php/setup/sql/nel_ams_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `ams_web` @@ -38,7 +38,7 @@ CREATE TABLE IF NOT EXISTS `ams_user` ( `Country` char(2) NOT NULL DEFAULT '', `ReceiveMail` int(1) NOT NULL DEFAULT '1', `Language` varchar(3) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables diff --git a/code/web/private_php/setup/sql/nel_ams_lib_00001.sql b/code/web/private_php/setup/sql/nel_ams_lib_00001.sql index 3c9b259b3..07826cf24 100644 --- a/code/web/private_php/setup/sql/nel_ams_lib_00001.sql +++ b/code/web/private_php/setup/sql/nel_ams_lib_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `nel_ams_lib` @@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `ams_querycache` ( `type` varchar(64) NOT NULL, `query` varchar(512) NOT NULL, `db` varchar(80) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS `ams_querycache` ( CREATE TABLE IF NOT EXISTS `assigned` ( `Ticket` int(10) unsigned NOT NULL, `User` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -61,7 +61,7 @@ CREATE TABLE IF NOT EXISTS `email` ( `MessageId` varchar(45) DEFAULT NULL, `TicketId` int(10) unsigned DEFAULT NULL, `Sender` int(10) unsigned DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -72,7 +72,7 @@ CREATE TABLE IF NOT EXISTS `email` ( CREATE TABLE IF NOT EXISTS `forwarded` ( `Group` int(10) unsigned NOT NULL, `Ticket` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -83,7 +83,7 @@ CREATE TABLE IF NOT EXISTS `forwarded` ( CREATE TABLE IF NOT EXISTS `in_group` ( `Ticket_Group` int(10) unsigned NOT NULL, `Ticket` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -94,7 +94,7 @@ CREATE TABLE IF NOT EXISTS `in_group` ( CREATE TABLE IF NOT EXISTS `in_support_group` ( `User` int(10) unsigned NOT NULL, `Group` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -112,7 +112,7 @@ CREATE TABLE IF NOT EXISTS `plugins` ( `Status` int(11) NOT NULL DEFAULT '0', `Weight` int(11) NOT NULL DEFAULT '0', `Info` text -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `plugins` @@ -136,7 +136,7 @@ CREATE TABLE IF NOT EXISTS `support_group` ( `IMAP_MailServer` varchar(60) DEFAULT NULL, `IMAP_Username` varchar(45) DEFAULT NULL, `IMAP_Password` varchar(90) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -147,7 +147,7 @@ CREATE TABLE IF NOT EXISTS `support_group` ( CREATE TABLE IF NOT EXISTS `tag` ( `TagId` int(10) unsigned NOT NULL, `Value` varchar(60) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -158,7 +158,7 @@ CREATE TABLE IF NOT EXISTS `tag` ( CREATE TABLE IF NOT EXISTS `tagged` ( `Ticket` int(10) unsigned NOT NULL, `Tag` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -175,7 +175,7 @@ CREATE TABLE IF NOT EXISTS `ticket` ( `Ticket_Category` int(10) unsigned NOT NULL, `Author` int(10) unsigned NOT NULL, `Priority` int(3) DEFAULT '0' -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -186,7 +186,7 @@ CREATE TABLE IF NOT EXISTS `ticket` ( CREATE TABLE IF NOT EXISTS `ticket_category` ( `TCategoryId` int(10) unsigned NOT NULL, `Name` varchar(45) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `ticket_category` @@ -208,7 +208,7 @@ INSERT INTO `ticket_category` (`TCategoryId`, `Name`) VALUES CREATE TABLE IF NOT EXISTS `ticket_content` ( `TContentId` int(10) unsigned NOT NULL, `Content` text -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -219,7 +219,7 @@ CREATE TABLE IF NOT EXISTS `ticket_content` ( CREATE TABLE IF NOT EXISTS `ticket_group` ( `TGroupId` int(10) unsigned NOT NULL, `Title` varchar(80) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -248,7 +248,7 @@ CREATE TABLE IF NOT EXISTS `ticket_info` ( `PlayerName` varchar(45) DEFAULT NULL, `UserId` int(11) DEFAULT NULL, `TimeInGame` varchar(50) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -262,7 +262,7 @@ CREATE TABLE IF NOT EXISTS `ticket_log` ( `Query` varchar(255) NOT NULL, `Ticket` int(10) unsigned NOT NULL, `Author` int(10) unsigned DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -277,7 +277,7 @@ CREATE TABLE IF NOT EXISTS `ticket_reply` ( `Content` int(10) unsigned NOT NULL, `Timestamp` timestamp NULL DEFAULT NULL, `Hidden` tinyint(1) DEFAULT '0' -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -289,7 +289,7 @@ CREATE TABLE IF NOT EXISTS `ticket_user` ( `TUserId` int(10) unsigned NOT NULL, `Permission` int(3) NOT NULL DEFAULT '1', `ExternId` int(10) unsigned NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -300,9 +300,9 @@ CREATE TABLE IF NOT EXISTS `ticket_user` ( CREATE TABLE IF NOT EXISTS `updates` ( `s.no` int(10) NOT NULL, `PluginId` int(10) DEFAULT NULL, - `UpdatePath` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `UpdateInfo` text CHARACTER SET utf8 COLLATE utf8_unicode_ci -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + `UpdatePath` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `UpdateInfo` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables diff --git a/code/web/private_php/setup/sql/nel_ams_lib_00002.sql b/code/web/private_php/setup/sql/nel_ams_lib_00002.sql index 99700c532..4831288d2 100644 --- a/code/web/private_php/setup/sql/nel_ams_lib_00002.sql +++ b/code/web/private_php/setup/sql/nel_ams_lib_00002.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `nel_ams_lib` @@ -29,12 +29,12 @@ SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `ticket_attachments` ( `idticket_attachments` int(10) unsigned NOT NULL, `ticket_TId` int(10) unsigned NOT NULL, - `Filename` varchar(45) COLLATE utf8_unicode_ci NOT NULL, + `Filename` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL, `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `Filesize` int(10) NOT NULL, `Uploader` int(10) unsigned NOT NULL, `Path` VARCHAR(128) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Indexes for dumped tables diff --git a/code/web/private_php/setup/sql/nel_ams_lib_00005.sql b/code/web/private_php/setup/sql/nel_ams_lib_00005.sql index 2a2f8bcca..11870cacb 100644 --- a/code/web/private_php/setup/sql/nel_ams_lib_00005.sql +++ b/code/web/private_php/setup/sql/nel_ams_lib_00005.sql @@ -1 +1 @@ -ALTER TABLE `ticket_attachments` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `ticket_attachments` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; diff --git a/code/web/private_php/setup/sql/nel_ams_lib_00006.sql b/code/web/private_php/setup/sql/nel_ams_lib_00006.sql index f4c632bad..424bde970 100644 --- a/code/web/private_php/setup/sql/nel_ams_lib_00006.sql +++ b/code/web/private_php/setup/sql/nel_ams_lib_00006.sql @@ -1,8 +1,8 @@ CREATE TABLE IF NOT EXISTS `settings` ( `idSettings` int(11) NOT NULL, - `Setting` varchar(32) COLLATE utf8_unicode_ci NOT NULL, - `Value` varchar(256) COLLATE utf8_unicode_ci NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + `Setting` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `Value` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `settings` (`idSettings`, `Setting`, `Value`) VALUES (1, 'userRegistration', '0'); diff --git a/code/web/private_php/setup/sql/nel_tool_00001.sql b/code/web/private_php/setup/sql/nel_tool_00001.sql index a01a1c4a5..1ea044a9d 100644 --- a/code/web/private_php/setup/sql/nel_tool_00001.sql +++ b/code/web/private_php/setup/sql/nel_tool_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `nel_tool` @@ -36,7 +36,7 @@ CREATE TABLE IF NOT EXISTS `neltool_annotations` ( PRIMARY KEY (`annotation_id`), UNIQUE KEY `annotation_shard_id` (`annotation_shard_id`), UNIQUE KEY `annotation_domain_id` (`annotation_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ; -- -- Dumping data for table `neltool_annotations` @@ -60,7 +60,7 @@ CREATE TABLE IF NOT EXISTS `neltool_applications` ( `application_visible` int(11) NOT NULL DEFAULT '0', `application_icon` varchar(128) NOT NULL DEFAULT '', PRIMARY KEY (`application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=40 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=40 ; -- -- Dumping data for table `neltool_applications` @@ -126,7 +126,7 @@ CREATE TABLE IF NOT EXISTS `neltool_domains` ( `domain_mfs_web` text, `domain_cs_sql_string` varchar(255) DEFAULT NULL, PRIMARY KEY (`domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -143,7 +143,7 @@ CREATE TABLE IF NOT EXISTS `neltool_groups` ( `group_default_domain_id` tinyint(3) unsigned DEFAULT NULL, `group_default_shard_id` smallint(3) unsigned DEFAULT NULL, PRIMARY KEY (`group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=10 ; -- -- Dumping data for table `neltool_groups` @@ -172,7 +172,7 @@ CREATE TABLE IF NOT EXISTS `neltool_group_applications` ( PRIMARY KEY (`group_application_id`), KEY `group_application_group_id` (`group_application_group_id`), KEY `group_application_application_id` (`group_application_application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=966 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=966 ; -- -- Dumping data for table `neltool_group_applications` @@ -370,7 +370,7 @@ CREATE TABLE IF NOT EXISTS `neltool_group_domains` ( `group_domain_domain_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`group_domain_id`), KEY `group_domain_group_id` (`group_domain_group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -386,7 +386,7 @@ CREATE TABLE IF NOT EXISTS `neltool_group_shards` ( PRIMARY KEY (`group_shard_id`), KEY `group_shard_group_id` (`group_shard_group_id`), KEY `group_shard_domain_id` (`group_shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `neltool_group_shards` @@ -408,7 +408,7 @@ CREATE TABLE IF NOT EXISTS `neltool_locks` ( PRIMARY KEY (`lock_id`), UNIQUE KEY `lock_shard_id` (`lock_shard_id`), UNIQUE KEY `lock_domain_id` (`lock_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -422,7 +422,7 @@ CREATE TABLE IF NOT EXISTS `neltool_logs` ( `logs_date` int(11) NOT NULL DEFAULT '0', `logs_data` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`logs_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -439,7 +439,7 @@ CREATE TABLE IF NOT EXISTS `neltool_notes` ( `note_active` int(11) NOT NULL DEFAULT '0', `note_global` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`note_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=11 ; -- -- Dumping data for table `neltool_notes` @@ -469,7 +469,7 @@ CREATE TABLE IF NOT EXISTS `neltool_restart_groups` ( PRIMARY KEY (`restart_group_id`), UNIQUE KEY `restart_group_id` (`restart_group_id`), KEY `restart_group_id_2` (`restart_group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=6 ; -- -- Dumping data for table `neltool_restart_groups` @@ -495,7 +495,7 @@ CREATE TABLE IF NOT EXISTS `neltool_restart_messages` ( PRIMARY KEY (`restart_message_id`), UNIQUE KEY `restart_message_id` (`restart_message_id`), KEY `restart_message_id_2` (`restart_message_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=11 ; -- -- Dumping data for table `neltool_restart_messages` @@ -523,7 +523,7 @@ CREATE TABLE IF NOT EXISTS `neltool_restart_sequences` ( `restart_sequence_date_end` int(11) DEFAULT NULL, `restart_sequence_timer` int(11) unsigned DEFAULT '0', PRIMARY KEY (`restart_sequence_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -540,7 +540,7 @@ CREATE TABLE IF NOT EXISTS `neltool_shards` ( `shard_restart` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`shard_id`), KEY `shard_domain_id` (`shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -561,7 +561,7 @@ CREATE TABLE IF NOT EXISTS `neltool_stats_hd_datas` ( PRIMARY KEY (`hd_id`), KEY `hd_domain_id` (`hd_domain_id`), KEY `hd_server` (`hd_server`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -573,7 +573,7 @@ CREATE TABLE IF NOT EXISTS `neltool_stats_hd_times` ( `hd_domain_id` int(11) NOT NULL DEFAULT '0', `hd_last_time` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`hd_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -595,7 +595,7 @@ CREATE TABLE IF NOT EXISTS `neltool_users` ( UNIQUE KEY `user_login` (`user_name`), KEY `user_group_id` (`user_group_id`), KEY `user_active` (`user_active`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -610,7 +610,7 @@ CREATE TABLE IF NOT EXISTS `neltool_user_applications` ( PRIMARY KEY (`user_application_id`), KEY `user_application_user_id` (`user_application_user_id`), KEY `user_application_application_id` (`user_application_application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -624,7 +624,7 @@ CREATE TABLE IF NOT EXISTS `neltool_user_domains` ( `user_domain_domain_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`user_domain_id`), KEY `user_domain_user_id` (`user_domain_user_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -640,7 +640,7 @@ CREATE TABLE IF NOT EXISTS `neltool_user_shards` ( PRIMARY KEY (`user_shard_id`), KEY `user_shard_user_id` (`user_shard_user_id`), KEY `user_shard_domain_id` (`user_shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; diff --git a/code/web/private_php/setup/sql/ring_domain_00001.sql b/code/web/private_php/setup/sql/ring_domain_00001.sql index fdda4fc77..f0a6abd8f 100644 --- a/code/web/private_php/setup/sql/ring_domain_00001.sql +++ b/code/web/private_php/setup/sql/ring_domain_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `ring_mini01` @@ -49,7 +49,7 @@ CREATE TABLE IF NOT EXISTS `characters` ( KEY `user_id_idx` (`user_id`), KEY `guild_idx` (`guild_id`), KEY `guild_id_idx` (`guild_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -65,7 +65,7 @@ CREATE TABLE IF NOT EXISTS `folder` ( PRIMARY KEY (`Id`), KEY `owner_idx` (`owner`), KEY `title_idx` (`title`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -80,7 +80,7 @@ CREATE TABLE IF NOT EXISTS `folder_access` ( PRIMARY KEY (`Id`), KEY `folder_id_idx` (`folder_id`), KEY `user_idx` (`user_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -95,7 +95,7 @@ CREATE TABLE IF NOT EXISTS `guilds` ( PRIMARY KEY (`guild_id`), KEY `shard_id_idx` (`shard_id`), KEY `guild_name_idx` (`guild_name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- @@ -110,7 +110,7 @@ CREATE TABLE IF NOT EXISTS `guild_invites` ( PRIMARY KEY (`Id`), KEY `guild_id_idx` (`guild_id`), KEY `session_id_idx` (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -127,7 +127,7 @@ CREATE TABLE IF NOT EXISTS `journal_entry` ( `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33', PRIMARY KEY (`Id`), KEY `session_id_idx` (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -144,7 +144,7 @@ CREATE TABLE IF NOT EXISTS `known_users` ( `comments` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`Id`), KEY `user_index` (`owner`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -158,7 +158,7 @@ CREATE TABLE IF NOT EXISTS `mfs_erased_mail_series` ( `erased_series` int(11) unsigned NOT NULL AUTO_INCREMENT, `erase_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`erased_series`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -175,7 +175,7 @@ CREATE TABLE IF NOT EXISTS `mfs_guild_thread` ( `post_count` int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`thread_id`), KEY `guild_index` (`guild_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -190,7 +190,7 @@ CREATE TABLE IF NOT EXISTS `mfs_guild_thread_message` ( `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `content` text NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -209,7 +209,7 @@ CREATE TABLE IF NOT EXISTS `mfs_mail` ( `content` text NOT NULL, PRIMARY KEY (`id`), KEY `dest_index` (`dest_char_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -223,7 +223,7 @@ CREATE TABLE IF NOT EXISTS `outlands` ( `billing_instance_id` int(11) unsigned NOT NULL DEFAULT '0', `anim_session_id` int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -247,7 +247,7 @@ CREATE TABLE IF NOT EXISTS `player_rating` ( PRIMARY KEY (`Id`), KEY `session_id_idx` (`scenario_id`), KEY `author_idx` (`author`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -276,7 +276,7 @@ CREATE TABLE IF NOT EXISTS `ring_users` ( UNIQUE KEY `user_name_idx` (`user_name`), KEY `cookie_idx` (`cookie`), KEY `current_session_idx` (`current_session`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- @@ -297,7 +297,7 @@ CREATE TABLE IF NOT EXISTS `scenario` ( `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e','sl_f') NOT NULL DEFAULT 'sl_a', `allow_free_trial` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -316,7 +316,7 @@ CREATE TABLE IF NOT EXISTS `scenario_desc` ( PRIMARY KEY (`session_id`), UNIQUE KEY `title_idx` (`title`), KEY `parent_idx` (`parent_scenario`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- @@ -358,7 +358,7 @@ CREATE TABLE IF NOT EXISTS `sessions` ( KEY `owner_idx` (`owner`), KEY `folder_idx` (`folder_id`), KEY `state_type_idx` (`state`,`session_type`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1001 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1001 ; -- -------------------------------------------------------- @@ -377,7 +377,7 @@ CREATE TABLE IF NOT EXISTS `session_log` ( `owner` varchar(32) NOT NULL DEFAULT '0', `guild_name` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- @@ -395,7 +395,7 @@ CREATE TABLE IF NOT EXISTS `session_participant` ( PRIMARY KEY (`Id`), KEY `session_idx` (`session_id`), KEY `user_idx` (`char_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -410,7 +410,7 @@ CREATE TABLE IF NOT EXISTS `shard` ( `OldState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_restricted', `RequiredState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', PRIMARY KEY (`shard_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=FIXED; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; diff --git a/code/web/private_php/setup/sql/webig_00001.sql b/code/web/private_php/setup/sql/webig_00001.sql index 9682d454a..707d68017 100644 --- a/code/web/private_php/setup/sql/webig_00001.sql +++ b/code/web/private_php/setup/sql/webig_00001.sql @@ -7,11 +7,11 @@ -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; /*!40014 SET FOREIGN_KEY_CHECKS=0 */; -- Dumping database structure for webig --- CREATE DATABASE IF NOT EXISTS `webig` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */; +-- CREATE DATABASE IF NOT EXISTS `webig` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin */; -- USE `webig`; @@ -19,20 +19,20 @@ CREATE TABLE IF NOT EXISTS `players` ( `id` INT(32) NOT NULL AUTO_INCREMENT, `cid` INT(32) NOT NULL DEFAULT '0', - `name` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0', `gender` INT(1) NOT NULL DEFAULT '0', `creation_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', `deleted` tinyint(1) NOT NULL DEFAULT '0', `last_login` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', `dev_shard` tinyint(4) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- Dumping structure for table webig.accounts CREATE TABLE IF NOT EXISTS `accounts` ( `uid` INT(10) DEFAULT NULL, - `web_privs` VARCHAR(255) COLLATE utf8_bin DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + `web_privs` VARCHAR(255) COLLATE utf8mb4_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- Data exporting was unselected. /*!40014 SET FOREIGN_KEY_CHECKS=1 */; From e9dadb188adf640d4ccdd32dca996ec413d7abbf Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 11 May 2019 15:03:42 +0800 Subject: [PATCH 03/16] Use utf8mb4 --- .../API_key_management/API_key_management.php | 14 ++++---- .../ams/plugins/resource.mysql.php | 2 +- .../ams/plugins/resource.mysqls.php | 2 +- code/web/public_php/api/common/db_lib.php | 4 +-- code/web/public_php/setup/header.php | 2 +- .../public_php/webtt/app/config/database.php | 2 +- .../cases/libs/model/cake_schema.test.php | 16 ++++----- .../model/datasources/dbo/dbo_mysql.test.php | 36 +++++++++---------- .../model/datasources/dbo/dbo_mysqli.test.php | 6 ++-- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/code/web/private_php/ams/plugins/API_key_management/API_key_management.php b/code/web/private_php/ams/plugins/API_key_management/API_key_management.php index b8dc965fc..f7caef90e 100644 --- a/code/web/private_php/ams/plugins/API_key_management/API_key_management.php +++ b/code/web/private_php/ams/plugins/API_key_management/API_key_management.php @@ -92,17 +92,17 @@ function api_key_management_hook_activate() CREATE TABLE IF NOT EXISTS `ams_api_keys` ( `SNo` int(10) NOT NULL AUTO_INCREMENT, - `User` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `FrName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `UserType` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, - `UserCharacter` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `User` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `FrName` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `UserType` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `UserCharacter` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `ExpiryDate` date DEFAULT NULL, - `AccessToken` text COLLATE utf8_unicode_ci DEFAULT NULL, + `AccessToken` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `AddedOn` datetime DEFAULT NULL, - `Items` text COLLATE utf8_unicode_ci, + `Items` text COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`SNo`), KEY `User` (`User`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -- Constraints for table `ams_api_keys` diff --git a/code/web/private_php/ams/plugins/resource.mysql.php b/code/web/private_php/ams/plugins/resource.mysql.php index 312f3fc73..4af19756d 100644 --- a/code/web/private_php/ams/plugins/resource.mysql.php +++ b/code/web/private_php/ams/plugins/resource.mysql.php @@ -12,7 +12,7 @@ * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, * `source` text, * PRIMARY KEY (`name`) - * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; * * Demo data: *
INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
diff --git a/code/web/private_php/ams/plugins/resource.mysqls.php b/code/web/private_php/ams/plugins/resource.mysqls.php index f9fe1c2f2..f7c4a663d 100644 --- a/code/web/private_php/ams/plugins/resource.mysqls.php +++ b/code/web/private_php/ams/plugins/resource.mysqls.php @@ -15,7 +15,7 @@ * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, * `source` text, * PRIMARY KEY (`name`) - * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; * * Demo data: *
INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
diff --git a/code/web/public_php/api/common/db_lib.php b/code/web/public_php/api/common/db_lib.php index 5d054b1bb..cedd6431b 100644 --- a/code/web/public_php/api/common/db_lib.php +++ b/code/web/public_php/api/common/db_lib.php @@ -134,7 +134,7 @@ class ryDB { global $_RYZOM_API_CONFIG; $this->db_name = $db_name; $this->db = new ServerDatabase(RYAPI_WEBDB_HOST, RYAPI_WEBDB_LOGIN, RYAPI_WEBDB_PASS, $db_name); - $this->db->query("SET NAMES utf8"); + $this->db->query("SET NAMES utf8mb4"); } public static function getInstance($db_name) { @@ -480,7 +480,7 @@ class ryDB { $c = "Updating DB Structure...\n"; foreach ($defs as $dbname => $tables) { $db = new ServerDatabase(RYAPI_WEBDB_HOST, RYAPI_WEBDB_LOGIN, RYAPI_WEBDB_PASS, $dbname); - $db->query("SET NAMES utf8"); + $db->query("SET NAMES utf8mb4"); $c .= "\n Selected DB '$dbname'\n"; foreach ($tables as $table => $sql) { diff --git a/code/web/public_php/setup/header.php b/code/web/public_php/setup/header.php index bc3924f4a..cefc30a01 100644 --- a/code/web/public_php/setup/header.php +++ b/code/web/public_php/setup/header.php @@ -62,7 +62,7 @@ function validate_writable($continue, $path) { function create_use_database($continue_r, $con, $database) { $continue = $continue_r; if ($continue) { - $sql = "CREATE DATABASE `" . mysqli_real_escape_string($con, $database) . "` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"; + $sql = "CREATE DATABASE `" . mysqli_real_escape_string($con, $database) . "` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"; if (mysqli_query($con, $sql)) { printalert("success", "Database " . $database . " created"); } else { diff --git a/code/web/public_php/webtt/app/config/database.php b/code/web/public_php/webtt/app/config/database.php index 3119752d2..702ece282 100644 --- a/code/web/public_php/webtt/app/config/database.php +++ b/code/web/public_php/webtt/app/config/database.php @@ -8,7 +8,7 @@ class DATABASE_CONFIG { 'login' => 'webtt', 'password' => 'webtt77', 'database' => 'webtt2', - 'encoding' => 'utf8' + 'encoding' => 'utf8mb4' ); var $raw_files = array( 'datasource' => 'RawFilesSource', diff --git a/code/web/public_php/webtt/cake/tests/cases/libs/model/cake_schema.test.php b/code/web/public_php/webtt/cake/tests/cases/libs/model/cake_schema.test.php index 2b3abcc8b..5ae80c83e 100644 --- a/code/web/public_php/webtt/cake/tests/cases/libs/model/cake_schema.test.php +++ b/code/web/public_php/webtt/cake/tests/cases/libs/model/cake_schema.test.php @@ -872,8 +872,8 @@ class CakeSchemaTest extends CakeTestCase { 'author_id' => array('column' => 'author_id'), ), 'tableParameters' => array( - 'charset' => 'utf8', - 'collate' => 'utf8_general_ci', + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_general_ci', 'engine' => 'MyISAM' ) ), @@ -885,8 +885,8 @@ class CakeSchemaTest extends CakeTestCase { 'PRIMARY' => array('column' => 'id', 'unique' => true), ), 'tableParameters' => array( - 'charset' => 'utf8', - 'collate' => 'utf8_general_ci' + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_general_ci' ) ) ); @@ -898,8 +898,8 @@ class CakeSchemaTest extends CakeTestCase { ), 'change' => array( 'tableParameters' => array( - 'charset' => 'utf8', - 'collate' => 'utf8_general_ci', + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_general_ci', 'engine' => 'MyISAM' ) ) @@ -910,8 +910,8 @@ class CakeSchemaTest extends CakeTestCase { ), 'change' => array( 'tableParameters' => array( - 'charset' => 'utf8', - 'collate' => 'utf8_general_ci', + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_general_ci', ) ) ) diff --git a/code/web/public_php/webtt/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/code/web/public_php/webtt/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php index c90d585ca..30bf9555c 100644 --- a/code/web/public_php/webtt/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php +++ b/code/web/public_php/webtt/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php @@ -376,11 +376,11 @@ class DboMysqlTest extends CakeTestCase { 'default', 'null' => true, 'key', - 'charset' => 'utf8', - 'collate' => 'utf8_unicode_ci' + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_unicode_ci' ); $result = $this->db->buildColumn($data); - $expected = '`testName` CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL'; + $expected = '`testName` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL'; $this->assertEqual($result, $expected); $this->db->columns = $restore; } @@ -648,22 +648,22 @@ class DboMysqlTest extends CakeTestCase { 'id' => array('type' => 'integer', 'null' => false, 'default' => 0), 'name' => array('type' => 'string', 'null' => false, 'length' => 50), 'tableParameters' => array( - 'charset' => 'utf8', - 'collate' => 'utf8_general_ci', + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_general_ci', 'engine' => 'InnoDB' ) ) )); $result = $this->db->alterSchema($schema2->compare($schema1)); - $this->assertPattern('/DEFAULT CHARSET=utf8/', $result); + $this->assertPattern('/DEFAULT CHARSET=utf8mb4/', $result); $this->assertPattern('/ENGINE=InnoDB/', $result); - $this->assertPattern('/COLLATE=utf8_general_ci/', $result); + $this->assertPattern('/COLLATE=utf8mb4_general_ci/', $result); $this->db->query($result); $result = $this->db->listDetailedSources('altertest'); - $this->assertEqual($result['Collation'], 'utf8_general_ci'); + $this->assertEqual($result['Collation'], 'utf8mb4_general_ci'); $this->assertEqual($result['Engine'], 'InnoDB'); - $this->assertEqual($result['charset'], 'utf8'); + $this->assertEqual($result['charset'], 'utf8mb4'); $this->db->query($this->db->dropSchema($schema1)); } @@ -710,11 +710,11 @@ class DboMysqlTest extends CakeTestCase { */ function testReadTableParameters() { $this->db->cacheSources = false; - $this->db->query('CREATE TABLE ' . $this->db->fullTableName('tinyint') . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;'); + $this->db->query('CREATE TABLE ' . $this->db->fullTableName('tinyint') . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;'); $result = $this->db->readTableParameters('tinyint'); $expected = array( - 'charset' => 'utf8', - 'collate' => 'utf8_unicode_ci', + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_unicode_ci', 'engine' => 'InnoDB'); $this->assertEqual($result, $expected); @@ -738,13 +738,13 @@ class DboMysqlTest extends CakeTestCase { function testBuildTableParameters() { $this->db->cacheSources = false; $data = array( - 'charset' => 'utf8', - 'collate' => 'utf8_unicode_ci', + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_unicode_ci', 'engine' => 'InnoDB'); $result = $this->db->buildTableParameters($data); $expected = array( - 'DEFAULT CHARSET=utf8', - 'COLLATE=utf8_unicode_ci', + 'DEFAULT CHARSET=utf8mb4', + 'COLLATE=utf8mb4_unicode_ci', 'ENGINE=InnoDB'); $this->assertEqual($result, $expected); } @@ -757,8 +757,8 @@ class DboMysqlTest extends CakeTestCase { */ function testGetCharsetName() { $this->db->cacheSources = false; - $result = $this->db->getCharsetName('utf8_unicode_ci'); - $this->assertEqual($result, 'utf8'); + $result = $this->db->getCharsetName('utf8mb4_unicode_ci'); + $this->assertEqual($result, 'utf8mb4'); $result = $this->db->getCharsetName('cp1250_general_ci'); $this->assertEqual($result, 'cp1250'); } diff --git a/code/web/public_php/webtt/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php b/code/web/public_php/webtt/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php index e3a94512b..812e33216 100644 --- a/code/web/public_php/webtt/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php +++ b/code/web/public_php/webtt/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php @@ -318,11 +318,11 @@ class DboMysqliTest extends CakeTestCase { */ function testReadTableParameters() { $this->db->cacheSources = $this->db->testing = false; - $this->db->query('CREATE TABLE ' . $this->db->fullTableName('tinyint') . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;'); + $this->db->query('CREATE TABLE ' . $this->db->fullTableName('tinyint') . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;'); $result = $this->db->readTableParameters('tinyint'); $expected = array( - 'charset' => 'utf8', - 'collate' => 'utf8_unicode_ci', + 'charset' => 'utf8mb4', + 'collate' => 'utf8mb4_unicode_ci', 'engine' => 'InnoDB'); $this->assertEqual($result, $expected); From c916df692226385dcfb03113919e668ebea98d5b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 11 May 2019 15:13:24 +0800 Subject: [PATCH 04/16] Use utf8mb4 --- code/nelns/login_service/mysql_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nelns/login_service/mysql_helper.cpp b/code/nelns/login_service/mysql_helper.cpp index 208faf41e..5ae04e8b5 100644 --- a/code/nelns/login_service/mysql_helper.cpp +++ b/code/nelns/login_service/mysql_helper.cpp @@ -157,7 +157,7 @@ static void cbDatabaseVar(CConfigFile::CVar &var) #endif - sqlQuery("set names utf8"); + sqlQuery("set names utf8mb4"); } void sqlInit() From cf9ee9113d32a2f8b2d8a6344fd8b6486a037892 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 11 May 2019 17:37:16 +0800 Subject: [PATCH 05/16] PHP library mcrypt is no longer a thing --- code/web/public_php/setup/install.php | 11 ++--------- code/web/public_php/setup/upgrade.php | 7 ------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/code/web/public_php/setup/install.php b/code/web/public_php/setup/install.php index 438a5c332..67f27f5c0 100644 --- a/code/web/public_php/setup/install.php +++ b/code/web/public_php/setup/install.php @@ -35,13 +35,6 @@ require_once('setup/version.php'); printalert("danger", "No server roles selected"); $continue = false; } - - if ($continue) { - if (!extension_loaded('mcrypt')) { - printalert("danger", "The mcrypt extension is missing. Please check your PHP configuration"); - $continue = false; - } - } if ($continue) { try { @@ -161,8 +154,8 @@ require_once('setup/version.php'); $config = str_replace("%nelDomainName%", addslashes($_POST["nelDomainName"]), $config); $config = str_replace("%nelSetupVersion%", addslashes($NEL_SETUP_VERSION), $config); $cryptKeyLength = 16; - $cryptKey = str_replace("=", "", base64_encode(mcrypt_create_iv(ceil(0.75 * $cryptKeyLength), MCRYPT_DEV_URANDOM))); - $cryptKeyIMAP = str_replace("=", "", base64_encode(mcrypt_create_iv(ceil(0.75 * $cryptKeyLength), MCRYPT_DEV_URANDOM))); + $cryptKey = substr(str_replace(['+', '/', '='], '', base64_encode(random_bytes($cryptKeyLength * 2))), 0, $cryptKeyLength); + $cryptKeyIMAP = substr(str_replace(['+', '/', '='], '', base64_encode(random_bytes($cryptKeyLength * 2))), 0, $cryptKeyLength); $config = str_replace("%cryptKey%", addslashes($cryptKey), $config); $config = str_replace("%cryptKeyIMAP%", addslashes($cryptKeyIMAP), $config); if (file_put_contents("config.php", $config)) { diff --git a/code/web/public_php/setup/upgrade.php b/code/web/public_php/setup/upgrade.php index cc157a997..b29c04e2c 100644 --- a/code/web/public_php/setup/upgrade.php +++ b/code/web/public_php/setup/upgrade.php @@ -28,13 +28,6 @@ if (!isset($NEL_SETUP_VERSION_CONFIGURED)) { require_once('database.php'); - if ($continue) { - if (!extension_loaded('mcrypt')) { - printalert("danger", "The mcrypt extension is missing. Please check your PHP configuration"); - $continue = false; - } - } - if (file_exists("role_support")) { $continue = upgrade_support_databases($continue); } From 41455d6d9898ac1499553ce2496ded0af7b9fc3f Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 11 May 2019 17:52:32 +0800 Subject: [PATCH 06/16] Fix bad SQL query in AMS --- .../ams/plugins/Domain_Management/Domain_Management.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php b/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php index 5362eef6b..5b98fc152 100644 --- a/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php +++ b/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php @@ -159,8 +159,8 @@ function domain_management_hook_return_global() function domain_management_hook_activate() { $dbl = new DBLayer( "lib" ); - $sql = "INSERT INTO `settings` (Setting) - SELECT 'Domain_Auto_Add' FROM DUAL + $sql = "INSERT INTO `settings` (Setting, Value) + SELECT 'Domain_Auto_Add', 0 FROM DUAL WHERE NOT EXISTS (SELECT Setting FROM settings WHERE Setting='Domain_Auto_Add');"; From 33a3ad04f5bcbeaf36fc7dd86da67e8e2c2530d2 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 04:02:37 +0800 Subject: [PATCH 07/16] Retry ligo export on crash --- .../build_gamedata/processes/ligo/1_export.py | 57 ++++++++++++++++--- .../ligo/maxscript/nel_ligo_export.ms | 45 ++++++++++++++- 2 files changed, 92 insertions(+), 10 deletions(-) diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index 09be53494..4077ddb1c 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -61,8 +61,9 @@ if LigoExportLand == "" or LigoExportOnePass == 1: mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemZoneLigoExportDirectory) mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemCmbExportDirectory) mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) - mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory) - if (needUpdateDirByTagLogFiltered(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory, ".max.tag", [ "zonematerial", "zonetransition", "zonespecial" ])): + tagDirectory = ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory + mkPath(log, tagDirectory) + if (needUpdateDirByTagLogFiltered(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", tagDirectory, ".max.tag", [ "zonematerial", "zonetransition", "zonespecial" ])): printLog(log, "WRITE " + ligoIniPath) ligoIni = open(ligoIniPath, "w") ligoIni.write("[LigoConfig]\n") @@ -71,29 +72,69 @@ if LigoExportLand == "" or LigoExportOnePass == 1: ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory[0] + "/\n") ligoIni.close() - outDirTag = ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory - logFile = ScriptDirectory + "/processes/ligo/log.log" + outputLogfile = ScriptDirectory + "/processes/ligo/log.log" smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" + maxRunningTagFile = tagDirectory + "/max_running.tag" scriptSrc = "maxscript/nel_ligo_export.ms" scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): os.remove(scriptDst) + tagDiff = 1 printLog(log, "WRITE " + scriptDst) sSrc = open(scriptSrc, "r") sDst = open(scriptDst, "w") for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("output_directory_tag", outDirTag) + newline = line.replace("output_logfile", outputLogfile) + newline = newline.replace("output_directory_tag", tagDirectory) newline = newline.replace("bankFilename", smallBank) sDst.write(newline) sSrc.close() sDst.close() - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-mip" ]) + zeroRetryLimit = 3 + while tagDiff > 0: + mrt = open(maxRunningTagFile, "w") + mrt.write("moe-moe-kyun") + mrt.close() + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-mip" ]) + if os.path.exists(outputLogfile): + try: + lSrc = open(outputLogfile, "r") + for line in lSrc: + lineStrip = line.strip() + if (len(lineStrip) > 0): + printLog(log, lineStrip) + lSrc.close() + os.remove(outputLogfile) + except Exception: + printLog(log, "ERROR Failed to read 3dsmax log") + else: + printLog(log, "WARNING No 3dsmax log") + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + addTagDiff = 0 + if os.path.exists(maxRunningTagFile): + printLog(log, "FAIL 3ds Max crashed and/or file export failed!") + if tagDiff == 0: + if zeroRetryLimit > 0: + zeroRetryLimit = zeroRetryLimit - 1 + addTagDiff = 1 + else: + printLog(log, "FAIL Retry limit reached!") + else: + addTagDiff = 1 + os.remove(maxRunningTagFile) + printLog(log, "Exported " + str(tagDiff) + " .max files!") + tagDiff += addTagDiff os.remove(scriptDst) printLog(log, "") diff --git a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms index 07d032809..e1d5de20e 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms +++ b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms @@ -16,6 +16,7 @@ TransitionNumBis = #( 5, 4, 2, 3, 7, 6, 0, 1, 8) NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group tagThisFile = true +removeRunningTag = true -- Unhide layers fn unhidelayers = @@ -599,6 +600,7 @@ try if tagFile == undefined then ( nlerror ("WARNING can't create tag file "+tag) + removeRunningTag = false ) else ( @@ -606,6 +608,10 @@ try close tagFile ) ) + else + ( + removeRunningTag = false + ) resetMAXFile #noprompt gc () @@ -832,6 +838,7 @@ try if tagFile == undefined then ( nlerror ("WARNING can't create tag file "+tag) + removeRunningTag = false ) else ( @@ -839,6 +846,10 @@ try close tagFile ) ) + else + ( + removeRunningTag = false + ) ) resetMAXFile #noprompt @@ -956,6 +967,7 @@ try if tagFile == undefined then ( nlerror ("WARNING can't create tag file "+tag) + removeRunningTag = false ) else ( @@ -963,6 +975,10 @@ try close tagFile ) ) + else + ( + removeRunningTag = false + ) resetMAXFile #noprompt gc () @@ -978,13 +994,38 @@ try catch ( -- Error - nlerror ("ERROR fatal error exporting ligo zone in folder"+ligo_root_path) + nlerror("ERROR fatal error exporting ligo zone in folder"+ligo_root_path) + nlerror("FAIL Fatal error occurred") + NelForceQuitRightNow() + removeRunningTag = false tagThisFile = false ) +try +( + if (removeRunningTag) then + ( + resetMAXFile #noPrompt + ) +) +catch +( + nlerror("FAIL Last reset fails") + removeRunningTag = false +) +if (removeRunningTag) then +( + nlerror("SUCCESS All .max files have been successfully exported") + deleteFile("%TagDirectory%/max_running.tag") +) +else +( + nlerror("FAIL One or more issues occurred") + NelForceQuitRightNow() +) -resetMAXFile #noprompt +nlerror("BYE") quitMAX #noPrompt quitMAX () #noPrompt From 20920be7bdd95214abd0d3e14e392ea8b393164c Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 09:14:59 +0800 Subject: [PATCH 08/16] Fix ligoscape.cfg load --- code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp | 2 +- code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp index a4d41649f..c09158a05 100644 --- a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp @@ -134,7 +134,7 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di if (res) { // Path - std::string path = NLMISC::CFile::getPath(MCharStrToUtf8(sModulePath) + "ligoscape.cfg"); + std::string path = NLMISC::CFile::getPath(MCharStrToUtf8(sModulePath)) + "ligoscape.cfg"; try { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp index 8f3912b0e..5c5bd82f8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp @@ -4063,7 +4063,7 @@ bool loadLigoConfigFile (CLigoConfig& config, Interface& it) if (res) { // Path - std::string modulePath = NLMISC::CFile::getPath(MCharStrToUtf8(sModulePath)); + std::string modulePath = NLMISC::CFile::getPath(MCharStrToUtf8(sModulePath)) + "ligoscape.cfg"; try { From 8d96487b6973cbcdcf12b260ca98eb8e4bd15c4c Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 09:15:37 +0800 Subject: [PATCH 09/16] Quit max on ligoscape export error --- .../build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms index e1d5de20e..bbeffe495 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms +++ b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms @@ -86,6 +86,9 @@ fn lowercase instring = -- Allocate 20 Me for the script heapSize += 15000000 +-- In case of error just abort the app and don't show nel report window +NelForceQuitOnMsgDisplayer() + nlErrorFilename = "output_logfile" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then From 8bae2ef613e49118988fbe7a6081a2962693a60f Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 09:24:53 +0800 Subject: [PATCH 10/16] Save shapes in lowercase --- .../3d/plugin_max/nel_export/nel_export.cpp | 8 +++---- .../generators/max_exporter_scripts/shape.ms | 24 +++++++++++++++++-- .../processes/shape/maxscript/shape_export.ms | 24 +++++++++++++++++-- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp index a44167294..fdedc9a3d 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp @@ -354,7 +354,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP if (RPO::isZone (*pNode, time)) { // Save path - std::string sSavePath = MCharStrToUtf8(pNode->GetName()); + std::string sSavePath = NLMISC::toLower(MCharStrToUtf8(pNode->GetName())); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -372,7 +372,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP else if (CExportNel::isVegetable (*pNode, time)) { // Save path - std::string sSavePath = MCharStrToUtf8(pNode->GetName()); + std::string sSavePath = NLMISC::toLower(MCharStrToUtf8(pNode->GetName())); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -391,7 +391,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP else if (CExportNel::isLodCharacter (*pNode, time)) { // Save path - std::string sSavePath = MCharStrToUtf8(pNode->GetName()); + std::string sSavePath = NLMISC::toLower(MCharStrToUtf8(pNode->GetName())); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -410,7 +410,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP else if (CExportNel::isMesh (*pNode, time)) { // Save path - std::string sSavePath = MCharStrToUtf8(pNode->GetName()); + std::string sSavePath = NLMISC::toLower(MCharStrToUtf8(pNode->GetName())); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms index a3b28bc02..590dcab75 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms @@ -26,6 +26,26 @@ NEL3D_APPDATA_COLLISION = 1423062613 NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 NEL3D_APPDATA_AUTOMATIC_ANIMATION = 1423062617 +-- Lower case +fn lowercase instring = +( + local upper, lower, outstring + upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + lower="abcdefghijklmnopqrstuvwxyz" + + outstring = copy instring + + for iii = 1 to outstring.count do + ( + jjj = findString upper outstring[iii] + if (jjj != undefined) then + outstring[iii] = lower[jjj] + else + outstring[iii] = instring[iii] + ) + return outstring -- value of outstring will be returned as function result +) + -- This node is n accelerator ? fn isAccelerator node = ( @@ -287,9 +307,9 @@ fn runNelMaxExportSub inputMaxFile retryCount = ( -- Output directory if (haveCoarseMesh node) == true then - output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape") + output = ("%OutputDirectoryWithCoarseMesh%/" + lowercase(node.name) + ".shape") else - output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape") + output = ("%OutputDirectoryWithoutCoarseMesh%/" + lowercase(node.name) + ".shape") -- Compare file date if (NeLTestFileDate output inputMaxFile) == true then diff --git a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms index 375fe8eea..9df535d1d 100755 --- a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -102,6 +102,26 @@ NEL3D_APPDATA_COLLISION = 1423062613 NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 NEL3D_APPDATA_AUTOMATIC_ANIMATION = 1423062617 +-- Lower case +fn lowercase instring = +( + local upper, lower, outstring + upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + lower="abcdefghijklmnopqrstuvwxyz" + + outstring = copy instring + + for iii = 1 to outstring.count do + ( + jjj = findString upper outstring[iii] + if (jjj != undefined) then + outstring[iii] = lower[jjj] + else + outstring[iii] = instring[iii] + ) + return outstring -- value of outstring will be returned as function result +) + -- This node is n accelerator ? fn isAccelerator node = ( @@ -363,9 +383,9 @@ fn runNelMaxExportSub inputMaxFile retryCount = ( -- Output directory if (haveCoarseMesh node) == true then - output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape") + output = ("%OutputDirectoryWithCoarseMesh%/" + lowercase(node.name) + ".shape") else - output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape") + output = ("%OutputDirectoryWithoutCoarseMesh%/" + lowercase(node.name) + ".shape") -- Compare file date if (NeLTestFileDate output inputMaxFile) == true then From 2d29e7224fdab31b0773461613eb63c62ffa0440 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 09:33:01 +0800 Subject: [PATCH 11/16] Fix ligo export log --- code/nel/tools/build_gamedata/processes/ligo/1_export.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index 4077ddb1c..dc0e0d4b4 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -29,7 +29,9 @@ sys.path.append("../../configuration") if os.path.isfile("log.log"): os.remove("log.log") -log = open("log.log", "w") +if os.path.isfile("temp_log.log"): + os.remove("temp_log.log") +log = open("temp_log.log", "w") from scripts import * from buildsite import * from process import * @@ -140,6 +142,9 @@ if LigoExportLand == "" or LigoExportOnePass == 1: printLog(log, "") log.close() +if os.path.isfile("log.log"): + os.remove("log.log") +shutil.move("temp_log.log", "log.log") # end of file From 76d88f546af9f7c34b7aa1ed7ad7a56d3ff5a0a0 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 10:58:20 +0800 Subject: [PATCH 12/16] Cleanup ligo export script --- .../build_gamedata/processes/ligo/1_export.py | 6 +- .../ligo/maxscript/nel_ligo_export.ms | 112 ++++++++++++------ 2 files changed, 76 insertions(+), 42 deletions(-) diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index dc0e0d4b4..e0f9bab77 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -92,9 +92,9 @@ if LigoExportLand == "" or LigoExportOnePass == 1: sSrc = open(scriptSrc, "r") sDst = open(scriptDst, "w") for line in sSrc: - newline = line.replace("output_logfile", outputLogfile) - newline = newline.replace("output_directory_tag", tagDirectory) - newline = newline.replace("bankFilename", smallBank) + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%TagDirectory%", tagDirectory) + newline = newline.replace("%SmallBankFilename%", smallBank) sDst.write(newline) sSrc.close() sDst.close() diff --git a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms index bbeffe495..c74c4b916 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms +++ b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms @@ -89,7 +89,7 @@ heapSize += 15000000 -- In case of error just abort the app and don't show nel report window NelForceQuitOnMsgDisplayer() -nlErrorFilename = "output_logfile" +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -237,16 +237,19 @@ fn isToBeExportedCollision node = return false ) --- Export collisions from the current loaded zone -fn exportCollisionsFromZone outputNelDir filename = +fn selectCollisionsForExport = ( -- Select all collision mesh max select none clearSelection() + anySelected = false; for m in geometry do ( if (isToBeExportedCollision m) == true then + ( selectmore m + anySelected = true + ) ) for node in objects where classOf node == XRefObject do ( @@ -254,10 +257,18 @@ fn exportCollisionsFromZone outputNelDir filename = if (superclassOf sourceObject == GeometryClass) then ( if (isToBeExportedCollision node) == true then + ( selectmore node + anySelected = true + ) ) ) - + return anySelected +) + +-- Export collisions from the current loaded zone +fn exportCollisionsFromZone outputNelDir filename = +( -- Export the collision if (NelExportCollision ($selection as array) outputNelDir) == false then ( @@ -388,8 +399,8 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi output = (outputPath + ig_array[ig] + ".ig") -- Check date - if (NeLTestFileDate output inputFile) == true then - ( + -- if (NeLTestFileDate output inputFile) == true then + -- ( -- Select none max select none clearSelection() @@ -460,12 +471,12 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi nlerror ("ERROR fatal error exporting ig "+ig_array[ig]+" in file "+inputFile) tagThisFile = false ) - ) - else - ( - nlerror ("SKIPPED ligo ig "+output) - tagThisFile = false - ) + -- ) + -- else + -- ( + -- nlerror ("SKIPPED ligo ig "+output) + -- tagThisFile = false + -- ) ) ) ) @@ -488,7 +499,7 @@ MaxFilesList = getFiles (ligo_root_path + "*.max") try ( -- Set the bank pathname - bank_filename = "bankFilename" + bank_filename = "%SmallBankFilename%" NelSetTileBank bank_filename cellSize = NeLLigoGetCellSize () @@ -504,7 +515,7 @@ try if (tokenArray.count == 3) and (tokenArray[1] == "zonematerial") then ( -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + tag = ("%TagDirectory%/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") -- Compare date with the tag file if (NeLTestFileDate tag curFileName) == true then @@ -584,21 +595,27 @@ try ) -- export collisions - try + if selectCollisionsForExport() then ( - nlerror("exportCollisionsFromZone " + curFileName) - exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName - ) - catch - ( - nlerror("couldn't export collision for " + curFileName) - tagThisFile = false + try + ( + nlerror("exportCollisionsFromZone " + curFileName) + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + nlerror("past exportCollisionsFromZone") + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) ) -- Write a tag file + nlerror("check to write tag") if tagThisFile == true then ( - nlerror("tagThisFile " + curFileName) + nlerror("TAG " + curFileName) + nlerror("TAGFILE " + tag) tagFile = createFile tag if tagFile == undefined then ( @@ -613,6 +630,7 @@ try ) else ( + nlerror("NOT TAGGING " + curFileName) removeRunningTag = false ) @@ -657,7 +675,7 @@ try ) -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + tag = ("%TagDirectory%/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") -- Compare date with the tag file if (NeLTestFileDate tag curFileName) == true then @@ -813,6 +831,7 @@ try -- export igs try ( + nlerror("exportInstanceGroupFromZone " + curFileName) exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") (lowercase (zoneBaseName)) zone cellSize ) catch @@ -822,14 +841,18 @@ try ) -- export collisions - try + if selectCollisionsForExport() then ( - exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName - ) - catch - ( - nlerror("couldn't export collision for " + curFileName) - tagThisFile = false + try + ( + nlerror("exportCollisionsFromZone " + curFileName) + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) ) ) ) @@ -837,6 +860,8 @@ try -- Write a tag file if tagThisFile == true then ( + nlerror("TAG " + curFileName) + nlerror("TAGFILE " + tag) tagFile = createFile tag if tagFile == undefined then ( @@ -851,6 +876,7 @@ try ) else ( + nlerror("NOT TAGGING " + curFileName) removeRunningTag = false ) ) @@ -878,7 +904,7 @@ try if (tokenArray.count == 2) and (tokenArray[1] == "zonespecial") then ( -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + tag = ("%TagDirectory%/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") -- Compare date with the tag file if (NeLTestFileDate tag curFileName) == true then @@ -944,6 +970,7 @@ try -- export matching igs try ( + nlerror("exportInstanceGroupFromZone " + curFileName) exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") "" 0 cellSize ) catch @@ -953,19 +980,25 @@ try ) -- export collisions - try + if selectCollisionsForExport() then ( - exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName - ) - catch - ( - nlerror("couldn't export collision for " + curFileName) - tagThisFile = false + try + ( + nlerror("exportCollisionsFromZone " + curFileName) + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) ) -- Write a tag file if tagThisFile == true then ( + nlerror("TAG " + curFileName) + nlerror("TAGFILE " + tag) tagFile = createFile tag if tagFile == undefined then ( @@ -980,6 +1013,7 @@ try ) else ( + nlerror("NOT TAGGING " + curFileName) removeRunningTag = false ) From f3c45d7e8228442e2f97e9ad7f47ced2bb3ecab5 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 11:12:45 +0800 Subject: [PATCH 13/16] Don't block on warnings during ligo export --- .../ligo/maxscript/nel_ligo_export.ms | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms index c74c4b916..90f8b1b26 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms +++ b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms @@ -84,7 +84,7 @@ fn lowercase instring = ) -- Allocate 20 Me for the script -heapSize += 15000000 +heapSize += 30000000 -- In case of error just abort the app and don't show nel report window NelForceQuitOnMsgDisplayer() @@ -526,8 +526,17 @@ try resetMAXFile #noprompt nlerror ("Scanning file "+curFileName+" ...") - mergeMaxFile curFileName quiet:true - objXRefMgr.UpdateAllRecords() + loadMaxFile curFileName quiet:true + try + ( + nlerror("Update XRef records...") + objXRefMgr.UpdateAllRecords() + ) + catch + ( + nlerror("ERROR Failed to update XRef! (DON'T TAG)...") + tagThisFile = false + ) -- Unhide category unhidelayers() @@ -686,8 +695,17 @@ try resetMAXFile #noprompt nlerror ("Scanning file "+curFileName+" ...") - mergeMaxFile curFileName quiet:true - objXRefMgr.UpdateAllRecords() + loadMaxFile curFileName quiet:true + try + ( + nlerror("Update XRef records...") + objXRefMgr.UpdateAllRecords() + ) + catch + ( + nlerror("ERROR Failed to update XRef! (DON'T TAG)...") + tagThisFile = false + ) -- Unhide category unhidelayers() @@ -915,8 +933,17 @@ try resetMAXFile #noprompt nlerror ("Scanning file "+curFileName+" ...") - mergeMaxFile curFileName quiet:true - objXRefMgr.UpdateAllRecords() + loadMaxFile curFileName quiet:true + try + ( + nlerror("Update XRef records...") + objXRefMgr.UpdateAllRecords() + ) + catch + ( + nlerror("ERROR Failed to update XRef! (DON'T TAG)...") + tagThisFile = false + ) -- Unhide category unhidelayers() From 5d9e1d9bf8024f6b290fa24c262f9200f78fd8e7 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 19:58:50 +0800 Subject: [PATCH 14/16] Fix ligo export --- code/nel/src/ligo/zone_bank.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/ligo/zone_bank.cpp b/code/nel/src/ligo/zone_bank.cpp index b1c6b73c6..c26205316 100644 --- a/code/nel/src/ligo/zone_bank.cpp +++ b/code/nel/src/ligo/zone_bank.cpp @@ -508,7 +508,7 @@ bool CZoneBank::initFromPath(const std::string &sPathName, std::string &error) if (ext == "ligozone") { - if (!addElement(NLMISC::CFile::getFilename(files[i]), error)) + if (!addElement(files[i], error)) return false; } } From 6cc30e7e6b40dd11fd9f18ec81c58e83ef381862 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 14 May 2019 05:00:00 +0800 Subject: [PATCH 15/16] Resave world editor rc --- .../world_editor/world_editor/resource.h | 20 +- .../world_editor/world_editor/world_editor.rc | 632 +++++++++--------- 2 files changed, 311 insertions(+), 341 deletions(-) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/resource.h b/code/ryzom/tools/leveldesign/world_editor/world_editor/resource.h index 2a294d748..d90a7e8c0 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/resource.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/resource.h @@ -1,21 +1,5 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. +// Microsoft Visual C++ generated include file. // Used by world_editor.rc // #define IDC_BROWSE 3 @@ -341,7 +325,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 178 +#define _APS_NEXT_RESOURCE_VALUE 179 #define _APS_NEXT_COMMAND_VALUE 33485 #define _APS_NEXT_CONTROL_VALUE 1022 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.rc b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.rc index 4a790bf23..6a03f0390 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.rc +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.rc @@ -1,4 +1,4 @@ -//Microsoft Developer Studio generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" @@ -16,10 +16,8 @@ // English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) -#endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -27,18 +25,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE BEGIN "#define _AFX_NO_OLE_RESOURCES\r\n" "#define _AFX_NO_TRACKER_RESOURCES\r\n" @@ -69,41 +67,63 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "res\\world_editor.ico" -IDR_WORLDETYPE ICON DISCARDABLE "res\\world_editor_doc.ico" -IDI_FOLDER_CLOSED ICON DISCARDABLE "res\\folder_closed.ico" -IDI_POINT_OPENED ICON DISCARDABLE "res\\point_opened.ico" -IDI_LINE_OPENED ICON DISCARDABLE "res\\line_opened.ico" -IDI_ZONE_OPENED ICON DISCARDABLE "res\\zone_opened.ico" -IDI_FOLDER_OPENED ICON DISCARDABLE "res\\folder_opened.ico" -IDI_PROPERTY_CLOSED ICON DISCARDABLE "res\\property_closed.ico" -IDI_ROOT_CLOSED ICON DISCARDABLE "res\\root_closed.ico" -IDI_PROPERTY_OPENED ICON DISCARDABLE "res\\property_opened.ico" -IDI_LINE_CLOSED ICON DISCARDABLE "res\\line_closed.ico" -IDI_POINT_CLOSED ICON DISCARDABLE "res\\point_closed.ico" -IDI_ZONE_CLOSED ICON DISCARDABLE "res\\zone_closed.ico" -IDI_ROOT_OPENED ICON DISCARDABLE "res\\root_opened.ico" -IDI_FOLDER_HIDDEN ICON DISCARDABLE "res\\folder_hidden.ico" -IDI_LINE_HIDDEN ICON DISCARDABLE "res\\line_hidden.ico" -IDI_POINT_HIDDEN ICON DISCARDABLE "res\\point_hidden.ico" -IDI_PROPERTY_HIDDEN ICON DISCARDABLE "res\\property_hidden.ico" -IDI_ROOT_HIDDEN ICON DISCARDABLE "res\\root_hidden.ico" -IDI_ZONE_HIDDEN ICON DISCARDABLE "res\\zone_hidden.ico" -IDI_ERROR_STRUCTURE ICON DISCARDABLE "res\\erro.ico" +IDR_MAINFRAME ICON "res\\world_editor.ico" + +IDR_WORLDETYPE ICON "res\\world_editor_doc.ico" + +IDI_FOLDER_CLOSED ICON "res\\folder_closed.ico" + +IDI_POINT_OPENED ICON "res\\point_opened.ico" + +IDI_LINE_OPENED ICON "res\\line_opened.ico" + +IDI_ZONE_OPENED ICON "res\\zone_opened.ico" + +IDI_FOLDER_OPENED ICON "res\\folder_opened.ico" + +IDI_PROPERTY_CLOSED ICON "res\\property_closed.ico" + +IDI_ROOT_CLOSED ICON "res\\root_closed.ico" + +IDI_PROPERTY_OPENED ICON "res\\property_opened.ico" + +IDI_LINE_CLOSED ICON "res\\line_closed.ico" + +IDI_POINT_CLOSED ICON "res\\point_closed.ico" + +IDI_ZONE_CLOSED ICON "res\\zone_closed.ico" + +IDI_ROOT_OPENED ICON "res\\root_opened.ico" + +IDI_FOLDER_HIDDEN ICON "res\\folder_hidden.ico" + +IDI_LINE_HIDDEN ICON "res\\line_hidden.ico" + +IDI_POINT_HIDDEN ICON "res\\point_hidden.ico" + +IDI_PROPERTY_HIDDEN ICON "res\\property_hidden.ico" + +IDI_ROOT_HIDDEN ICON "res\\root_hidden.ico" + +IDI_ZONE_HIDDEN ICON "res\\zone_hidden.ico" + +IDI_ERROR_STRUCTURE ICON "res\\erro.ico" + ///////////////////////////////////////////////////////////////////////////// // // Bitmap // -IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp" +IDR_MAINFRAME BITMAP "res\\Toolbar.bmp" + ///////////////////////////////////////////////////////////////////////////// // // Toolbar // -IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 16 +IDR_MAINFRAME TOOLBAR 16, 16 BEGIN BUTTON ID_FILE_NEW BUTTON ID_FILE_OPEN @@ -165,7 +185,7 @@ END // Menu // -IDR_MAINFRAME MENU PRELOAD DISCARDABLE +IDR_MAINFRAME MENU BEGIN POPUP "&File" BEGIN @@ -236,12 +256,8 @@ BEGIN MENUITEM "Show / Hide C&ollisions\tO", ID_VIEW_COLLISIONS MENUITEM "Show / Hide &PACS\tCTRL+P", ID_VIEW_PACS MENUITEM SEPARATOR - MENUITEM "Locate selected primitives\tALT+L", - ID_VIEW_LOCATESELECTEDPRIMITIVES - - MENUITEM "Locate selected primitives in tree\tALT+T", - ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE - + MENUITEM "Locate selected primitives\tALT+L", ID_VIEW_LOCATESELECTEDPRIMITIVES + MENUITEM "Locate selected primitives in tree\tALT+T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE END POPUP "&Project" BEGIN @@ -257,14 +273,11 @@ BEGIN MENUITEM "&Reset unique ID", ID_PROJECT_RESETUNIQUEID MENUITEM "&Generate missing ID", ID_PROJECT_GENERATENULLID MENUITEM "&Force ID uniqueness", ID_PROJECT_CORRECT_ID - MENUITEM "&Reset primitive configuration", - ID_PROJECT_RESET_PRIMITIVE_CONFIGURATION - + MENUITEM "&Reset primitive configuration", ID_PROJECT_RESET_PRIMITIVE_CONFIGURATION END POPUP "Windows" BEGIN MENUITEM "Primitive configuration", ID_WINDOWS_PRIMITIVECONFIGURATION - END POPUP "&Help" BEGIN @@ -275,13 +288,23 @@ BEGIN END END +IDR_MENU1 MENU +BEGIN + POPUP "Primitive Configuration" + BEGIN + MENUITEM "&Select", ID_PRIMITIVECONFIGURATION_SELECT + MENUITEM "&Show", ID_PRIMITIVECONFIGURATION_SHOW + MENUITEM "&Hide", ID_PRIMITIVECONFIGURATION_HIDE + END +END + ///////////////////////////////////////////////////////////////////////////// // // Accelerator // -IDR_DIALOG ACCELERATORS PRELOAD MOVEABLE PURE +IDR_DIALOG ACCELERATORS BEGIN "F", ID_FIND, VIRTKEY, CONTROL, NOINVERT "G", ID_GOTO, VIRTKEY, CONTROL, NOINVERT @@ -291,8 +314,7 @@ BEGIN "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT "P", ID_VIEW_PACS, VIRTKEY, CONTROL, NOINVERT "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT - "T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE, VIRTKEY, ALT, - NOINVERT + "T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE, VIRTKEY, ALT, NOINVERT VK_F1, ID_HELP_FINDER, VIRTKEY, NOINVERT VK_F10, ID_EDIT_RADIUS, VIRTKEY, NOINVERT VK_F11, ID_EDIT_ADD_POINT, VIRTKEY, NOINVERT @@ -308,7 +330,7 @@ BEGIN VK_RETURN, ID_EDIT_PROPERTIES, VIRTKEY, ALT, NOINVERT END -IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE +IDR_MAINFRAME ACCELERATORS BEGIN "A", ID_EDIT_SELECT_ALL, VIRTKEY, CONTROL, NOINVERT "C", ID_EDIT_SELECT_CHILDREN, VIRTKEY, NOINVERT @@ -332,8 +354,7 @@ BEGIN "R", ID_EDIT_COLLAPSE, VIRTKEY, NOINVERT "S", ID_VIEW_SHOW, VIRTKEY, NOINVERT "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT - "T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE, VIRTKEY, ALT, - NOINVERT + "T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE, VIRTKEY, ALT, NOINVERT "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT VK_DELETE, ID_EDIT_DELETE, VIRTKEY, NOINVERT @@ -369,8 +390,8 @@ END // Dialog // -IDD_CREATE_ELEMENT DIALOG DISCARDABLE 0, 0, 247, 47 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_CREATE_ELEMENT DIALOG 0, 0, 247, 47 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Create Element" FONT 8, "MS Sans Serif" BEGIN @@ -379,84 +400,58 @@ BEGIN EDITTEXT IDC_EDIT_NAME,32,7,148,14,ES_AUTOHSCROLL LTEXT "Name",IDC_STATIC,7,7,20,8 LTEXT "Type",IDC_STATIC,7,25,20,8 - COMBOBOX IDC_COMBOTYPE,32,25,148,106,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBOTYPE,32,25,148,106,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP END -IDD_TOOLS_ZONE DIALOG DISCARDABLE 0, 0, 246, 278 -STYLE WS_CHILD -FONT 8, "MS Sans Serif" +IDD_TOOLS_ZONE DIALOGEX 0, 0, 246, 278 +STYLE DS_SETFONT | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - COMBOBOX IDC_CATTYPE1,7,7,83,65,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATVALUE1,94,7,83,66,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATTYPE2,7,26,83,65,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATVALUE2,94,26,83,66,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATTYPE3,7,46,83,65,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATVALUE3,94,46,83,66,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATTYPE4,7,66,83,65,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATVALUE4,94,66,83,66,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "AND",IDC_AND2,"Button",BS_AUTORADIOBUTTON | WS_GROUP, - 183,28,31,10 + COMBOBOX IDC_CATTYPE1,7,7,83,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATVALUE1,94,7,83,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATTYPE2,7,26,83,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATVALUE2,94,26,83,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATTYPE3,7,46,83,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATVALUE3,94,46,83,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATTYPE4,7,66,83,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATVALUE4,94,66,83,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "AND",IDC_AND2,"Button",BS_AUTORADIOBUTTON | WS_GROUP,183,28,31,10 CONTROL "OR",IDC_OR2,"Button",BS_AUTORADIOBUTTON,213,28,29,10 - CONTROL "AND",IDC_AND3,"Button",BS_AUTORADIOBUTTON | WS_GROUP, - 183,47,31,10 + CONTROL "AND",IDC_AND3,"Button",BS_AUTORADIOBUTTON | WS_GROUP,183,47,31,10 CONTROL "OR",IDC_OR3,"Button",BS_AUTORADIOBUTTON,213,47,29,10 - CONTROL "AND",IDC_AND4,"Button",BS_AUTORADIOBUTTON | WS_GROUP, - 183,66,31,10 + CONTROL "AND",IDC_AND4,"Button",BS_AUTORADIOBUTTON | WS_GROUP,183,66,31,10 CONTROL "OR",IDC_OR4,"Button",BS_AUTORADIOBUTTON,213,66,29,10 GROUPBOX "",IDC_STATIC,180,22,59,18,WS_GROUP GROUPBOX "",IDC_STATIC,180,41,59,18,WS_GROUP GROUPBOX "",IDC_STATIC,180,60,59,18,WS_GROUP - CONTROL "0°",IDC_ROT0,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7, - 83,23,10 - CONTROL "90°",IDC_ROT90,"Button",BS_AUTORADIOBUTTON,31,83,27,10 - CONTROL "180°",IDC_ROT180,"Button",BS_AUTORADIOBUTTON,59,83,31, - 10 - CONTROL "270°",IDC_ROT270,"Button",BS_AUTORADIOBUTTON,91,83,31, - 10 - CONTROL "Ran",IDC_ROTRANDOM,"Button",BS_AUTORADIOBUTTON,123,83, - 29,10 - CONTROL "Full Cycle",IDC_ROTCYCLE,"Button",BS_AUTORADIOBUTTON, - 152,83,46,10 - CONTROL "NoFlip",IDC_FLIPNO,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,7,94,36,10 - CONTROL "Flip",IDC_FLIPYES,"Button",BS_AUTORADIOBUTTON,45,94,27, - 10 - CONTROL "Ran",IDC_FLIPRANDOM,"Button",BS_AUTORADIOBUTTON,74,94, - 29,10 - CONTROL "Full Cycle",IDC_FLIPCYCLE,"Button",BS_AUTORADIOBUTTON, - 103,94,46,10 - CONTROL "Random",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,189,7,43,10 - CONTROL "Not Propagate",IDC_NOT_PROPAGATE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,177,95,62,10 - CONTROL "Full Cycle",IDC_FULL_CYCLE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,189,16,46,10 - CONTROL "Force",IDC_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 205,84,34,10 + CONTROL "0°",IDC_ROT0,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,83,23,10 + CONTROL "90°",IDC_ROT90,"Button",BS_AUTORADIOBUTTON,31,83,27,10 + CONTROL "180°",IDC_ROT180,"Button",BS_AUTORADIOBUTTON,59,83,31,10 + CONTROL "270°",IDC_ROT270,"Button",BS_AUTORADIOBUTTON,91,83,31,10 + CONTROL "Ran",IDC_ROTRANDOM,"Button",BS_AUTORADIOBUTTON,123,83,29,10 + CONTROL "Full Cycle",IDC_ROTCYCLE,"Button",BS_AUTORADIOBUTTON,152,83,46,10 + CONTROL "NoFlip",IDC_FLIPNO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,94,36,10 + CONTROL "Flip",IDC_FLIPYES,"Button",BS_AUTORADIOBUTTON,45,94,27,10 + CONTROL "Ran",IDC_FLIPRANDOM,"Button",BS_AUTORADIOBUTTON,74,94,29,10 + CONTROL "Full Cycle",IDC_FLIPCYCLE,"Button",BS_AUTORADIOBUTTON,103,94,46,10 + CONTROL "Random",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,7,43,10 + CONTROL "Not Propagate",IDC_NOT_PROPAGATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,177,95,62,10 + CONTROL "Full Cycle",IDC_FULL_CYCLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,16,46,10 + CONTROL "Force",IDC_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,84,34,10 END -IDD_SELECTZONE DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_SELECTZONE DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Select Zone" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,129,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,129,74,50,14 - LISTBOX IDC_LISTZONE,7,7,118,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_LISTZONE,7,7,118,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END -IDD_GENERATE DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_GENERATE DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Generate" FONT 8, "MS Sans Serif" BEGIN @@ -470,16 +465,15 @@ BEGIN EDITTEXT IDC_EDITMAXX,33,49,40,14,ES_AUTOHSCROLL LTEXT "MaxY",IDC_STATIC,7,71,19,8 EDITTEXT IDC_EDITMAXY,33,67,40,14,ES_AUTOHSCROLL - COMBOBOX IDC_COMBOMATERIAL,87,7,92,58,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBOMATERIAL,87,7,92,58,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Zone Base X",IDC_STATIC,94,33,42,8 EDITTEXT IDC_EDITZONEBASEX,139,31,40,14,ES_AUTOHSCROLL LTEXT "Zone Base Y",IDC_STATIC,93,52,42,8 EDITTEXT IDC_EDITZONEBASEY,139,50,40,14,ES_AUTOHSCROLL END -IDD_MOVE DIALOG DISCARDABLE 0, 0, 186, 46 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_MOVE DIALOG 0, 0, 186, 46 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Move In Cell" FONT 8, "MS Sans Serif" BEGIN @@ -491,8 +485,8 @@ BEGIN EDITTEXT IDC_EDITYOFFSET,49,23,40,14,ES_AUTOHSCROLL END -IDD_EXPORT DIALOG DISCARDABLE 0, 0, 375, 316 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_EXPORT DIALOG 0, 0, 375, 316 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Export To Client" FONT 8, "MS Sans Serif" BEGIN @@ -502,12 +496,9 @@ BEGIN LTEXT "Reference Zones Directory",IDC_STATIC,7,7,86,8 PUSHBUTTON "...",IDC_BUTTON_REFZONEDIR,166,16,13,14 GROUPBOX "Lighting",IDC_STATIC,195,280,118,30 - CONTROL "Noise",IDC_RADIOLIGHTNOISE,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,203,292,34,10 - CONTROL "Patch",IDC_RADIOLIGHTPATCH,"Button",BS_AUTORADIOBUTTON, - 241,292,35,10 - CONTROL "No",IDC_RADIOLIGHTNO,"Button",BS_AUTORADIOBUTTON,279, - 292,25,10 + CONTROL "Noise",IDC_RADIOLIGHTNOISE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,203,292,34,10 + CONTROL "Patch",IDC_RADIOLIGHTPATCH,"Button",BS_AUTORADIOBUTTON,241,292,35,10 + CONTROL "No",IDC_RADIOLIGHTNO,"Button",BS_AUTORADIOBUTTON,279,292,25,10 LTEXT "Output Zones Directory",IDC_STATIC,7,33,74,8 EDITTEXT IDC_EDIT_OUTZONEDIR,7,42,153,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BUTTON_OUTZONEDIR,166,42,13,14 @@ -530,8 +521,7 @@ BEGIN EDITTEXT IDC_EDIT_ZONEMAX,321,255,40,14,ES_AUTOHSCROLL GROUPBOX "Export Limiter",IDC_STATIC,195,245,172,27 EDITTEXT IDC_EDIT_REFIGDIR,7,80,153,14,ES_AUTOHSCROLL - LTEXT "Reference Instance Group Directory",IDC_STATIC,7,70,115, - 8 + LTEXT "Reference Instance Group Directory",IDC_STATIC,7,70,115,8 PUSHBUTTON "...",IDC_BUTTON_REFIGDIR,166,80,13,14 LTEXT "Output Instance Group Directory",IDC_STATIC,7,97,103,8 EDITTEXT IDC_EDIT_OUTIGDIR,7,105,153,14,ES_AUTOHSCROLL @@ -545,19 +535,14 @@ BEGIN EDITTEXT IDC_EDIT_OUTCMBDIR,197,42,153,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BUTTON_OUTCMBDIR,355,42,13,14 GROUPBOX "",IDC_STATIC,191,1,182,61 - EDITTEXT IDC_EDIT_REFADDITIONNALIGDIR,198,80,153,14, - ES_AUTOHSCROLL - LTEXT "Reference Instance Group Directory",IDC_STATIC,198,70, - 115,8 + EDITTEXT IDC_EDIT_REFADDITIONNALIGDIR,198,80,153,14,ES_AUTOHSCROLL + LTEXT "Reference Instance Group Directory",IDC_STATIC,198,70,115,8 PUSHBUTTON "...",IDC_BUTTON_REFADDITIONNALIGDIR,356,80,13,14 - LTEXT "Output Instance Group Directory",IDC_STATIC,198,97,103, - 8 - EDITTEXT IDC_EDIT_OUTADDITIONNALIGDIR,198,105,153,14, - ES_AUTOHSCROLL + LTEXT "Output Instance Group Directory",IDC_STATIC,198,97,103,8 + EDITTEXT IDC_EDIT_OUTADDITIONNALIGDIR,198,105,153,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BUTTON_OUTADDITIONNALIGDIR,356,105,13,14 GROUPBOX "",IDC_STATIC,192,62,181,61 - CONTROL "Export collisions",IDC_EXPORT_COLLISIONS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,201,215,81,11 + CONTROL "Export collisions",IDC_EXPORT_COLLISIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,215,81,11 EDITTEXT IDC_EDIT_DFNDIR,197,138,153,14,ES_AUTOHSCROLL LTEXT "Dfn base directory",IDC_STATIC,197,128,58,8 PUSHBUTTON "...",IDC_BUTTON_DFNDIR,355,138,13,14 @@ -574,22 +559,21 @@ BEGIN PUSHBUTTON "...",IDC_BUTTON_COLORMAPFILE,164,255,13,14 END -IDD_TYPEMANAGER DIALOG DISCARDABLE 0, 0, 186, 156 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_TYPEMANAGER DIALOG 0, 0, 186, 156 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Type Manager" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,7,135,50,14 PUSHBUTTON "Cancel",IDCANCEL,129,135,50,14 - LISTBOX IDC_LISTTYPE,7,26,172,102,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_LISTTYPE,7,26,172,102,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Add Type",IDC_ADDTYPE,7,7,50,14 PUSHBUTTON "Remove Type",IDC_REMOVETYPE,68,7,50,14 PUSHBUTTON "Edit Type",IDC_EDITTYPE,129,7,50,14 END -IDD_TYPE DIALOG DISCARDABLE 0, 0, 186, 46 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_TYPE DIALOG 0, 0, 186, 46 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Type" FONT 8, "MS Sans Serif" BEGIN @@ -598,42 +582,38 @@ BEGIN LTEXT "Name",IDC_STATIC,7,7,20,8 LTEXT "Color",IDC_STATIC,7,29,17,8 EDITTEXT IDC_EDITNAME,36,7,82,14,ES_AUTOHSCROLL - CONTROL "Color",IDC_BUTTONCOLOR,"Button",BS_OWNERDRAW | - WS_TABSTOP,36,24,50,14 + CONTROL "Color",IDC_BUTTONCOLOR,"Button",BS_OWNERDRAW | WS_TABSTOP,36,24,50,14 END -IDD_TYPESEL DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_TYPESEL DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Select Type" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,129,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,129,74,50,14 - LISTBOX IDC_LIST,7,7,117,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_LIST,7,7,117,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END -IDD_EXPORTCB DIALOG DISCARDABLE 0, 0, 310, 138 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +IDD_EXPORTCB DIALOG 0, 0, 310, 138 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION CAPTION "Export Callback" FONT 8, "MS Sans Serif" BEGIN PUSHBUTTON "Cancel",IDCANCEL,7,117,296,14 LTEXT "Export Pass",IDC_PASSTEXT,7,7,296,8 - CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7, - 18,296,14 - EDITTEXT IDC_EDIT_INFO,7,39,296,73,ES_MULTILINE | ES_AUTOHSCROLL | - WS_VSCROLL + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,18,296,14 + EDITTEXT IDC_EDIT_INFO,7,39,296,73,ES_MULTILINE | ES_AUTOHSCROLL | WS_VSCROLL END -IDD_TOOLS_LOGIC DIALOG DISCARDABLE 0, 0, 178, 278 -STYLE WS_CHILD +IDD_TOOLS_LOGIC DIALOG 0, 0, 178, 278 +STYLE DS_SETFONT | WS_CHILD FONT 8, "MS Sans Serif" BEGIN END -IDD_EDIT_STRING DIALOG DISCARDABLE 0, 0, 247, 47 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_EDIT_STRING DIALOG 0, 0, 247, 47 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Edit name" FONT 8, "MS Sans Serif" BEGIN @@ -644,21 +624,19 @@ BEGIN END IDD_LOADING DIALOGEX 0, 0, 281, 47 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_TOOLWINDOW CAPTION "NeL World Editor" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN CONTROL "Please Wait While Loading...",IDC_STATIC_TEXT_LOADING, "Static",SS_LEFTNOWORDWRAP | WS_GROUP,5,5,269,8 - ICON IDR_MAINFRAME,IDC_STATIC,5,20,20,20,SS_CENTERIMAGE | - SS_RIGHTJUST | SS_REALSIZEIMAGE - CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER, - 30,20,245,20 + ICON IDR_MAINFRAME,IDC_STATIC,5,20,20,20,SS_CENTERIMAGE | SS_RIGHTJUST | SS_REALSIZEIMAGE + CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER,30,20,245,20 END -IDD_CUSTOM_SNAPSHOT DIALOG DISCARDABLE 0, 0, 147, 130 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_CUSTOM_SNAPSHOT DIALOG 0, 0, 147, 130 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Snapshot" FONT 8, "MS Sans Serif" BEGIN @@ -668,20 +646,15 @@ BEGIN EDITTEXT IDC_HEIGHT,90,45,51,12,ES_AUTOHSCROLL LTEXT "Width:",IDC_STATIC,15,30,70,13,SS_CENTERIMAGE LTEXT "Height:",IDC_STATIC,15,45,70,12,SS_CENTERIMAGE - CONTROL "Keep bitmap ratio",IDC_KEEPRATIO,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,15,60,75,10 - CONTROL "RGB",IDC_RGBA,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5, - 80,60,10 - CONTROL "Grayscale",IDC_GRAY_SCALE,"Button",BS_AUTORADIOBUTTON,5, - 90,60,10 - CONTROL "Fixed size",IDC_FIXED_SIZE,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,5,5,60,10 - CONTROL "Custom size",IDC_GRAY_SCALE2,"Button", - BS_AUTORADIOBUTTON,5,15,60,10 + CONTROL "Keep bitmap ratio",IDC_KEEPRATIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,60,75,10 + CONTROL "RGB",IDC_RGBA,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5,80,60,10 + CONTROL "Grayscale",IDC_GRAY_SCALE,"Button",BS_AUTORADIOBUTTON,5,90,60,10 + CONTROL "Fixed size",IDC_FIXED_SIZE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5,5,60,10 + CONTROL "Custom size",IDC_GRAY_SCALE2,"Button",BS_AUTORADIOBUTTON,5,15,60,10 END -IDD_PROJECT_SETTINGS DIALOG DISCARDABLE 0, 0, 254, 153 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_PROJECT_SETTINGS DIALOG 0, 0, 254, 153 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Project Settings" FONT 8, "MS Sans Serif" BEGIN @@ -690,13 +663,12 @@ BEGIN EDITTEXT IDC_DATA_DIRECTORY,5,15,190,12,ES_AUTOHSCROLL LTEXT "Data directory:",IDC_STATIC,5,5,50,10 PUSHBUTTON "Browse",IDC_BROWSE,200,15,50,14 - COMBOBOX IDC_CONTEXT,5,45,105,85,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP + COMBOBOX IDC_CONTEXT,5,45,105,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Context:",IDC_STATIC,5,35,50,10 END IDD_PROPERTIES DIALOGEX 0, 0, 298, 121 -STYLE WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +STYLE DS_SETFONT | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME CAPTION "Properties" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN @@ -704,14 +676,12 @@ BEGIN PUSHBUTTON "&Cancel",IDCANCEL,124,105,50,15 PUSHBUTTON "&Update",IDUPDATE,240,105,50,15 SCROLLBAR IDC_SCROLLBAR_PROP,283,15,12,76,SBS_VERT - CONTROL "",IDC_PROPERTY_FRAME,"Static",SS_BLACKFRAME,0,0,297,103, - WS_EX_CLIENTEDGE - CONTROL "",IDC_FIRST_PROP,"Static",SS_BLACKFRAME | NOT - WS_VISIBLE,6,6,273,19 + CONTROL "",IDC_PROPERTY_FRAME,"Static",SS_BLACKFRAME,0,0,297,103,WS_EX_CLIENTEDGE + CONTROL "",IDC_FIRST_PROP,"Static",SS_BLACKFRAME | NOT WS_VISIBLE,6,6,273,19 END -IDD_SELECT_PRIMITIVE_BY_LOCATION DIALOG DISCARDABLE 0, 0, 172, 85 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_SELECT_PRIMITIVE_BY_LOCATION DIALOG 0, 0, 172, 85 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Select a primitive by its location" FONT 8, "MS Sans Serif" BEGIN @@ -726,8 +696,8 @@ BEGIN LTEXT "Threshold :",IDC_STATIC,10,45,40,15,SS_CENTERIMAGE END -IDD_FIND_PRIMITIVE DIALOG DISCARDABLE 0, 0, 349, 145 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_FIND_PRIMITIVE DIALOG 0, 0, 349, 145 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Find a primitive..." FONT 8, "MS Sans Serif" BEGIN @@ -738,16 +708,15 @@ BEGIN LTEXT "",IDC_PRIMITIVE_NAME,7,104,335,34,SS_SUNKEN DEFPUSHBUTTON "&Find Next",ID_FIND_NEXT,102,83,50,14 PUSHBUTTON "&Cancel",IDCANCEL,7,83,50,14 - CONTROL "selection only",IDC_SELECTION,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,57,65,59,10 + CONTROL "selection only",IDC_SELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,57,65,59,10 LTEXT "Replace With :",IDC_STATIC,7,48,48,8 EDITTEXT IDC_REPLACE_TEXT,56,42,286,14,ES_AUTOHSCROLL PUSHBUTTON "&Replace",ID_REPLACE,197,83,50,14 PUSHBUTTON "&ReplaceAll",ID_REPLACE_ALL,292,83,50,14 END -IDD_GOTO_POS DIALOG DISCARDABLE 0, 0, 142, 58 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +IDD_GOTO_POS DIALOG 0, 0, 142, 58 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION CAPTION "Goto position" FONT 8, "MS Sans Serif" BEGIN @@ -757,12 +726,11 @@ BEGIN EDITTEXT IDC_GOTO_POS_X,20,5,50,12,ES_AUTOHSCROLL LTEXT "Y",IDC_STATIC,5,25,10,8 EDITTEXT IDC_GOTO_POS_Y,20,25,50,12,ES_AUTOHSCROLL - CONTROL "&zoom at position",IDC_CHECK_POS_ZOMM,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,45,70,10 + CONTROL "&zoom at position",IDC_CHECK_POS_ZOMM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,45,70,10 END -IDD_NAME DIALOG DISCARDABLE 0, 0, 483, 354 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_NAME DIALOG 0, 0, 483, 354 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Name attribution" FONT 8, "MS Sans Serif" BEGIN @@ -773,11 +741,8 @@ BEGIN EDITTEXT IDC_NAME_EBOX_IG,162,34,151,12,ES_AUTOHSCROLL DEFPUSHBUTTON "&Assign",ID_NAME_ASSIGN,217,52,50,14,WS_DISABLED EDITTEXT IDC_NAME_FILTER,180,92,125,12,ES_AUTOHSCROLL - LISTBOX IDC_NAME_SEARCH,29,110,426,84,LBS_SORT | LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LISTBOX IDC_NAME_ID,29,220,426,78,LBS_SORT | LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | - WS_TABSTOP + LISTBOX IDC_NAME_SEARCH,29,110,426,84,LBS_SORT | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_NAME_ID,29,220,426,78,LBS_SORT | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP GROUPBOX "Assign name",IDC_STATIC,107,7,270,67 LTEXT "Generic name:",IDC_STATIC,111,17,47,8 LTEXT "In game name:",IDC_STATIC,111,36,48,8 @@ -788,6 +753,31 @@ BEGIN GROUPBOX "Name database:",IDC_STATIC,20,83,445,122 END +IDD_PRIMITIVE_CONFIGURATION DIALOGEX 0, 0, 238, 87 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "Primitive configuration" +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,7,224,73 +END + +IDD_SPLASHSCREEN DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION +CAPTION "World Edit Load" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Static",IDC_LOAD_WORLD_EDIT,7,5,172,85,SS_SUNKEN +END + +IDD_DIRECTORY_SELECTOR DIALOG 0, 0, 282, 26 +STYLE DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS +FONT 8, "MS Sans Serif" +BEGIN + COMBOBOX IDC_DIRLIST,54,7,216,234,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Previous dir:",IDC_STATIC,6,7,45,12,SS_CENTERIMAGE +END + ///////////////////////////////////////////////////////////////////////////// // @@ -795,14 +785,58 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO BEGIN - IDD_ABOUTBOX, DIALOG + IDD_CREATE_ELEMENT, DIALOG + BEGIN + END + + IDD_TOOLS_ZONE, DIALOG + BEGIN + END + + IDD_SELECTZONE, DIALOG + BEGIN + END + + IDD_GENERATE, DIALOG + BEGIN + END + + IDD_MOVE, DIALOG + BEGIN + END + + IDD_EXPORT, DIALOG + BEGIN + END + + IDD_TYPEMANAGER, DIALOG + BEGIN + END + + IDD_TYPE, DIALOG + BEGIN + END + + IDD_TYPESEL, DIALOG + BEGIN + END + + IDD_EXPORTCB, DIALOG + BEGIN + END + + IDD_TOOLS_LOGIC, DIALOG + BEGIN + END + + IDD_EDIT_STRING, DIALOG + BEGIN + END + + IDD_LOADING, DIALOG BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 228 - TOPMARGIN, 8 - BOTTOMMARGIN, 66 END IDD_CUSTOM_SNAPSHOT, DIALOG @@ -858,6 +892,18 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 347 END + + IDD_PRIMITIVE_CONFIGURATION, DIALOG + BEGIN + END + + IDD_SPLASHSCREEN, DIALOG + BEGIN + END + + IDD_DIRECTORY_SELECTOR, DIALOG + BEGIN + END END #endif // APSTUDIO_INVOKED @@ -867,36 +913,59 @@ END // Cursor // -IDC_MOVE CURSOR DISCARDABLE "res\\move.cur" -IDC_ROTATE CURSOR DISCARDABLE "res\\rotate.cur" -IDC_TURN CURSOR DISCARDABLE "res\\turn.cur" -IDC_SCALE CURSOR DISCARDABLE "res\\scale.cur" -IDC_ADD_POINT CURSOR DISCARDABLE "res\\add_point.cur" -IDC_COPY CURSOR DISCARDABLE "res\\copy.cur" -IDC_SELECT CURSOR DISCARDABLE "res\\select.cur" -IDC_SELECT_COPY CURSOR DISCARDABLE "res\\select_copy.cur" -IDC_INSERT_POINT CURSOR DISCARDABLE "res\\insert_point.cur" -IDC_HAND1 CURSOR DISCARDABLE "res\\hand.cur" -IDC_ZOOM CURSOR DISCARDABLE "res\\zoom.cur" -IDC_RADIUS CURSOR DISCARDABLE "res\\radius.cur" +IDC_MOVE CURSOR "res\\move.cur" + +IDC_ROTATE CURSOR "res\\rotate.cur" + +IDC_TURN CURSOR "res\\turn.cur" + +IDC_SCALE CURSOR "res\\scale.cur" + +IDC_ADD_POINT CURSOR "res\\add_point.cur" + +IDC_COPY CURSOR "res\\copy.cur" + +IDC_SELECT CURSOR "res\\select.cur" + +IDC_SELECT_COPY CURSOR "res\\select_copy.cur" + +IDC_INSERT_POINT CURSOR "res\\insert_point.cur" + +IDC_HAND1 CURSOR "res\\hand.cur" + +IDC_ZOOM CURSOR "res\\zoom.cur" + +IDC_RADIUS CURSOR "res\\radius.cur" + + +///////////////////////////////////////////////////////////////////////////// +// +// AFX_DIALOG_LAYOUT +// + +IDD_TOOLS_ZONE AFX_DIALOG_LAYOUT +BEGIN + 0 +END + ///////////////////////////////////////////////////////////////////////////// // // String Table // -STRINGTABLE PRELOAD DISCARDABLE +STRINGTABLE BEGIN IDR_MAINFRAME "NeL World Editor\n\nNeLWorldEditor\nNeL World Editor Files (*.worldedit)\n.worldedit\nWorldeditor.Document\nNeL World Editor Document" END -STRINGTABLE PRELOAD DISCARDABLE +STRINGTABLE BEGIN AFX_IDS_APP_TITLE "NeL World Editor" AFX_IDS_IDLEMESSAGE "Ready" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_INDICATOR_ZONENAMENEL " " ID_INDICATOR_ZONENAMEREF @@ -908,7 +977,7 @@ BEGIN ID_INDICATOR_SELECTION "9999 selected primitives" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_FILE_NEW "Create a new document\nNew" ID_FILE_OPEN "Open an existing document\nOpen (CTRL+O)" @@ -921,14 +990,14 @@ BEGIN ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_APP_ABOUT "Display program information, version number and copyright\nAbout" ID_APP_EXIT "Quit the application; prompts to save documents\nExit" ID_HELP_FINDER "List Help topics\nHelp Topics (F1)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_FILE_MRU_FILE1 "Open this document" ID_FILE_MRU_FILE2 "Open this document" @@ -948,18 +1017,18 @@ BEGIN ID_FILE_MRU_FILE16 "Open this document" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_NEXT_PANE "Switch to the next window pane\nNext Pane" ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_WINDOW_SPLIT "Split the active window into panes\nSplit" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_CLEAR "Erase the selection\nErase" ID_EDIT_CLEAR_ALL "Erase everything\nErase All" @@ -974,13 +1043,13 @@ BEGIN ID_EDIT_REDO "Redo the previously undone action\nRedo (Ctrl+Y)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar" ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN AFX_IDS_SCSIZE "Change the window size" AFX_IDS_SCMOVE "Change the window position" @@ -991,26 +1060,30 @@ BEGIN AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN AFX_IDS_SCRESTORE "Restore the window to normal size" AFX_IDS_SCTASKLIST "Activate Task List" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview" +END + +STRINGTABLE +BEGIN ID_WINDOWS_PLUGINS "Menu to select betwen the different plugins \n Plugins" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_VIEW_GRID "Show / hide grid\nShow / Hide grid (G)" ID_MODE_LOGIC "Logic Edition" ID_MODE_ZONE "Zone edition" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_PACS "Show / hide PACS lines\nPACS (CTRL+P)" ID_VIEW_PACS "Show / hide PACS lines\nPACS (CTRL+P)" @@ -1023,7 +1096,7 @@ BEGIN ID_NAME_DLG "Name generator\nName generator" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_TURN "Turn selection\nTurn (F8)" ID_EDIT_SCALE "Scale selection\nScale (F9)" @@ -1031,7 +1104,7 @@ BEGIN ID_EDIT_ADD_POINT "Add points in selection\nAdd points (F11)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_PROJECT_SETTINGS "Project properties\nProperties (Alt+F7)" ID_EDIT_LOCK "Edit current selection points\nEdit points (Space)" @@ -1043,7 +1116,7 @@ BEGIN ID_EDIT_ROTATE "Rotate selection\nRotate (F7)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_DETAILS "Show / hide details\nDetails (D)" ID_VIEW_SHOW "Show selected primitives\nShow (S)" @@ -1053,19 +1126,19 @@ BEGIN ID_EDIT_COLLAPSE "Collapse selected nodes\nCollapse (R)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_VIEW_LANDSCAPE "Show / hide landscapes\nShow / Hide landscapes (L)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_VIEW_PRIMITIVES "Show / hide primitives\nShow / Hide primitives (P)" ID_VIEW_LAYERS "Show / hide layers\nShow / Hide layers (Y)" ID_VIEW_GRIS "Show / hide grid\nShow / Hide gris (G)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_SELECT_BY_LOCATION "Select primitives by location CTRL+L\nSelect primitives by location (CTRL+L)" @@ -1081,93 +1154,6 @@ BEGIN ID_REPAIR_SELECTED "Repair selected elements by adding missing fields" END -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU1 MENU DISCARDABLE -BEGIN - POPUP "Primitive Configuration" - BEGIN - MENUITEM "&Select", ID_PRIMITIVECONFIGURATION_SELECT - - MENUITEM "&Show", ID_PRIMITIVECONFIGURATION_SHOW - - MENUITEM "&Hide", ID_PRIMITIVECONFIGURATION_HIDE - - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PRIMITIVE_CONFIGURATION DIALOGEX 0, 0, 238, 87 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "Primitive configuration" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | - WS_TABSTOP,7,7,224,73 -END - -IDD_SPLASHSCREEN DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE WS_POPUP | WS_CAPTION -CAPTION "World Edit Load" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Static",IDC_LOAD_WORLD_EDIT,7,5,172,85,SS_SUNKEN -END - -IDD_DIRECTORY_SELECTOR DIALOG DISCARDABLE 0, 0, 282, 26 -STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS -FONT 8, "MS Sans Serif" -BEGIN - COMBOBOX IDC_DIRLIST,54,7,216,234,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Previous dir:",IDC_STATIC,6,7,45,12,SS_CENTERIMAGE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_PRIMITIVE_CONFIGURATION, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 231 - TOPMARGIN, 7 - BOTTOMMARGIN, 80 - END - - IDD_SPLASHSCREEN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 179 - TOPMARGIN, 7 - BOTTOMMARGIN, 88 - END - - IDD_DIRECTORY_SELECTOR, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 275 - TOPMARGIN, 7 - BOTTOMMARGIN, 19 - END -END -#endif // APSTUDIO_INVOKED - #endif // English resources ///////////////////////////////////////////////////////////////////////////// From f688c23580140abf9210e7f136e2f052579759a0 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 14 May 2019 06:32:37 +0800 Subject: [PATCH 16/16] Fixed: Don't use CListBox itemData for drawing text, it doesn't actually point to the item string --- .../leveldesign/world_editor/world_editor/tools_zone.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/tools_zone.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/tools_zone.cpp index bcb46cd6c..23e8aaec0 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/tools_zone.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/tools_zone.cpp @@ -118,13 +118,12 @@ const string &CToolsZoneList::getItem (uint32 nIndex) void CToolsZoneList::DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct) { ASSERT(lpDrawItemStruct->CtlType == ODT_LISTBOX); - LPCTSTR lpszText = (LPCTSTR) lpDrawItemStruct->itemData; - if (lpszText == NULL) - return; CDC dc; if (lpDrawItemStruct->itemID >= _BitmapList.size()) return; + if (lpDrawItemStruct->itemID >= _ItemNames.size()) + return; dc.Attach (lpDrawItemStruct->hDC); @@ -168,7 +167,8 @@ void CToolsZoneList::DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct) } // Draw the text. - dc.DrawText (lpszText, _tcslen(lpszText), &rectLeft, DT_CENTER|DT_SINGLELINE|DT_VCENTER); + NLMISC::tstring itemName = NLMISC::utf8ToTStr(_ItemNames[lpDrawItemStruct->itemID]); + dc.DrawText(itemName.c_str(), itemName.size(), &rectLeft, DT_CENTER|DT_SINGLELINE|DT_VCENTER); // Reset the background color and the text color back to their original values. dc.SetTextColor (crOldTextColor);