nyarum / noterius Goto Github PK
View Code? Open in Web Editor NEWNew generation emulator for MMORPG Pirate King Online
License: MIT License
New generation emulator for MMORPG Pirate King Online
License: MIT License
Okay, this is list of tasks for working and developing:
I can't find any information about Look struct in source files.
If anyone can find this, it would help to continue packets.
It's struct embedded in Character info.
Take a look into wiki page - https://github.com/Nyarum/noterius/wiki/Network-package
There are you find an information about "How I can write a new packet for emulator?"
Methods from source files:
From client (in package), with some code about returned errors in response packet
WPacket GroupServerApp::TP_NEWCHA(Player *ply,DataSocket *datasock,RPacket &pk)
{
WPacket l_retpk =GetWPacket();
if(ply->m_currcha >=0)
{
l_retpk.WriteShort(ERR_PT_INERR); //Ӧ����ֵ��ϵͳ��һ�´���
return l_retpk;
}
MutexArmor l_lockCha(ply->m_mtxCha);
if(ply->m_chanum >=const_cha.MaxChaNum) //�Ѵﵽϵͳ��������ɫ��
{
l_retpk.WriteShort(ERR_PT_TOMAXCHA);
return l_retpk;
}
uShort l_len;
cChar *l_chaname =pk.ReadString(&l_len);
if(!l_chaname)
{
l_retpk.WriteShort(ERR_PT_INERR);
return l_retpk;
}else if(l_len >16)
{
l_retpk.WriteShort(ERR_PT_TOOBIGCHANM);
return l_retpk;
}else if(!IsValidName(l_chaname,l_len) || !CTextFilter::IsLegalText(CTextFilter::NAME_TABLE,l_chaname)) //(strchr(l_chaname,'\''))//��ɫ���в����е�����'
{
l_retpk.WriteShort(ERR_PT_ERRCHANAME);//��ɫ�����Ϸ�
return l_retpk;
}
//cChar * l_birth =pk.ReadString(&l_len);
//dstring l_birth1 ="";
//cChar * l_birth2 =0;
//if(l_birth && l_len <30 && !strchr(l_birth,'/'))
//{
// l_birth1 =dstring("/")<<l_birth<<"/";
// try{
// l_birth2 =this->m_cfg["��ɫ"]["������"];
// }catch(...)
// {
// l_birth2 =0;
// }
//}else
//{
// l_birth2 =0;
//}
//if(!l_birth2 ||!strstr(l_birth2,l_birth1))
//{
// l_retpk.WriteShort(ERR_PT_INVALIDBIRTH); //�����طǷ�
//}else
//{
cChar * l_birth =pk.ReadString(&l_len);
dstring l_birth1 ="";
cChar * l_map =0;
if(l_birth && l_len <30 && !strchr(l_birth,'/'))
{
l_birth1 =l_birth;
try{
// Modify by lark.li 20080702 begin
//l_map =m_cfg["������"][l_birth];
//l_map =m_cfg["birthplace"][l_birth];
map<string, string>::iterator it = m_mapBirthplace.find(string(l_birth));
if(it != m_mapBirthplace.end())
{
l_map = it->second.c_str();
}
// End
}catch(...)
{
l_map =0;
}
}else
{
l_map =0;
}
if(!l_map)
{
l_retpk.WriteShort(ERR_PT_INVALIDBIRTH); //�����طǷ�
return l_retpk;
}
const LOOK *look =reinterpret_cast<const LOOK*>(pk.ReadSequence(l_len));
if(!look || l_len !=sizeof(LOOK))
{
l_retpk.WriteShort(ERR_PT_INVALIDDAT);
return l_retpk;
}
char l_look[defLOOK_DATA_STRING_LEN];
try{
if(!LookData2String(look,l_look,defLOOK_DATA_STRING_LEN))
{
l_retpk.WriteShort(ERR_PT_INVALIDDAT);
return l_retpk;
}}catch(...)
{
LogLine l_line(g_LogGrpServer);
//l_line<<newln<<"�ʺ�["<<ply->m_acctname<<"]�½���ɫ["<<l_chaname<<"]ʱ�����������ת���쳣��"<<endln;
l_line<<newln<<"account["<<ply->m_acctname<<"]new char["<<l_chaname<<"]find appreance data convert exception"<<endln;
l_retpk.WriteShort(ERR_PT_INVALIDDAT);
return l_retpk;
}
MutexArmor l_lockDB(m_mtxDB);
if(!m_tblcharaters->InsertRow(l_chaname,ply->m_acctid,l_birth,l_map,l_look)) //��ɫ���ظ�
{
LogLine l_line(g_LogGrpServer);
//l_line<<newln<<"�ʺ�["<<ply->m_acctname<<"]�½���ɫ["<<l_chaname<<"]ʱ���������ظ���"<<endln;
l_line<<newln<<"account["<<ply->m_acctname<<"]new char["<<l_chaname<<"]the same name exception"<<endln;
l_retpk.WriteShort(ERR_PT_SAMECHANAME);
return l_retpk;
}
l_retpk.WriteShort(ERR_SUCCESS);
//�������ݿ����ʺŵĽ�ɫID�б�CharIDs
if(m_tblcharaters->FetchRowByChaName(l_chaname) <1)
{
l_retpk.WriteShort(ERR_PT_INERR);
LogLine l_line(g_LogGrpServer);
//l_line<<newln<<"�ʺ�["<<ply->m_acctname<<"]�½���ɫʱ���������ָ������ݿ��������";
l_line<<newln<<"account["<<ply->m_acctname<<"] when create char , can't restore database failed.";
return l_retpk;
}
ply->m_chaid[ply->m_chanum] =m_tblcharaters->Getcha_id();
ply->m_chaname[ply->m_chanum] =l_chaname;
ply->m_motto[ply->m_chanum] =m_tblcharaters->GetMottonByName();
ply->m_icon[ply->m_chanum] =m_tblcharaters->GetIconByName();
ply->m_guild[ply->m_chanum] =0;
ply->m_chanum ++;
char l_CharIDs[80]; l_CharIDs[0]=0;
char l_buf[20];
for(char i=0;i<ply->m_chanum;i++)
{
strcat(l_CharIDs,itoa(ply->m_chaid[i],l_buf,10));
strcat(l_CharIDs,";");
}
m_tblaccounts->UpdateRow(ply->m_acctid,l_CharIDs);
l_lockDB.unlock();
LogLine l_line(g_LogGrpServer);
/*
l_line<<newln<<"("<<ply->m_clientip<<"):["<<ply->m_acctname<<"]�½��˽�ɫ["
<<l_chaname<<"]��\t��ǰ��¼/��Ϸ�����:"
<<m_plylst.GetTotal()<<"/"<<long(m_curChaNum)<<endln;
*/
l_line<<newln<<"("<<ply->m_clientip<<"):["<<ply->m_acctname<<"]create char ["
<<l_chaname<<"]��\t online/total:"
<<m_plylst.GetTotal()<<"/"<<long(m_curChaNum)<<endln;
l_lockCha.unlock();
return l_retpk;
}
From server (out package)
BOOL SC_NewCha(LPRPACKET pk)
{T_B
uShort l_errno =pk.ReadShort();
NetNewCha(l_errno);
#ifdef _TEST_CLIENT
CTestClient* pClient = reinterpret_cast<CTestClient*>( g_NetIF->m_connect.GetDatasock()->GetPointer() );
pClient->Failure( l_errno );
#endif
return TRUE;
T_E}
}
Error enums you can find in - https://github.com/Nyarum/noterius/wiki/Error-enums
Hola! @Nyarum has created a ZenHub account for the Nyarum organization. ZenHub is the leading team collaboration and project management solution built for GitHub.
To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.
ZenHub adds a series of enhancements directly inside the GitHub UI:
Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @Nyarum.
So, currently the official serer files use LUA for script engine.
I can to integrate LUA with custom API to use it for writing script files (Locations, NPCs, items, etc..)
But then we got:
or the emulator can use Go for scripts and then:
All information in title :)
List of character screen packets:
List of world screen packets:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.