Angelix 374 Report post Posted August 14, 2019 Hello community of pkoDev, some time ago we got our hands on the source code for the game we love and have been creating unique stuff for years. Many (including myself) are completely useless when trying to build and make a functional application out of the Chinese sources so not many people were using them. Now, thanks to the Sheep Squad (KONG, Billy, Wrexor, Mii, Foxseiz & Snre3n), they have released the source code for the server-side applications and a client to go along with it. We have to thank them for it, since this improves the community as a whole and now you start seeing a few servers popping up. While they're functional, there have been comments about them having some minor issues, which we as a community can come together to fix as a public source code. This thread is created thanks to KONG for giving the idea and is not to bring any other issue/dramas that showed up in the other thread. This thread's only purpose is to identify issues/improvements and share the code that can fix and/or improve the code, therefore: Anyone is allowed to post anything they might have found, even if they don't have an immediate fix for it. Anyone is allowed to contribute fixes to other people's issues and their own. Anyone is allowed to contribute improvements to existing code. If any issue fix and/or improvement is shared and you can make the code better, feel free to contribute! Note1: This thread is not about fixing the directories, missing files or compiling source code itself, that's explained on the original release thread. Note2: This is my first time doing a thread like this, so if I'm missing anything to add, let me know! So for as posting something, lets follow the example stated by KONG. For Bug Reports, follow this: Bug Title: Bug Description: How to replicate: Status (pending / close / open): Author (whoever that fixes it): For Architecture Improvements, follow: Title: Refactor to MVC design pattern Reason: scalability and maintainability Approach: For Game Improvements, follow this: Title: Reason: Improve existing guild functions Approach: SQL table, Open-closed, etc Concerns: concurrency, race, etc Please try posting the actual fixes, if you can, try explaining what was done so the rest of people reading the thread can learn if they're interested. Avoid just posting the whole file like "here's the fixes inside my functions.lua" and posting your 20K line file, try posting just the fixes/changes. 3 Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 14, 2019 (edited) Clean list of the bug reports so you can directly go to the comment that you're interested in. Bug Reports and Status Guild Attribute Refresh / Closed. Amplifier Unlimited Stats / Closed. Random Disconnects / Open. Buy Page Missing Level / Closed. Invisible Swings / Closed. Inventory Item Price / Open. In-Game Shop Not Updating / Closed. Nightmare Helmet Issue / Closed. Admiral Cloak / Closed. GetRoleByID Not Working / Closed. Cannot Upgrade Ship / Open. GroupServer Crash / Open. Edited August 26, 2019 by Angelix 2 Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 14, 2019 (edited) Clean list of the architecture improvements so you can directly go to the comment that you're interested in. Architecture Improvements: Edited August 14, 2019 by Angelix Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 14, 2019 (edited) Clean list of the game improvements so you can directly go to the comment that you're interested in. Game Improvements: In-Game Shop Limited Duration/Quantity / Open. NPC Hover Text Color / Closed. Edited August 15, 2019 by Angelix 1 Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 14, 2019 Bug Title: Guild Attribute Refresh Bug Description: Player attributes are not refreshing instantly when applying an attribute from guild. How to replicate: Open character and guild stats, buy an attribute from guild and the character attribute will not refresh instantly. Only upon teleporting will they refresh. Status: Closed Author: Angelix Source Code - GameApp.h Description: I think DealAllInGuild function was not calling the function RefreshCha correctly, it was trying to send an extra parameter. Checking whether the extra parameter exists or not does the trick and then sending the called function after. inline bool CGameApp::DealAllInGuild(int guildID, const char* luaFunc, const char* luaParam){ BEGINGETGATE(); CPlayer *pCPlayer; CCharacter *pCha = 0; GateServer *pGateServer; while (pGateServer = GETNEXTGATE()){ if (!BEGINGETPLAYER(pGateServer)) continue; int nCount = 0; while (pCPlayer = (CPlayer *)GETNEXTPLAYER(pGateServer)) { if (++nCount > GETPLAYERCOUNT(pGateServer)){ LG("player chain list error", "player number:%u, %s\n", GETPLAYERCOUNT(pGateServer), "DealAllInGuild"); break; } pCha = pCPlayer->GetCtrlCha(); if (!pCha) continue; if (pCha->GetPlayer()->GetMainCha()->GetValidGuildID() == guildID){ if (luaParam != ""){ g_CParser.DoString(luaFunc, enumSCRIPT_RETURN_NONE, 0, enumSCRIPT_PARAM_LIGHTUSERDATA, 1, pCha, enumSCRIPT_PARAM_STRING, 1, luaParam, DOSTRING_PARAM_END); } else{ g_CParser.DoString(luaFunc, enumSCRIPT_RETURN_NONE, 0, enumSCRIPT_PARAM_LIGHTUSERDATA, 1, pCha, DOSTRING_PARAM_END); } } } } return true; } Lua Functions: This function was just missing the guildID call at the beginning. function UpdateGuildAttrs(role) local guildID = GetChaGuildID(role) if not guildAttributes[guildID] then InitGuildAttr(guildID,0,0,0,0,0,0,0,0,0,0,0,0) end local pkt = GetPacket() WriteCmd(pkt,508) WriteDword(pkt,GetRoleID(role)) WriteDword(pkt,0) WriteByte(pkt,32) WriteDword(pkt,guildAttributes[guildID][ATTR_PDEF] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_MSPD] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_ASPD] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_MXATK] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_DEF] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_HIT] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_FLEE] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_HREC] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_SREC] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_MXHP] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_MXSP] or 0) SendPacket(role,pkt) end 1 1 Quote Share this post Link to post Share on other sites
mkhzaleh 131 Report post Posted August 14, 2019 Bug Title: amplifier unlimited stats Bug Description: remove amps stats after switch or use a ticket in same region , unlimited stats time if player login after real ticks finished example : used nana for 10 min , if player logged out then logged after 11min or more nana will be 15999998 seconds Status: Closed Author: mkhzaleh this will save real time and stop ticks when player logout inside Character.cpp search for void CCharacter::SwitchMap(SubMap *pCSrcMap, cChar *szTarMapName, Long lTarX, Long lTarY, bool bNeedOutSrcMap, Char chSwitchType, Long lTMapCpyNO) replace with void CCharacter::SwitchMap(SubMap *pCSrcMap, cChar *szTarMapName, Long lTarX, Long lTarY, bool bNeedOutSrcMap, Char chSwitchType, Long lTMapCpyNO) {T_B if (!pCSrcMap) return; BreakAction(); if( IsPlayerCha() ) { SetSubMap( pCSrcMap ); GetPlayer()->MisGooutMap(); SetSubMap( NULL ); } if (bNeedOutSrcMap && pCSrcMap) pCSrcMap->GoOut(this); if (!strcmp(pCSrcMap->GetName(), szTarMapName)) // 同地图间切换 { if (GetPlayer()) //LG("enter_map", "SwitchMap(同地图切换,控制角色名 %s[主角色名 %s],地图名 %s)--------\n", GetLogName(), GetPlyMainCha()->GetLogName(), szTarMapName); LG("enter_map", "SwitchMap(the same map switch,control player name %s[mainplayer %s],mapname %s)--------\n", GetLogName(), GetPlyMainCha()->GetLogName(), szTarMapName); if (m_SMoveRedu.ulStartTick == 0xffffffff) m_SMoveRedu.ulStartTick = GetTickCount(); if(!IsPlayerCha()) // 非玩家角色,则在自己的出生点重生 { m_SFightInit.chTarType = 0; m_CChaAttr.Init(GetCat()); Square SSrcShape = GetShape(); Square STarShape = {{lTarX, lTarY}, GetRadius()}; if (!pCSrcMap->Enter(&STarShape, this)) pCSrcMap->Enter(&SSrcShape, this); } else { SStateData2String(this, g_skillstate, 1024); //PStateData2String(this, g_skillstate, 1024); if (IsBoat()) g_strChaState[1] = g_skillstate; else g_strChaState[0] = g_skillstate; Square SSrcShape = GetShape(); Square STarShape = {{lTarX, lTarY}, SSrcShape.radius}; if (!pCSrcMap->EnsurePos(&STarShape, this)) // 进入失败 { lTarX = SSrcShape.centre.x; lTarY = SSrcShape.centre.y; } GetPlayer()->GetMainCha()->Cmd_EnterMap(szTarMapName, lTMapCpyNO, lTarX, lTarY); // 角色护送NPC同步地图切换 GetPlayer()->MisEnterMap(); } SetExistState(enumEXISTS_WAITING); return; } else { bool bVolunteer = false; SubMap *pCBackM = GetSubMap(); SetSubMap(pCSrcMap); pCSrcMap->BeforePlyOutMap(this); //LG("enter_map", "SwitchMap(不同Server地图切换,控制角色名 %s[主角色名 %s],原地图 %s,目标地图 %s)--------\n", GetLogName(), GetPlyMainCha()->GetLogName(), pCSrcMap->GetName(), szTarMapName); LG("enter_map", "SwitchMap(differ Server map switch,control player name %s[mainplayer %s],formerly map %s,aimmap %s)--------\n", GetLogName(), GetPlyMainCha()->GetLogName(), pCSrcMap->GetName(), szTarMapName); if (GetSubMap()) //LG("enter_map", "角色地图名 %s\n", GetSubMap()->GetName()); LG("enter_map", "character map name %s\n", GetSubMap()->GetName()); // 资料写数据库 CPlayer *pPlayer = GetPlayer(); if(!pPlayer) return; //组队面板修改 if(GetPlyMainCha()->IsVolunteer()) { bVolunteer = true; GetPlyMainCha()->Cmd_DelVolunteer(); } game_db.SavePlayer(pPlayer, enumSAVE_TYPE_SWITCH); //LG("enter_map", "保存数据成功\n"); LG("enter_map", "save data succeed\n"); // 角色护送NPC同步地图切换 pPlayer->MisLogout(); SetSubMap(pCBackM); // 发送协议 WPACKET l_wpk =GETWPACKET(); WRITE_CMD(l_wpk, CMD_MT_SWITCHMAP); WRITE_STRING(l_wpk, pCSrcMap->GetName()); WRITE_LONG(l_wpk, pCSrcMap->GetCopyNO()); WRITE_LONG(l_wpk, GetShape().centre.x); WRITE_LONG(l_wpk, GetShape().centre.y); WRITE_STRING(l_wpk, szTarMapName); WRITE_LONG(l_wpk, lTMapCpyNO); WRITE_LONG(l_wpk, lTarX); WRITE_LONG(l_wpk, lTarY); if (chSwitchType == enumSWITCHMAP_DIE) // 死亡导致的地图切换(如果目标地图不可达,则gate强制玩家下线,不会返回源地图) WRITE_CHAR(l_wpk, 1); else WRITE_CHAR(l_wpk, 0); ReflectINFof(this,l_wpk); g_pGameApp->DelPlayerIdx(pPlayer->GetDBChaId()); g_pGameApp->m_dwPlayerCnt--; pPlayer->Free(); // 删除gate server对应的维护信息 pPlayer->OnLogoff(); DELPLAYER(pPlayer); //LG("enter_map", "结束进入地图\n\n"); LG("enter_map", "finish enter map\n\n"); } T_E} inside GameDB.cpp search for PStateData2String(pCha, g_skillstate, defSSTATE_DATE_STRING_LIN); replace with SStateData2String(pCha, g_skillstate, defSSTATE_DATE_STRING_LIN); 2 2 Quote Share this post Link to post Share on other sites
Zett 0 Report post Posted August 14, 2019 (edited) Bug Title: Random DisconnectsBug Description: When many few players online it randomly disconnects.. any of them with the reason 10054 which says that "Host forcibly closed your connection" How to replicate: The only way to replicate is to login and wait for the game to disconnect you.. so you can see the reason.Status (pending / close / open): OPEN (Not Fixed)Author (whoever that fixes it): Edited August 14, 2019 by Zett Quote Share this post Link to post Share on other sites
Daisuke 7 Report post Posted August 14, 2019 (edited) Bug Title: "Buy Page" Bug Description: Items do not display Level via "Buy Page" How to replicate: Items do not display Level via "Buy Page" Status: (OPEN (Not Fixed)) Author: whoever that fixes it https://gyazo.com/66e515fb68c8c5779b2e6c7e493970dd Edited August 14, 2019 by Daisuke Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 15, 2019 (edited) 10 hours ago, Daisuke said: Bug Title: "Buy Page" Bug Description: Items do not display Level via "Buy Page" How to replicate: Items do not display Level via "Buy Page" Status: (OPEN (Not Fixed)) Author: whoever that fixes it https://gyazo.com/66e515fb68c8c5779b2e6c7e493970dd I think that might be on client side, couldn't find something related to that like set view or something from server sources. I could probably be something related like this thread. Update: Fixed by applying this patch to client. Edited August 15, 2019 by Angelix 1 Quote Share this post Link to post Share on other sites
mkhzaleh 131 Report post Posted August 15, 2019 Title: IGS todo Improvement Reason: Addd Limited Duration/quantity to igs Approach: open Quote Share this post Link to post Share on other sites
mkhzaleh 131 Report post Posted August 15, 2019 Bug Title: "Nightmare Demonic Helm" Bug Description: Nightmare Demonic Helm upgrade missing Status: (Closed) Author: mkhzaleh /// Bug Title: "Admiral Cloak Upgrade" Bug Description: Admiral Cloak Upgrade missing Status: (Closed) Author: mkhzaleh Cloak Helm 2 Quote Share this post Link to post Share on other sites
mkhzaleh 131 Report post Posted August 15, 2019 (edited) Bug Title: "Swing invisible " Bug Description: Swing missing effect/models/texture Status: (Closed) Author: mkhzaleh & @GOAT Swings Edited August 15, 2019 by mkhzaleh 2 Quote Share this post Link to post Share on other sites
Zett 0 Report post Posted August 15, 2019 On 8/14/2019 at 5:07 AM, Angelix said: Please try posting the actual fixes, if you can, try explaining what was done so the rest of people reading the thread can learn if they're interested. Avoid just posting the whole file like "here's the fixes inside my functions.lua" and posting your 20K line file, try posting just the fixes/changes. 8 hours ago, Angelix said: I think that might be on client side, couldn't find something related to that like set view or something from server sources. I could probably be something related like this thread. Update: Fixed by applying this patch to client. Could you note what's done? thanks. Tho theres another thing missing with Items: Bug Title: Item Price on Invertory Bug Description: Item Value's (Price) on Invertory is not divided by 2 How to replicate: Buy 1 Item at NPC for ex: 5,000 Gold, hover ur mouse on invertory it will still show 5,000 Gold but if you drag to Sell it gives 2,500 Gold, the bug is that it should show 2,500 while you hover ur mouse on invertory aswell. Status: OPEN (Not Fixed) Quote Share this post Link to post Share on other sites
xiaoyuyu321 7 Report post Posted August 15, 2019 Click purchase successfully, check the backpack did not purchase items? Crystal does not decrease immediately, IGS must be reactivated 1 Quote Share this post Link to post Share on other sites
mkhzaleh 131 Report post Posted August 15, 2019 (edited) 5 hours ago, xiaoyuyu321 said: Click purchase successfully, check the backpack did not purchase items? Crystal does not decrease immediately, IGS must be reactivated _igs = {} -- _igs.SavePath = GetResPath('../Log/Igs.log') -- _igs.Initial = function(File) Table = io.open(File, 'r') if Table ~= nil then io.close(Table) else table.save({}, File, 'w') end end _igs.Initial(_igs.SavePath) add this to IGS.lua edit function IGSLog(msg) local file = "Log/Igs.log" or just create new folder and rename it to GSlog and create new file inside it "Igs.log" Edited August 15, 2019 by mkhzaleh 1 Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted August 15, 2019 (edited) Npc Dialogue Base: Normal default color - Dark Blue Use: It can be helpful for players when reading options before clicking. Open Game.exe with any Hex-editor Look for 0xFF0000AF Address: Replace: Value with any R,G,B value you wish. -> Must convert and reverse order Final Result: Change hover color to other color Edited August 15, 2019 by GOAT 3 Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 15, 2019 13 hours ago, Zett said: Could you note what's done? thanks. Sorry. I could not provide what was fully done since it was given to me by a friend that hexed it. It fixes the issue of "Level Requirement" not showing up on NPC's "BuyPage". Quote Share this post Link to post Share on other sites
Daisuke 7 Report post Posted August 15, 2019 whenever I left it full screen or 1024 x .. the screen turns blue Quote Share this post Link to post Share on other sites
xiaoyuyu321 7 Report post Posted August 16, 2019 9 hours ago, mkhzaleh said: 将此添加到IGS.lua 编辑 函数IGSLog(msg) local file =“Log / Igs.log” 或者只是创建新文件夹并将其重命名为GSlog并在其中创建新文件“Igs.log” Thanks! Quote Share this post Link to post Share on other sites
squaller 21 Report post Posted August 16, 2019 (edited) Quote whenever I left it full screen or 1024 x .. the screen turns blue @Daisuke just add CameraConf1024.clu file in scripts/lua client, you can get that from top2/pko2 clients Edited August 16, 2019 by squaller 1 Quote Share this post Link to post Share on other sites
Daisuke 7 Report post Posted August 16, 2019 does anyone have any idea how this CO VIP Chat works? How do I allow a player to talk in this chat? Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted August 16, 2019 2 hours ago, Daisuke said: does anyone have any idea how this CO VIP Chat works? How do I allow a player to talk in this chat? Incomplete feature. I think Billy wanted to do some VIP level function where each VIP level unlocks new features to the game (from a marketing perspective). 1 Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted August 17, 2019 Bug Title: GetRoleByID Function Bug Description: The lua function "GetRoleByID" is not properly returning the role. How to replicate: Insert a character ID into "GetRoleByID" function and it won't return the role. Status: Closed Author: Angelix GameServer Source / CharScript.cpp inline int lua_GetRoleByID(lua_State* L) { BOOL bValid = lua_gettop(L) == 1 && lua_isnumber(L, 1); if (!bValid) { E_LUAPARAM; return 0; } DWORD dwChaDBID = (DWORD)lua_tonumber(L, 1); CPlayer* pPlayer = g_pGameApp->GetPlayerByDBID(dwChaDBID); if (pPlayer) { CCharacter* pCha = (CCharacter*)pPlayer->GetMainCha(); lua_pushlightuserdata(L, (CCharacter*)pCha); return 1; } //lua_pushlightuserdata(L, NULL); return 0; } 1 Quote Share this post Link to post Share on other sites
xiaoyuyu321 7 Report post Posted August 17, 2019 Bug Title: ship cannot be upgraded Status: Open When you click upgrade, NPC don't have any prompts! Quote Share this post Link to post Share on other sites
Daisuke 7 Report post Posted August 23, 2019 would anyone know how to use color notice? Quote Share this post Link to post Share on other sites