Beiträge von Dex
-
-
weniger scheiße labern wenn man keine ahnung hat, der user wurde permanent vom guten Bitte melden Sie sich an, um diesen Link zu sehen. gebannt und von mir wieder entbannt weil ich diese Strafe für absolut übertrieben fand.proof: Bitte melden Sie sich an, um dieses Bild zu sehen.
Mag sein das ich mich in dem Falle geiirt habe, doch sonst wie man es auch wieder zu sehen kann, stehst du im Mittelpunkt. Viele andere bestätigen dies auch, dass du als Mod hinsichtlich vieles versagst. Aber naja ist halt nur Internet life und so, irgendwo muss man ja kompensieren..
-
Naja auf diesem Forum kann man nichts erwarten. Ganz ehrlich, daemon ist der schlechtester Mod den ich kenne und agiert falsch in vielen Fällen. Gestern als es eine Auseinandersetzung zwischen iPeri und irgendwelchen Kid in der shoutbox gab wurde der einer gebannt obwohl beide gleiche Schuldanteile hatten. Und wieso ? Nur weil daemon und iPeri zusammen Kollegen sind ? Wo ist dann die Gerechtigkeit ?
-
Okay. Hatte mal überlegt ob man nicht mal die Map1 Stadt oder die gesamte Map1 mal wie in einem anderen Spiel aufbaut (WoW, AION etc.) oder die Drachen aus Skyrim in M2 zu konvertieren.
du kannst alles konvertieren, musst nur wissen wie
-
Eine preisspanne wäre nett
Und was heißt das bei den uppi Lager ?
Also diese Zahlen hahaIch vermute mal dass die Zahlen das Level bedeuten ( Uppzeug fuer lvl 1-30 usw ).
-
Würde dich haben wollen.
Für die item_proto und only locale_game und Interface.
Was würde es mich kosten?Schick mir deine Datei per PN:)
-
Hast du evtl. auch den Inhalt der uitarget.py von dort?Habe auf der Seite keinen Account und ohne Account kann ich den Inhalt des Beitrages nicht sehen.
Bitte melden Sie sich an, um diesen Link zu sehen.Python- // Cauta :
- def __LoadInformation_Default(self, race):
- self.AppendSeperator()
- self.AppendTextLine(localeInfo.TARGET_INFO_MAX_HP % str(nonplayer.GetMonsterMaxHP(race)))
- # calc att damage
- monsterLevel = nonplayer.GetMonsterLevel(race)
- fHitRate = self.__LoadInformation_Default_GetHitRate(race)
- iDamMin, iDamMax = nonplayer.GetMonsterDamage(race)
- iDamMin = int((iDamMin + nonplayer.GetMonsterST(race)) * 2 * fHitRate) + monsterLevel * 2
- iDamMax = int((iDamMax + nonplayer.GetMonsterST(race)) * 2 * fHitRate) + monsterLevel * 2
- iDef = player.GetStatus(player.DEF_GRADE) * (100 + player.GetStatus(player.DEF_BONUS)) / 100
- fDamMulti = nonplayer.GetMonsterDamageMultiply(race)
- iDamMin = int(max(0, iDamMin - iDef) * fDamMulti)
- iDamMax = int(max(0, iDamMax - iDef) * fDamMulti)
- if iDamMin < 1:
- iDamMin = 1
- if iDamMax < 5:
- iDamMax = 5
- self.AppendTextLine(localeInfo.TARGET_INFO_DAMAGE % (str(iDamMin), str(iDamMax)))
- idx = min(len(self.EXP_BASE_LVDELTA) - 1, max(0, (monsterLevel + 15) - player.GetStatus(player.LEVEL)))
- iExp = nonplayer.GetMonsterExp(race) * self.EXP_BASE_LVDELTA[idx] / 100
- self.AppendTextLine(localeInfo.TARGET_INFO_EXP % str(iExp))
- // SCHIMBA FUNCTIA def __LoadInformation_Default(self, race): CU ACEASTA:
- def __LoadInformation_Default(self, race):
- self.AppendSeperator()
- self.AppendTextLine(localeInfo.TARGET_INFO_MAX_HP % str(nonplayer.GetMonsterMaxHP(race)))
- # calc att damage
- monsterLevel = nonplayer.GetMonsterLevel(race)
- fHitRate = self.__LoadInformation_Default_GetHitRate(race)
- iDamMin, iDamMax = nonplayer.GetMonsterDamage(race)
- iDamMin = int((iDamMin + nonplayer.GetMonsterST(race)) * 2 * fHitRate) + monsterLevel * 2
- iDamMax = int((iDamMax + nonplayer.GetMonsterST(race)) * 2 * fHitRate) + monsterLevel * 2
- iDef = player.GetStatus(player.DEF_GRADE) * (100 + player.GetStatus(player.DEF_BONUS)) / 100
- fDamMulti = nonplayer.GetMonsterDamageMultiply(race)
- iDamMin = int(max(0, iDamMin) * fDamMulti)
- iDamMax = int(max(0, iDamMax) * fDamMulti)
- if iDamMin < 1:
- iDamMin = 1
- if iDamMax < 5:
- iDamMax = 5
- self.AppendTextLine(localeInfo.TARGET_INFO_DAMAGE % (str(iDamMin), str(iDamMax)))
- idx = min(len(self.EXP_BASE_LVDELTA) - 1, max(0, (monsterLevel + 15) - player.GetStatus(player.LEVEL)))
- iExp = nonplayer.GetMonsterExp(race) * self.EXP_BASE_LVDELTA[idx] / 100
- self.AppendTextLine(localeInfo.TARGET_INFO_EXP % str(iExp))
Tabs abgleichen:
Bitte melden Sie sich an, um diesen Link zu sehen.
-
Also das ist kein „ Problem“, das System errechnet den damage der dir die Mobs machen sollen abhängig vom Level und den items du besitzt ( Wiederstände ). Falls der Fall aber bei allen Mobs zu finden ist dann ist hier einen Fix, das von mir getestet worden ist:
-
Da es sich hier aber um eine Connection Funktion handelt sollte man davon ausgehen dass es einen boolischen wert sein kann, der true oder false ausgibt, solltest es damit versuchen oder einfach den Datentypen konvertieren in einem String. Ich verstehe immer noch nicht wirklich was du vor hast, eventuell versuchst du dein Problem besser darzustellen.
Bzgl des streams, du kannst ja die .py Datei in deine gewünschte Datei importieren und dort die Klasse aufrufen und deren Methoden.
-
Du deklarierst auch 2 Variablen doppelt, du musst die genannten Sachen überschreiben oder einfach die alten auskommentieren und die neuen drunter einfügen
-
Bitte melden Sie sich an, um diesen Link zu sehen.
-
-
Überschreibe mal hiermit :
usr/home/game/share:
Bitte melden Sie sich an, um diesen Link zu sehen.und
usr/home/game/share/data:
Bitte melden Sie sich an, um diesen Link zu sehen.Das sind die original Fliege Files
-
Hello,
ich suche diese sachen:
Bitte melden Sie sich an, um diesen Link zu sehen.
-
ja mir hat einer auch geschrieben wo der fehler war
Bitte melden Sie sich an, um diesen Link zu sehen.hatte es an der falschen stelle nur kommt aber wenn ich mich bei dem
charakter einloggen will wo die shops drauf sind ein core absturz :root@root:/usr/home/game # Segmentation fault (core dumped)
bei jedem anderen charakter kann man sich normal einloggen
aber shops stehen nochebenfalls haben sich skills und ränge zurückgesetzt
Das Problem hatte ich auch, in der input_db.cpp hast du eine Funktion falsch gesetzt in der Methode CreateShops. Schaue nochmal nach, da wird eine Zeile doppelt sein, du musst unter der 2. die methode aufrufen. Sonst kannst du mir gerne schreiben
-
-
Sers,
Bekomme folgende Meldung beim Server start.
OFFLINE_SHOP_NEED_MONEY: Enabled - Money 500OFFLINE_SHOP_TOTAL_COUNT: 120OFFLINE_SHOP_SOCKET_MAX: 3socket_tcp_bind: tcp_socket: Address already in use
Config für Offlineshop sieht wiefolgt ans
OFFLINE_SAVE_TIME: 5
OFFLINE_SHOP_NEED_MONEY: 1 500
OFFLINE_SHOP_TOTAL_COUNT: 120
OFFLINE_SHOP_MAP_ALLOW_LIMIT: 1
OFFLINE_SHOP_RESPAWN: 1
OFFLINE_SHOP_SOCKET_MAX: 3Woran liegts?
es hat eig nichts mit dem offline shop zu tun sondern mit deine Ports, nutzt du sie mehrmals ?
-
Damit das ganze verständlicher wird =)
Code: PythonChat.cpp- #include "StdAfx.h"
- #include "PythonChat.h"
- #include "AbstractApplication.h"
- #include "PythonCharacterManager.h"
- #include "../eterbase/Timer.h"
- #include <string>
- int CPythonChat::TChatSet::ms_iChatModeSize = CHAT_TYPE_MAX_NUM;
- const float c_fStartDisappearingTime = 5.0f;
- const int c_iMaxLineCount = 5;
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- CDynamicPool<CPythonChat::SChatLine> CPythonChat::SChatLine::ms_kPool;
- void CPythonChat::SetChatColor(UINT eType, UINT r, UINT g, UINT b)
- {
- if (eType>=CHAT_TYPE_MAX_NUM)
- return;
- DWORD dwColor=(0xff000000)|(r<<16)|(g<<8)|(b);
- m_akD3DXClrChat[eType]=D3DXCOLOR(dwColor);
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- CPythonChat::SChatLine* CPythonChat::SChatLine::New()
- {
- return ms_kPool.Alloc();
- }
- void CPythonChat::SChatLine::Delete(CPythonChat::SChatLine* pkChatLine)
- {
- pkChatLine->Instance.Destroy();
- ms_kPool.Free(pkChatLine);
- }
- void CPythonChat::SChatLine::DestroySystem()
- {
- ms_kPool.Destroy();
- }
- void CPythonChat::SChatLine::SetColor(DWORD dwID, DWORD dwColor)
- {
- assert(dwID < CHAT_LINE_COLOR_ARRAY_MAX_NUM);
- if (dwID >= CHAT_LINE_COLOR_ARRAY_MAX_NUM)
- return;
- aColor[dwID] = dwColor;
- }
- void CPythonChat::SChatLine::SetColorAll(DWORD dwColor)
- {
- for (int i = 0; i < CHAT_LINE_COLOR_ARRAY_MAX_NUM; ++i)
- aColor[i] = dwColor;
- }
- D3DXCOLOR & CPythonChat::SChatLine::GetColorRef(DWORD dwID)
- {
- assert(dwID < CHAT_LINE_COLOR_ARRAY_MAX_NUM);
- if (dwID >= CHAT_LINE_COLOR_ARRAY_MAX_NUM)
- {
- static D3DXCOLOR color(1.0f, 0.0f, 0.0f, 1.0f);
- return color;
- }
- return aColor[dwID];
- }
- CPythonChat::SChatLine::SChatLine()
- {
- for (int i = 0; i < CHAT_LINE_COLOR_ARRAY_MAX_NUM; ++i)
- aColor[i] = 0xff0000ff;
- }
- CPythonChat::SChatLine::~SChatLine()
- {
- Instance.Destroy();
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- int CPythonChat::CreateChatSet(DWORD dwID)
- {
- m_ChatSetMap.insert(make_pair(dwID, TChatSet()));
- return dwID;
- }
- void CPythonChat::UpdateViewMode(DWORD dwID)
- {
- IAbstractApplication& rApp=IAbstractApplication::GetSingleton();
- float fcurTime = rApp.GetGlobalTime();
- //float felapsedTime = rApp.GetGlobalElapsedTime();
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- TChatLineList * pLineList = &(pChatSet->m_ShowingChatLineList);
- int iLineIndex = pLineList->size();
- int iHeight = -(int(pLineList->size()+1) * pChatSet->m_iStep);
- TChatLineList::iterator itor;
- for (itor = pLineList->begin(); itor != pLineList->end();)
- {
- TChatLine * pChatLine = (*itor);
- D3DXCOLOR & rColor = pChatLine->GetColorRef(dwID);
- float fElapsedTime = (fcurTime - pChatLine->fAppendedTime);
- if (fElapsedTime >= c_fStartDisappearingTime || iLineIndex >= c_iMaxLineCount)
- {
- rColor.a -= rColor.a / 10.0f;
- if (rColor.a <= 0.1f)
- {
- itor = pLineList->erase(itor);
- }
- else
- {
- ++itor;
- }
- }
- else
- {
- ++itor;
- }
- /////
- iHeight += pChatSet->m_iStep;
- --iLineIndex;
- pChatLine->Instance.SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight);
- pChatLine->Instance.SetColor(rColor);
- pChatLine->Instance.Update();
- //test
- if(pChatLine->ImageInstance)
- pChatLine->ImageInstance->SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight + 2);
- }
- }
- void CPythonChat::UpdateEditMode(DWORD dwID)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- const int c_iAlphaLine = max(0, GetVisibleLineCount(dwID) - GetEditableLineCount(dwID) + 2);
- int iLineIndex = 0;
- float fAlpha = 0.0f;
- float fAlphaStep = 0.0f;
- if (c_iAlphaLine > 0)
- fAlphaStep = 1.0f / float(c_iAlphaLine);
- TChatLineList * pLineList = &(pChatSet->m_ShowingChatLineList);
- int iHeight = -(int(pLineList->size()+1) * pChatSet->m_iStep);
- for (TChatLineList::iterator itor = pLineList->begin(); itor != pLineList->end(); ++itor)
- {
- TChatLine * pChatLine = (*itor);
- D3DXCOLOR & rColor = pChatLine->GetColorRef(dwID);
- if (iLineIndex < c_iAlphaLine)
- {
- rColor.a += (fAlpha - rColor.a) / 10.0f;
- fAlpha = fMIN(fAlpha+fAlphaStep, 1.0f);
- }
- else
- {
- rColor.a = fMIN(rColor.a+0.05f, 1.0f);
- }
- iHeight += pChatSet->m_iStep;
- pChatLine->Instance.SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight);
- pChatLine->Instance.SetColor(rColor);
- pChatLine->Instance.Update();
- //test
- if(pChatLine->ImageInstance)
- pChatLine->ImageInstance->SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight + 2);
- }
- }
- void CPythonChat::UpdateLogMode(DWORD dwID)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- TChatLineList * pLineList = &(pChatSet->m_ShowingChatLineList);
- int iHeight = 0;
- for (TChatLineList::reverse_iterator itor = pLineList->rbegin(); itor != pLineList->rend(); ++itor)
- {
- TChatLine * pChatLine = (*itor);
- iHeight -= pChatSet->m_iStep;
- pChatLine->Instance.SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight);
- pChatLine->Instance.SetColor(pChatLine->GetColorRef(dwID));
- pChatLine->Instance.Update();
- if(pChatLine->ImageInstance)
- pChatLine->ImageInstance->SetPosition(pChatSet->m_ix, pChatSet->m_iy + iHeight + 2);
- }
- }
- void CPythonChat::Update(DWORD dwID)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- switch (pChatSet->m_iBoardState)
- {
- case BOARD_STATE_VIEW:
- UpdateViewMode(dwID);
- break;
- case BOARD_STATE_EDIT:
- UpdateEditMode(dwID);
- break;
- case BOARD_STATE_LOG:
- UpdateLogMode(dwID);
- break;
- }
- DWORD dwcurTime = CTimer::Instance().GetCurrentMillisecond();
- for (TWaitChatList::iterator itor = m_WaitChatList.begin(); itor != m_WaitChatList.end();)
- {
- TWaitChat & rWaitChat = *itor;
- if (rWaitChat.dwAppendingTime < dwcurTime)
- {
- AppendChat(rWaitChat.iType, rWaitChat.strChat.c_str());
- itor = m_WaitChatList.erase(itor);
- }
- else
- {
- ++itor;
- }
- }
- }
- void CPythonChat::Render(DWORD dwID)
- {
- TChatLineList * pLineList = GetChatLineListPtr(dwID);
- if (!pLineList)
- return;
- for (TChatLineList::iterator itor = pLineList->begin(); itor != pLineList->end(); ++itor)
- {
- CGraphicTextInstance & rInstance = (*itor)->Instance;
- rInstance.Render();
- CGraphicImageInstance *& imInstance = (*itor)->ImageInstance;
- if (imInstance)
- imInstance->Render();
- }
- }
- void CPythonChat::SetBoardState(DWORD dwID, int iState)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- pChatSet->m_iBoardState = iState;
- ArrangeShowingChat(dwID);
- }
- void CPythonChat::SetPosition(DWORD dwID, int ix, int iy)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- pChatSet->m_ix = ix;
- pChatSet->m_iy = iy;
- }
- void CPythonChat::SetHeight(DWORD dwID, int iHeight)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- pChatSet->m_iHeight = iHeight;
- }
- void CPythonChat::SetStep(DWORD dwID, int iStep)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- pChatSet->m_iStep = iStep;
- }
- void CPythonChat::ToggleChatMode(DWORD dwID, int iMode)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- pChatSet->m_iMode[iMode] = 1 - pChatSet->m_iMode[iMode];
- // Tracef("ToggleChatMode : %d\n", iMode);
- ArrangeShowingChat(dwID);
- }
- void CPythonChat::EnableChatMode(DWORD dwID, int iMode)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- pChatSet->m_iMode[iMode] = TRUE;
- // Tracef("EnableChatMode : %d\n", iMode);
- ArrangeShowingChat(dwID);
- }
- void CPythonChat::DisableChatMode(DWORD dwID, int iMode)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- pChatSet->m_iMode[iMode] = FALSE;
- // Tracef("DisableChatMode : %d\n", iMode);
- ArrangeShowingChat(dwID);
- }
- void CPythonChat::SetEndPos(DWORD dwID, float fPos)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- fPos = max(0.0f, fPos);
- fPos = min(1.0f, fPos);
- if (pChatSet->m_fEndPos != fPos)
- {
- pChatSet->m_fEndPos = fPos;
- ArrangeShowingChat(dwID);
- }
- }
- int CPythonChat::GetVisibleLineCount(DWORD dwID)
- {
- TChatLineList * pLineList = GetChatLineListPtr(dwID);
- if (!pLineList)
- return 0;
- return pLineList->size();
- }
- int CPythonChat::GetEditableLineCount(DWORD dwID)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return 0;
- return pChatSet->m_iHeight / pChatSet->m_iStep + 1;
- }
- int CPythonChat::GetLineCount(DWORD dwID)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return 0;
- int iCount = 0;
- for (DWORD i = 0; i < m_ChatLineDeque.size(); ++i)
- {
- if (!pChatSet->CheckMode(m_ChatLineDeque[i]->iType))
- continue;
- ++iCount;
- }
- return iCount;
- }
- int CPythonChat::GetLineStep(DWORD dwID)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return 0;
- return pChatSet->m_iStep;
- }
- CPythonChat::TChatLineList * CPythonChat::GetChatLineListPtr(DWORD dwID)
- {
- TChatSetMap::iterator itor = m_ChatSetMap.find(dwID);
- if (m_ChatSetMap.end() == itor)
- return NULL;
- TChatSet & rChatSet = itor->second;
- return &(rChatSet.m_ShowingChatLineList);
- }
- CPythonChat::TChatSet * CPythonChat::GetChatSetPtr(DWORD dwID)
- {
- TChatSetMap::iterator itor = m_ChatSetMap.find(dwID);
- if (m_ChatSetMap.end() == itor)
- return NULL;
- TChatSet & rChatSet = itor->second;
- return &rChatSet;
- }
- void CPythonChat::ArrangeShowingChat(DWORD dwID)
- {
- TChatSet * pChatSet = GetChatSetPtr(dwID);
- if (!pChatSet)
- return;
- pChatSet->m_ShowingChatLineList.clear();
- TChatLineDeque TempChatLineDeque;
- for (TChatLineDeque::iterator itor = m_ChatLineDeque.begin(); itor != m_ChatLineDeque.end(); ++itor)
- {
- TChatLine * pChatLine = *itor;
- if (pChatSet->CheckMode(pChatLine->iType))
- TempChatLineDeque.push_back(pChatLine);
- }
- int icurLineCount = TempChatLineDeque.size();
- int iVisibleLineCount = min(icurLineCount, (pChatSet->m_iHeight + pChatSet->m_iStep) / pChatSet->m_iStep);
- int iEndLine = iVisibleLineCount + int(float(icurLineCount - iVisibleLineCount - 1) * pChatSet->m_fEndPos);
- /////
- int iHeight = 12;
- for (int i = min(icurLineCount-1, iEndLine); i >= 0; --i)
- {
- if (!pChatSet->CheckMode(TempChatLineDeque[i]->iType))
- continue;
- if (pChatSet->m_iHeight + pChatSet->m_iStep <= iHeight)
- {
- break;
- }
- pChatSet->m_ShowingChatLineList.push_front(TempChatLineDeque[i]);
- iHeight += pChatSet->m_iStep;
- }
- }
- void CPythonChat::AppendChat(int iType, const char * c_szChat)
- {
- // DEFAULT_FONT
- //static CResource * s_pResource = CResourceManager::Instance().GetResourcePointer(g_strDefaultFontName.c_str());
- CGraphicText* pkDefaultFont = static_cast<CGraphicText*>(DefaultFont_GetResource());
- if (!pkDefaultFont)
- {
- TraceError("CPythonChat::AppendChat - CANNOT_FIND_DEFAULT_FONT");
- return;
- }
- // END_OF_DEFAULT_FONT
- IAbstractApplication& rApp=IAbstractApplication::GetSingleton();
- SChatLine * pChatLine = SChatLine::New();
- pChatLine->iType = iType;
- pChatLine->Instance.SetValue(c_szChat);
- // DEFAULT_FONT
- pChatLine->Instance.SetTextPointer(pkDefaultFont);
- // END_OF_DEFAULT_FONT
- pChatLine->fAppendedTime = rApp.GetGlobalTime();
- pChatLine->SetColorAll(GetChatColor(iType));
- m_ChatLineDeque.push_back(pChatLine);
- if (m_ChatLineDeque.size() > CHAT_LINE_MAX_NUM)
- {
- SChatLine * pChatLine = m_ChatLineDeque.front();
- SChatLine::Delete(pChatLine);
- m_ChatLineDeque.pop_front();
- }
- for (TChatSetMap::iterator itor = m_ChatSetMap.begin(); itor != m_ChatSetMap.end(); ++itor)
- {
- TChatSet * pChatSet = &(itor->second);
- //pChatLine->SetColor(itor->first, GetChatColor(iType));
- // Edit Mode ¸¦ ¾ïÁö·Î ³¢¿ö ¸ÂÃß±â À§ÇØ Ãß°¡
- if (BOARD_STATE_EDIT == pChatSet->m_iBoardState)
- {
- ArrangeShowingChat(itor->first);
- }
- else// if (BOARD_STATE_VIEW == pChatSet->m_iBoardState)
- {
- pChatSet->m_ShowingChatLineList.push_back(pChatLine);
- if (pChatSet->m_ShowingChatLineList.size() > CHAT_LINE_MAX_NUM)
- {
- pChatSet->m_ShowingChatLineList.pop_front();
- }
- }
- }
- std::string const s = c_szChat;
- std::size_t EP1 = 0;
- std::size_t EP2 = 0;
- std::size_t EP3 = 0;
- CGraphicImageInstance *& prFlag = pChatLine->ImageInstance;
- EP1 = s.find("[1]");
- EP2 = s.find("[2]");
- EP3 = s.find("[3]");
- if (EP1 != std::string::npos) {
- if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/shinsoo.tga"))
- {
- CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/shinsoo.tga");
- if (pFlagImage)
- {
- prFlag = CGraphicImageInstance::New();
- prFlag->SetImagePointer(pFlagImage);
- }
- }
- }
- else if (EP2 != std::string::npos) {
- if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/chunjo.tga"))
- {
- CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/chunjo.tga");
- if (pFlagImage)
- {
- prFlag = CGraphicImageInstance::New();
- prFlag->SetImagePointer(pFlagImage);
- }
- }
- }
- else if (EP3 != std::string::npos) {
- if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/jinno.tga"))
- {
- CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/jinno.tga");
- if (pFlagImage)
- {
- prFlag = CGraphicImageInstance::New();
- prFlag->SetImagePointer(pFlagImage);
- }
- }
- }
- else {
- if (CResourceManager::Instance().IsFileExist("d:/ymir work/ui/game/flag/none.tga"))
- {
- CGraphicImage * pFlagImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer("d:/ymir work/ui/game/flag/none.tga");
- if (pFlagImage)
- {
- prFlag = CGraphicImageInstance::New();
- prFlag->SetImagePointer(pFlagImage);
- }
- }
- }
- //test
- //test
- }
- void CPythonChat::AppendChatWithDelay(int iType, const char * c_szChat, int iDelay)
- {
- TWaitChat WaitChat;
- WaitChat.iType = iType;
- WaitChat.strChat = c_szChat;
- WaitChat.dwAppendingTime = CTimer::Instance().GetCurrentMillisecond() + iDelay;
- m_WaitChatList.push_back(WaitChat);
- }
- DWORD CPythonChat::GetChatColor(int iType)
- {
- if (iType<CHAT_TYPE_MAX_NUM)
- {
- return m_akD3DXClrChat[iType];
- }
- return D3DXCOLOR(0.0f, 0.0f, 1.0f, 1.0f);
- }
- void CPythonChat::IgnoreCharacter(const char * c_szName)
- {
- TIgnoreCharacterSet::iterator itor = m_IgnoreCharacterSet.find(c_szName);
- // NOTE : ÀÌ¹Ì Â÷´Ü ÁßÀ̶ó¸é..
- if (m_IgnoreCharacterSet.end() != itor)
- {
- m_IgnoreCharacterSet.erase(itor);
- }
- // NOTE : Â÷´ÜÀÌ µÇÁö ¾ÊÀº ij¸¯ÅͶó¸é..
- else
- {
- m_IgnoreCharacterSet.insert(c_szName);
- }
- }
- BOOL CPythonChat::IsIgnoreCharacter(const char * c_szName)
- {
- TIgnoreCharacterSet::iterator itor = m_IgnoreCharacterSet.find(c_szName);
- if (m_IgnoreCharacterSet.end() == itor)
- return FALSE;
- return TRUE;
- }
- CWhisper * CPythonChat::CreateWhisper(const char * c_szName)
- {
- CWhisper * pWhisper = CWhisper::New();
- m_WhisperMap.insert(TWhisperMap::value_type(c_szName, pWhisper));
- return pWhisper;
- }
- void CPythonChat::AppendWhisper(int iType, const char * c_szName, const char * c_szChat)
- {
- TWhisperMap::iterator itor = m_WhisperMap.find(c_szName);
- CWhisper * pWhisper;
- if (itor == m_WhisperMap.end())
- {
- pWhisper = CreateWhisper(c_szName);
- }
- else
- {
- pWhisper = itor->second;
- }
- pWhisper->AppendChat(iType, c_szChat);
- }
- void CPythonChat::ClearWhisper(const char * c_szName)
- {
- TWhisperMap::iterator itor = m_WhisperMap.find(c_szName);
- if (itor != m_WhisperMap.end())
- {
- CWhisper * pWhisper = itor->second;
- CWhisper::Delete(pWhisper);
- m_WhisperMap.erase(itor);
- }
- }
- BOOL CPythonChat::GetWhisper(const char * c_szName, CWhisper ** ppWhisper)
- {
- TWhisperMap::iterator itor = m_WhisperMap.find(c_szName);
- if (itor == m_WhisperMap.end())
- return FALSE;
- *ppWhisper = itor->second;
- return TRUE;
- }
- void CPythonChat::InitWhisper(PyObject * ppyObject)
- {
- TWhisperMap::iterator itor = m_WhisperMap.begin();
- for (; itor != m_WhisperMap.end(); ++itor)
- {
- std::string strName = itor->first;
- PyCallClassMemberFunc(ppyObject, "MakeWhisperButton", Py_BuildValue("(s)", strName.c_str()));
- }
- }
- void CPythonChat::__DestroyWhisperMap()
- {
- TWhisperMap::iterator itor = m_WhisperMap.begin();
- for (; itor != m_WhisperMap.end(); ++itor)
- {
- CWhisper::Delete(itor->second);
- }
- m_WhisperMap.clear();
- }
- void CPythonChat::Close()
- {
- TChatSetMap::iterator itor = m_ChatSetMap.begin();
- for (; itor != m_ChatSetMap.end(); ++itor)
- {
- TChatSet & rChatSet = itor->second;
- TChatLineList * pLineList = &(rChatSet.m_ShowingChatLineList);
- for (TChatLineList::iterator itor = pLineList->begin(); itor != pLineList->end(); ++itor)
- {
- TChatLine * pChatLine = (*itor);
- pChatLine->fAppendedTime = 0.0f;
- }
- }
- }
- void CPythonChat::Destroy()
- {
- __DestroyWhisperMap();
- m_ShowingChatLineList.clear();
- m_ChatSetMap.clear();
- m_ChatLineDeque.clear();
- SChatLine::DestroySystem();
- CWhisper::DestroySystem();
- __Initialize();
- }
- void CPythonChat::__Initialize()
- {
- m_akD3DXClrChat[CHAT_TYPE_TALKING] = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);
- m_akD3DXClrChat[CHAT_TYPE_INFO] = D3DXCOLOR(1.0f, 0.785f, 0.785f, 1.0f);
- m_akD3DXClrChat[CHAT_TYPE_NOTICE] = D3DXCOLOR(1.0f, 0.902f, 0.730f, 1.0f);
- m_akD3DXClrChat[CHAT_TYPE_PARTY] = D3DXCOLOR(0.542f, 1.0f, 0.949f, 1.0f);
- m_akD3DXClrChat[CHAT_TYPE_GUILD] = D3DXCOLOR(0.906f, 0.847f, 1.0f, 1.0f);
- m_akD3DXClrChat[CHAT_TYPE_COMMAND] = D3DXCOLOR(0.658f, 1.0f, 0.835f, 1.0f);
- m_akD3DXClrChat[CHAT_TYPE_SHOUT] = D3DXCOLOR(0.658f, 1.0f, 0.835f, 1.0f);
- m_akD3DXClrChat[CHAT_TYPE_WHISPER] = D3DXCOLOR(0xff4AE14A);
- m_akD3DXClrChat[CHAT_TYPE_BIG_NOTICE] = D3DXCOLOR(1.0f, 0.902f, 0.730f, 1.0f);
- }
- CPythonChat::CPythonChat()
- {
- __Initialize();
- }
- CPythonChat::~CPythonChat()
- {
- assert(m_ChatLineDeque.empty());
- assert(m_ShowingChatLineList.empty());
- assert(m_ChatSetMap.empty());
- assert(m_WhisperMap.empty());
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- CDynamicPool<CWhisper> CWhisper::ms_kPool;
- CWhisper* CWhisper::New()
- {
- return ms_kPool.Alloc();
- }
- void CWhisper::Delete(CWhisper* pkWhisper)
- {
- pkWhisper->Destroy();
- ms_kPool.Free(pkWhisper);
- }
- void CWhisper::DestroySystem()
- {
- ms_kPool.Destroy();
- SChatLine::DestroySystem();
- }
- void CWhisper::SetPosition(float fPosition)
- {
- m_fcurPosition = fPosition;
- __ArrangeChat();
- }
- void CWhisper::SetBoxSize(float fWidth, float fHeight)
- {
- m_fWidth = fWidth;
- m_fHeight = fHeight;
- for (TChatLineDeque::iterator itor = m_ChatLineDeque.begin(); itor != m_ChatLineDeque.end(); ++itor)
- {
- TChatLine * pChatLine = *itor;
- pChatLine->Instance.SetLimitWidth(fWidth);
- }
- }
- void CWhisper::AppendChat(int iType, const char * c_szChat)
- {
- // DEFAULT_FONT
- //static CResource * s_pResource = CResourceManager::Instance().GetResourcePointer(g_strDefaultFontName.c_str());
- #if defined(LOCALE_SERVICE_YMIR) || defined(LOCALE_SERVICE_JAPAN) || defined(LOCALE_SERVICE_HONGKONG) || defined(LOCALE_SERVICE_TAIWAN) || defined(LOCALE_SERVICE_NEWCIBN)
- CGraphicText* pkDefaultFont = static_cast<CGraphicText*>(DefaultFont_GetResource());
- #else
- CGraphicText* pkDefaultFont = (iType == CPythonChat::WHISPER_TYPE_GM) ? static_cast<CGraphicText*>(DefaultItalicFont_GetResource()) : static_cast<CGraphicText*>(DefaultFont_GetResource());
- #endif
- if (!pkDefaultFont)
- {
- TraceError("CWhisper::AppendChat - CANNOT_FIND_DEFAULT_FONT");
- return;
- }
- // END_OF_DEFAULT_FONT
- SChatLine * pChatLine = SChatLine::New();
- pChatLine->Instance.SetValue(c_szChat);
- // DEFAULT_FONT
- pChatLine->Instance.SetTextPointer(pkDefaultFont);
- // END_OF_DEFAULT_FONT
- pChatLine->Instance.SetLimitWidth(m_fWidth);
- pChatLine->Instance.SetMultiLine(TRUE);
- switch(iType)
- {
- case CPythonChat::WHISPER_TYPE_SYSTEM:
- pChatLine->Instance.SetColor(D3DXCOLOR(1.0f, 0.785f, 0.785f, 1.0f));
- break;
- case CPythonChat::WHISPER_TYPE_GM:
- pChatLine->Instance.SetColor(D3DXCOLOR(1.0f, 0.632f, 0.0f, 1.0f));
- break;
- case CPythonChat::WHISPER_TYPE_CHAT:
- default:
- pChatLine->Instance.SetColor(0xffffffff);
- break;
- }
- m_ChatLineDeque.push_back(pChatLine);
- __ArrangeChat();
- }
- void CWhisper::__ArrangeChat()
- {
- for (TChatLineDeque::iterator itor = m_ChatLineDeque.begin(); itor != m_ChatLineDeque.end(); ++itor)
- {
- TChatLine * pChatLine = *itor;
- pChatLine->Instance.Update();
- }
- }
- void CWhisper::Render(float fx, float fy)
- {
- float fHeight = fy + m_fHeight;
- int iViewCount = int(m_fHeight / m_fLineStep) - 1;
- int iLineCount = int(m_ChatLineDeque.size());
- int iStartLine = -1;
- if (iLineCount > iViewCount)
- {
- iStartLine = int(float(iLineCount-iViewCount) * m_fcurPosition) + iViewCount - 1;
- }
- else if (!m_ChatLineDeque.empty())
- {
- iStartLine = iLineCount - 1;
- }
- RECT Rect = { fx, fy, fx+m_fWidth, fy+m_fHeight };
- for (int i = iStartLine; i >= 0; --i)
- {
- assert(i >= 0 && i < int(m_ChatLineDeque.size()));
- TChatLine * pChatLine = m_ChatLineDeque[i];
- WORD wLineCount = pChatLine->Instance.GetTextLineCount();
- fHeight -= wLineCount * m_fLineStep;
- pChatLine->Instance.SetPosition(fx, fHeight);
- pChatLine->Instance.Render(&Rect);
- if (fHeight < fy)
- break;
- }
- }
- void CWhisper::__Initialize()
- {
- m_fLineStep = 15.0f;
- m_fWidth = 300.0f;
- m_fHeight = 120.0f;
- m_fcurPosition = 1.0f;
- }
- void CWhisper::Destroy()
- {
- std::for_each(m_ChatLineDeque.begin(), m_ChatLineDeque.end(), SChatLine::Delete);
- m_ChatLineDeque.clear();
- m_ShowingChatLineList.clear();
- }
- CWhisper::CWhisper()
- {
- __Initialize();
- }
- CWhisper::~CWhisper()
- {
- Destroy();
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- CDynamicPool<CWhisper::SChatLine> CWhisper::SChatLine::ms_kPool;
- CWhisper::SChatLine* CWhisper::SChatLine::New()
- {
- return ms_kPool.Alloc();
- }
- void CWhisper::SChatLine::Delete(CWhisper::SChatLine* pkChatLine)
- {
- pkChatLine->Instance.Destroy();
- ms_kPool.Free(pkChatLine);
- }
- void CWhisper::SChatLine::DestroySystem()
- {
- ms_kPool.Destroy();
- }
Da hast du deine Lösung
-
-