Merge main into feature/ava2-unlock

Conflicts resolved by keeping both sides: AVA2 attribute lock materials
(50348/50349) and battle pass tickets from main alongside the unlock
branch's costume enchants, talismans and new rings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-16 18:14:39 +09:00
co-authored by Claude Opus 5.5
556 changed files with 213114 additions and 44 deletions
+9
View File
@@ -19,6 +19,9 @@ if(NOT TARGET mtpython)
endif()
add_library(port_logic STATIC ${MT_PORT_SOURCES})
if(TARGET mt_meshport)
target_link_libraries(port_logic PUBLIC mt_meshport)
endif()
target_include_directories(port_logic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# 40250 system headers the ported sources keep including verbatim: D3D8/D3DX/Miles SDK types everywhere,
# Windows/CRT ones only where the platform has none.
@@ -326,6 +329,12 @@ if(BUILD_TESTING AND CMAKE_SYSTEM_NAME STREQUAL CMAKE_HOST_SYSTEM_NAME)
COMMAND ${MT_WIKI_PYTHON3} ${PROJECT_SOURCE_DIR}/tests/wiki/test_channel.py)
add_test(NAME port.boss
COMMAND ${MT_WIKI_PYTHON3} ${PROJECT_SOURCE_DIR}/tests/wiki/test_boss.py)
add_test(NAME port.battlepass
COMMAND ${MT_WIKI_PYTHON3} ${PROJECT_SOURCE_DIR}/tests/wiki/test_battlepass.py)
add_test(NAME port.model_preview
COMMAND ${MT_WIKI_PYTHON3} ${PROJECT_SOURCE_DIR}/tests/wiki/test_model_preview.py)
add_test(NAME port.item_actions
COMMAND ${MT_WIKI_PYTHON3} ${PROJECT_SOURCE_DIR}/tests/wiki/test_item_actions.py)
add_test(NAME port.chest
COMMAND ${MT_WIKI_PYTHON3} ${PROJECT_SOURCE_DIR}/tests/wiki/test_chest.py)
add_test(NAME port.ava2_items
+6
View File
@@ -32,9 +32,15 @@ void CNetworkAddress::Clear()
bool CNetworkAddress::IsIP(const char* c_szAddr)
{
#ifdef MT_HAS_MESHPORT
// PORT: digit-prefixed hostnames must resolve before the common subnet decision.
in_addr parsed{};
return c_szAddr && inet_pton(AF_INET,c_szAddr,&parsed) == 1;
#else
if (c_szAddr[0]<'0' || c_szAddr[0]>'9')
return false;
return true;
#endif
}
bool CNetworkAddress::Set(const char* c_szAddr, int port)
+21
View File
@@ -1,5 +1,8 @@
#include "StdAfx.h"
#include "NetDatagram.h"
#ifdef MT_HAS_MESHPORT
#include "transport.h" // PORT: preserve datagram payload/source/peek semantics over application-only mesh.
#endif
CNetworkDatagram::CNetworkDatagram()
{
@@ -16,6 +19,9 @@ void CNetworkDatagram::Destroy()
if (INVALID_SOCKET==m_sock)
return;
#ifdef MT_HAS_MESHPORT
mt::meshport::forget_socket(m_sock);
#endif
closesocket(m_sock);
__Initialize();
@@ -68,6 +74,9 @@ void CNetworkDatagram::Update()
bool CNetworkDatagram::CanRecv()
{
#ifdef MT_HAS_MESHPORT
if (mt::meshport::datagram_ready(m_sock)) return true;
#endif
if (FD_ISSET(m_sock, &m_fdsRecv))
return true;
@@ -77,19 +86,31 @@ bool CNetworkDatagram::CanRecv()
int CNetworkDatagram::PeekRecvFrom(UINT uBufLen, void* pvBuf, SOCKADDR_IN* pkSockAddrIn)
{
#ifdef MT_HAS_MESHPORT
return mt::meshport::recv_datagram(m_sock,pvBuf,uBufLen,MSG_PEEK,pkSockAddrIn);
#else
int nSockAddrInLen=sizeof(SOCKADDR_IN);
return recvfrom(m_sock, (char*)pvBuf, uBufLen, MSG_PEEK, (PSOCKADDR)pkSockAddrIn, &nSockAddrInLen);
#endif
}
int CNetworkDatagram::RecvFrom(UINT uBufLen, void* pvBuf, SOCKADDR_IN* pkSockAddrIn)
{
#ifdef MT_HAS_MESHPORT
return mt::meshport::recv_datagram(m_sock,pvBuf,uBufLen,0,pkSockAddrIn);
#else
int nSockAddrInLen=sizeof(SOCKADDR_IN);
return recvfrom(m_sock, (char*)pvBuf, uBufLen, 0, (PSOCKADDR)pkSockAddrIn, &nSockAddrInLen);
#endif
}
int CNetworkDatagram::SendTo(UINT uBufLen, const void* c_pvBuf, const SOCKADDR_IN& c_rkSockAddrIn)
{
#ifdef MT_HAS_MESHPORT
return mt::meshport::send_datagram(m_sock,c_pvBuf,uBufLen,0,c_rkSockAddrIn);
#else
return sendto(m_sock, (const char *)c_pvBuf, uBufLen, 0, (PSOCKADDR)&c_rkSockAddrIn, sizeof(SOCKADDR_IN));
#endif
}
+19
View File
@@ -1,13 +1,20 @@
#include "StdAfx.h"
#include "NetDatagramReceiver.h"
#ifdef MT_HAS_MESHPORT
#include "transport.h" // PORT: shared datagram receive and relay lifetime.
#endif
BOOL CNetDatagramReceiver::Process()
{
m_recvBufCurrentPos = 0;
m_recvBufCurrentSize = 0;
#ifdef MT_HAS_MESHPORT
m_recvBufCurrentSize = mt::meshport::recv_datagram(m_Socket,m_recvBuf,m_recvBufSize,0,&m_SockAddr);
#else
int irecvAddrLength = sizeof(SOCKADDR_IN);
m_recvBufCurrentSize = recvfrom(m_Socket, (char *)m_recvBuf, m_recvBufSize, 0, (PSOCKADDR)&m_SockAddr, &irecvAddrLength);
#endif
if (m_recvBufCurrentSize <= 0)
{
@@ -42,7 +49,9 @@ BOOL CNetDatagramReceiver::isBind()
BOOL CNetDatagramReceiver::Bind(DWORD /*dwAddress*/, WORD wPortIndex)
{
Clear(); // PORT: rebinding releases any previous UDP/mesh association.
m_Socket = socket(AF_INET, SOCK_DGRAM, 0);
if (m_Socket == INVALID_SOCKET) return FALSE;
DWORD arg = 1;
ioctlsocket(m_Socket, FIONBIO, &arg); // Non-blocking mode
@@ -56,6 +65,8 @@ BOOL CNetDatagramReceiver::Bind(DWORD /*dwAddress*/, WORD wPortIndex)
if (bind(m_Socket, (PSOCKADDR)&m_SockAddr, sizeof(SOCKADDR_IN)) < 0)
{
Tracef("Failed binding socket\n");
closesocket(m_Socket);
m_Socket = INVALID_SOCKET;
return FALSE;
}
@@ -79,6 +90,12 @@ void CNetDatagramReceiver::SetRecvBufferSize(int recvBufSize)
void CNetDatagramReceiver::Clear()
{
if (m_isBind) {
#ifdef MT_HAS_MESHPORT
mt::meshport::forget_socket(m_Socket);
#endif
closesocket(m_Socket); // PORT: close UDP and any mesh association before resetting state.
}
m_isBind = FALSE;
@@ -93,6 +110,7 @@ void CNetDatagramReceiver::Clear()
CNetDatagramReceiver::CNetDatagramReceiver()
{
m_isBind = FALSE;
m_recvBuf = NULL;
m_recvBufSize = 0;
@@ -100,6 +118,7 @@ CNetDatagramReceiver::CNetDatagramReceiver()
}
CNetDatagramReceiver::~CNetDatagramReceiver()
{
Clear();
if (m_recvBuf)
delete [] m_recvBuf;
}
+20
View File
@@ -1,5 +1,8 @@
#include "StdAfx.h"
#include "NetDatagramSender.h"
#ifdef MT_HAS_MESHPORT
#include "transport.h" // PORT: common LAN/mesh policy and relay lifetime.
#endif
BOOL CNetDatagramSender::SetSocket(const char * c_szIP, WORD wPortIndex)
{
@@ -8,12 +11,19 @@ BOOL CNetDatagramSender::SetSocket(const char * c_szIP, WORD wPortIndex)
BOOL CNetDatagramSender::SetSocket(DWORD dwAddress, WORD wPortIndex)
{
if (m_isSocket) {
#ifdef MT_HAS_MESHPORT
mt::meshport::forget_socket(m_Socket);
#endif
closesocket(m_Socket);
}
m_isSocket = TRUE;
m_dwAddress = dwAddress;
m_wPortIndex = wPortIndex;
m_Socket = socket(AF_INET, SOCK_DGRAM, 0);
if (m_Socket == INVALID_SOCKET) { m_isSocket = FALSE; return FALSE; }
memset(&m_SockAddr, 0, sizeof(SOCKADDR_IN));
m_SockAddr.sin_family = AF_INET;
@@ -27,7 +37,11 @@ BOOL CNetDatagramSender::Send(const void * pBuffer, int iSize)
{
assert(isSocket());
#ifdef MT_HAS_MESHPORT
int iSendingLength = mt::meshport::send_datagram(m_Socket,pBuffer,iSize,0,m_SockAddr);
#else
int iSendingLength = sendto(m_Socket, (const char *)pBuffer, iSize, 0, (PSOCKADDR)&m_SockAddr, sizeof(SOCKADDR_IN));
#endif
if (iSendingLength < 0)
{
Tracef("Failed sending packet\n");
@@ -55,4 +69,10 @@ CNetDatagramSender::CNetDatagramSender()
CNetDatagramSender::~CNetDatagramSender()
{
if (m_isSocket) {
#ifdef MT_HAS_MESHPORT
mt::meshport::forget_socket(m_Socket);
#endif
closesocket(m_Socket); // PORT: release the UDP socket and its mesh association together.
}
}
+28 -1
View File
@@ -1,5 +1,8 @@
#include "StdAfx.h"
#include "NetStream.h"
#ifdef MT_HAS_MESHPORT
#include "transport.h" // PORT: application-only mesh transport, including account/warp/mark sockets.
#endif
//#include "eterCrypt.h"
#ifndef _IMPROVED_PACKET_ENCRYPTION_
@@ -288,6 +291,19 @@ void CNetworkStream::Process()
if (m_sock == INVALID_SOCKET)
return;
#ifdef MT_HAS_MESHPORT
if (!m_isOnline && mt::meshport::pending(m_sock))
{
const int state = mt::meshport::poll_socket(m_sock);
if (state < 0 || time(NULL) > m_connectLimitTime)
{
Clear();
OnConnectFailure();
return;
}
if (state == 0) return;
}
#endif
fd_set fdsRecv;
fd_set fdsSend;
@@ -373,6 +389,9 @@ void CNetworkStream::Clear()
m_cipher.CleanUp();
#endif
#ifdef MT_HAS_MESHPORT
mt::meshport::forget_socket(m_sock); // PORT: discard partial SOCKS negotiation before fd reuse.
#endif
closesocket(m_sock);
m_sock = INVALID_SOCKET;
@@ -416,7 +435,12 @@ bool CNetworkStream::Connect(const CNetworkAddress& c_rkNetAddr, int limitSec)
DWORD arg = 1;
ioctlsocket(m_sock, FIONBIO, &arg); // Non-blocking mode
if (connect(m_sock, (PSOCKADDR)&m_addr, m_addr.GetSize()) == SOCKET_ERROR)
#ifdef MT_HAS_MESHPORT
const int connectResult = mt::meshport::connect_socket(m_sock, static_cast<const SOCKADDR_IN&>(m_addr), this);
#else
const int connectResult = connect(m_sock, (PSOCKADDR)&m_addr, m_addr.GetSize());
#endif
if (connectResult == SOCKET_ERROR)
{
int error = WSAGetLastError();
@@ -430,6 +454,9 @@ bool CNetworkStream::Connect(const CNetworkAddress& c_rkNetAddr, int limitSec)
}
}
#ifdef MT_HAS_MESHPORT
if (mt::meshport::pending(m_sock) && limitSec < 75) limitSec = 75; // PORT: DHCP/routes plus remote SOCKS connect.
#endif
m_connectLimitTime = time(NULL) + limitSec;
return true;
}
+14 -1
View File
@@ -2473,11 +2473,24 @@ void CInstanceBase::__UpdateEffectShown()
else
isShown = false;
}
m_GraphicThingInstance.SetAttachingEffectShown(isShown);
m_GraphicThingInstance.SetAttachingEffectShown(isShown && PORT_IsDisplayVisible());
}
bool CInstanceBase::PORT_IsDisplayVisible()
{
// AVA2 CActorInstance::IsShop and InstanceBase::__CanRender, including
// the original 100/60/40/20/10 metre range presets. Never hide the main actor.
CInstanceBase* main = __GetMainInstancePtr();
if (!main || main == this || GetRace() < 30000 || GetRace() > 30020)
return true;
static const unsigned ranges[] = {10000, 6000, 4000, 2000, 1000};
return NEW_GetDistanceFromDestInstance(*main) <= ranges[CPythonSystem::Instance().GetShopNamesRange()];
}
bool CInstanceBase::__CanRender()
{
if (!PORT_IsDisplayVisible())
return false;
if (!__IsInViewFrustum())
return false;
if (IsAffect(AFFECT_INVISIBILITY))
+1
View File
@@ -402,6 +402,7 @@ class CInstanceBase
public:
void SetMainInstance();
bool PORT_IsDisplayVisible();
void OnSelected();
void OnUnselected();
@@ -12,6 +12,10 @@
#include <mutex>
#include <string>
#include <thread>
#include <chrono>
#ifdef MT_HAS_MESHPORT
#include "transport.h" // PORT: registration shares the same LAN/mesh policy as every game socket.
#endif
#include <arpa/inet.h>
#include <fcntl.h>
@@ -35,6 +39,11 @@ const int c_iRegisterTimeoutMs = 8000;
std::mutex gs_kRegisterMutex;
std::atomic<int> gs_iRegisterState(REGISTER_IDLE);
std::string gs_strRegisterResult;
// PORT: registration must stop on dialog cancellation and before the mesh runtime is torn down.
std::thread gs_registerWorker;
std::atomic<bool> gs_registerCancelled(false);
std::mutex gs_registerSocketMutex;
int gs_registerSocket = -1;
std::string __UrlEncode(const std::string& c_rstText)
{
@@ -58,8 +67,14 @@ std::string __UrlEncode(const std::string& c_rstText)
bool __WaitFor(int iSocket, short sEvents)
{
pollfd kPoll = { iSocket, sEvents, 0 };
return poll(&kPoll, 1, c_iRegisterTimeoutMs) == 1 && (kPoll.revents & sEvents);
const auto deadline = std::chrono::steady_clock::now() + std::chrono::milliseconds(c_iRegisterTimeoutMs);
while (!gs_registerCancelled && std::chrono::steady_clock::now() < deadline) {
pollfd kPoll = {iSocket,sEvents,0};
int result = poll(&kPoll,1,100);
if (result > 0) return (kPoll.revents & sEvents) != 0;
if (result < 0 && errno != EINTR) return false;
}
return false;
}
std::string __Post(const std::string& c_rstHost, int iPort, const std::string& c_rstBody)
@@ -72,6 +87,7 @@ std::string __Post(const std::string& c_rstHost, int iPort, const std::string& c
if (getaddrinfo(c_rstHost.c_str(), std::to_string(iPort).c_str(), &kHints, &pkAddr) != 0 || !pkAddr)
return "ERR CONNECT";
if (gs_registerCancelled) { freeaddrinfo(pkAddr); return "ERR CANCELLED"; }
const int iSocket = socket(pkAddr->ai_family, pkAddr->ai_socktype, pkAddr->ai_protocol);
if (iSocket < 0)
{
@@ -82,14 +98,37 @@ std::string __Post(const std::string& c_rstHost, int iPort, const std::string& c
const int iOne = 1;
setsockopt(iSocket, SOL_SOCKET, SO_NOSIGPIPE, &iOne, sizeof(iOne));
#endif
{
std::lock_guard<std::mutex> lock(gs_registerSocketMutex);
gs_registerSocket = iSocket;
}
fcntl(iSocket, F_SETFL, fcntl(iSocket, F_GETFL, 0) | O_NONBLOCK);
std::string stResult = "ERR CONNECT";
int iError = 0;
socklen_t iErrorLen = sizeof(iError);
#ifdef MT_HAS_MESHPORT
const int connected = mt::meshport::connect_socket(iSocket, *reinterpret_cast<sockaddr_in*>(pkAddr->ai_addr));
const bool throughMesh = mt::meshport::pending(iSocket);
bool meshReady = true;
if (mt::meshport::pending(iSocket)) {
int state = 0;
while (state == 0 && !gs_registerCancelled) {
state = mt::meshport::poll_socket(iSocket);
if (!state) std::this_thread::sleep_for(std::chrono::milliseconds(2));
}
meshReady = state == 1;
}
if (!gs_registerCancelled && meshReady && (throughMesh || connected == 0 ||
#else
if (connect(iSocket, pkAddr->ai_addr, pkAddr->ai_addrlen) == 0 ||
#endif
(errno == EINPROGRESS && __WaitFor(iSocket, POLLOUT) &&
getsockopt(iSocket, SOL_SOCKET, SO_ERROR, &iError, &iErrorLen) == 0 && iError == 0))
getsockopt(iSocket, SOL_SOCKET, SO_ERROR, &iError, &iErrorLen) == 0 && iError == 0)
#ifdef MT_HAS_MESHPORT
)
#endif
)
{
const std::string stRequest =
"POST /register HTTP/1.0\r\n"
@@ -140,9 +179,16 @@ std::string __Post(const std::string& c_rstHost, int iPort, const std::string& c
}
}
close(iSocket);
#ifdef MT_HAS_MESHPORT
mt::meshport::forget_socket(iSocket);
#endif
{
std::lock_guard<std::mutex> lock(gs_registerSocketMutex);
gs_registerSocket = -1;
close(iSocket);
}
freeaddrinfo(pkAddr);
return stResult;
return gs_registerCancelled ? "ERR CANCELLED" : stResult;
}
}
@@ -172,10 +218,12 @@ PyObject* netRegisterAccount(PyObject* poSelf, PyObject* poArgs)
return Py_BuildValue("i", 0); // one request at a time
}
if (gs_registerWorker.joinable()) gs_registerWorker.join();
gs_registerCancelled = false;
const std::string stHost = szHost;
const std::string stBody = "login=" + __UrlEncode(szLogin) + "&password=" + __UrlEncode(szPassword) +
"&social_id=" + __UrlEncode(szSocialID);
std::thread([stHost, iPort, stBody]()
gs_registerWorker = std::thread([stHost, iPort, stBody]()
{
const std::string stResult = __Post(stHost, iPort, stBody);
{
@@ -183,7 +231,7 @@ PyObject* netRegisterAccount(PyObject* poSelf, PyObject* poArgs)
gs_strRegisterResult = stResult;
}
gs_iRegisterState = REGISTER_DONE;
}).detach();
});
return Py_BuildValue("i", 1);
}
@@ -196,3 +244,22 @@ PyObject* netGetRegisterAccountResult(PyObject* poSelf, PyObject* poArgs)
std::lock_guard<std::mutex> kLock(gs_kRegisterMutex);
return Py_BuildValue("s", gs_strRegisterResult.c_str());
}
// PORT: cancellation interrupts both route preparation and HTTP I/O; the worker owns close().
void CancelAccountRegistration()
{
gs_registerCancelled = true;
std::lock_guard<std::mutex> lock(gs_registerSocketMutex);
if (gs_registerSocket >= 0) ::shutdown(gs_registerSocket,SHUT_RDWR);
}
void StopAccountRegistration()
{
CancelAccountRegistration();
if (gs_registerWorker.joinable()) gs_registerWorker.join();
gs_iRegisterState = REGISTER_IDLE;
}
PyObject* netCancelRegisterAccount(PyObject*,PyObject*)
{
CancelAccountRegistration();
return Py_BuildNone();
}
@@ -1,4 +1,7 @@
#include "StdAfx.h"
#ifdef MT_HAS_MESHPORT
#include "transport.h" // PORT: cancel only this login's pending mesh transports.
#endif
#include "PythonNetworkStream.h"
//#include "PythonNetworkDatagram.h"
#include "AccountConnector.h"
@@ -14,6 +17,7 @@ std::list<std::string> g_kList_strCommand;
// PORT: PythonAccountRegister.cpp
PyObject* netRegisterAccount(PyObject* poSelf, PyObject* poArgs);
PyObject* netGetRegisterAccountResult(PyObject* poSelf, PyObject* poArgs);
PyObject* netCancelRegisterAccount(PyObject*,PyObject*); // PORT: cancel pending HTTP/mesh work.
PyObject* netGetBettingGuildWarValue(PyObject* poSelf, PyObject* poArgs)
{
@@ -1014,6 +1018,22 @@ PyObject* netLogOutGame(PyObject* poSelf, PyObject* poArgs)
return Py_BuildNone();
}
#ifdef MT_HAS_MESHPORT
PyObject* netCancelPendingLogin(PyObject*,PyObject*)
{
bool cancelled = false;
auto& account = CAccountConnector::Instance();
auto& game = CPythonNetworkStream::Instance();
if (mt::meshport::pending_owner(static_cast<CNetworkStream*>(&account))) {
account.Disconnect(); cancelled = true;
}
if (mt::meshport::pending_owner(static_cast<CNetworkStream*>(&game))) {
game.Disconnect(); cancelled = true;
}
return PyBool_FromLong(cancelled);
}
#endif
PyObject* netDisconnect(PyObject* poSelf, PyObject* poArgs)
{
CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
@@ -1774,6 +1794,10 @@ void initnet()
{ "SendChangeNamePacket", netSendChangeNamePacket, METH_VARARGS },
{ "SendCreateCharacterPacket", netSendCreateCharacterPacket, METH_VARARGS },
{ "RegisterAccount", netRegisterAccount, METH_VARARGS },
{ "CancelRegisterAccount", netCancelRegisterAccount, METH_NOARGS },
#ifdef MT_HAS_MESHPORT
{ "CancelPendingLogin", netCancelPendingLogin, METH_NOARGS },
#endif
{ "GetRegisterAccountResult", netGetRegisterAccountResult, METH_VARARGS },
{ "SendDestroyCharacterPacket", netSendDestroyCharacterPacket, METH_VARARGS },
{ "SendEnterGamePacket", netSendEnterGamePacket, METH_VARARGS },
+7 -1
View File
@@ -113,6 +113,10 @@ class CPythonSystem : public CSingleton<CPythonSystem>
// PORT: AVA2 effect_level (0 all, 1 hide players/NPCs, 2 hide monsters/NPCs, 3 hide others, 4 hide all).
int GetEffectLevel() { return m_iPortEffectLevel; }
void SetEffectLevel(int iLevel) { m_iPortEffectLevel = iLevel < 0 || iLevel > 4 ? 0 : iLevel; }
int GetShopNamesRange() { return m_iPortShopRange; }
void SetShopNamesRange(int index) { m_iPortShopRange = index < 0 || index > 4 ? 0 : index; }
bool GetShopNameStatus() { return m_bPortNPCNames; }
void SetShopNameStatus(bool shown) { m_bPortNPCNames = shown; }
bool IsUseDefaultIME();
bool IsNoSoundCard();
bool IsAutoTiling();
@@ -163,4 +167,6 @@ class CPythonSystem : public CSingleton<CPythonSystem>
PyObject * m_poInterfaceHandler;
TWindowStatus m_WindowStatus[WINDOW_MAX_NUM];
int m_iPortEffectLevel = 0;
};
int m_iPortShopRange = 0;
bool m_bPortNPCNames = true;
};
@@ -227,6 +227,29 @@ PyObject * systemGetEffectLevel(PyObject * poSelf, PyObject * poArgs)
return Py_BuildValue("i", CPythonSystem::Instance().GetEffectLevel());
}
PyObject* systemSetShopNamesRange(PyObject*, PyObject* args)
{
int index;
if (!PyTuple_GetInteger(args, 0, &index)) return Py_BadArgument();
CPythonSystem::Instance().SetShopNamesRange(index);
return Py_BuildNone();
}
PyObject* systemGetShopNamesRange(PyObject*, PyObject*)
{
return Py_BuildValue("i", CPythonSystem::Instance().GetShopNamesRange());
}
PyObject* systemSetShopNameStatus(PyObject*, PyObject* args)
{
int shown;
if (!PyTuple_GetInteger(args, 0, &shown)) return Py_BadArgument();
CPythonSystem::Instance().SetShopNameStatus(shown != 0);
return Py_BuildNone();
}
PyObject* systemGetShopNameStatus(PyObject*, PyObject*)
{
return Py_BuildValue("i", CPythonSystem::Instance().GetShopNameStatus());
}
PyObject * systemIsAlwaysShowName(PyObject * poSelf, PyObject * poArgs)
{
return Py_BuildValue("i", CPythonSystem::Instance().IsAlwaysShowName());
@@ -440,6 +463,10 @@ void initsystem()
{ "IsShowSalesText", systemIsShowSalesText, METH_VARARGS },
{ "SetEffectLevel", systemSetEffectLevel, METH_VARARGS }, // PORT: AVA2
{ "GetEffectLevel", systemGetEffectLevel, METH_VARARGS },
{ "SetShopNamesRange", systemSetShopNamesRange, METH_VARARGS },
{ "GetShopNamesRange", systemGetShopNamesRange, METH_VARARGS },
{ "SetShopNameStatus", systemSetShopNameStatus, METH_VARARGS },
{ "GetShopNameStatus", systemGetShopNameStatus, METH_VARARGS },
{ "GetShadowLevel", systemGetShadowLevel, METH_VARARGS },
{ "SetShadowLevel", systemSetShadowLevel, METH_VARARGS },
@@ -6,6 +6,7 @@
#include "resource.h"
#include "PythonTextTail.h"
#include "PythonCharacterManager.h"
#include "PythonSystem.h"
#include "PythonGuild.h"
#include "Locale.h"
#include "MarkManager.h"
@@ -463,6 +464,11 @@ void CPythonTextTail::ShowCharacterTextTail(DWORD VirtualID)
if (pInstance->IsGuildWall())
return;
if (!pInstance->PORT_IsDisplayVisible())
return;
if (pInstance->IsNPC() && (pInstance->GetRace() < 30000 || pInstance->GetRace() > 30020) &&
!CPythonSystem::Instance().GetShopNameStatus())
return;
if (pInstance->CanPickInstance())
m_CharacterTextTailList.push_back(pTextTail);