Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] P4F Game Server Emulator Sources

Junior Spellweaver
Joined
Aug 1, 2011
Messages
126
Reaction score
90
Crash when GM write /drop 12345123

Fix:

Code:
void ChatDrop(int aIndex,char* text)
{
	if (strlen(text)<1)
		return;

	if (isDropOnlyForGM && !IsGM(aIndex))
	{
		Print(aIndex,0,g_DropOnlyForGMError);
		return;
	}

	int TYPE = 0;
	int INDEX = 0;
	int LEVEL = 0;
	int LUCK = 0;
	int SKILL = 0;
	int OPTION = 0;
	int EXC = 0;
	int ANC = 0;
	int ITEMID = 0;

	sscanf_s(text,"%d %d %d %d %d %d %d %d",&TYPE,&INDEX,&LEVEL,&LUCK,&SKILL,&OPTION,&EXC,&ANC);

	if(TYPE > 15 || TYPE < -1 || INDEX > 160 || INDEX < -1)
	{
		GCServerMsgStringSend("Maximum Group is 15, index is 160!",aIndex,1);
		return;
	}

	ITEMID = ((TYPE * 512) + INDEX);

	if(ITEMID == NULL || LEVEL > 13 || LUCK > 1 || SKILL > 1 || OPTION > 4 || EXC > 63 || ANC > 10)
	{
		GCServerMsgStringSend("Check your syntax.", aIndex, 1);
		GCServerMsgStringSend("/drop GROUP INDEX LEVEL LUCK SKILL OPTION EXC ANC", aIndex, 1);
		return;
	}

	GCServerMsgStringSend("Item created.", aIndex, 1);
	ItemSerialCreateSend ( aIndex , gObj[aIndex].MapNumber , (BYTE)gObj[aIndex].X , (BYTE)gObj[aIndex].Y , ITEMID ,  LEVEL , 0 ,   LUCK ,    SKILL ,   OPTION , -1 , EXC , ANC );

}



Syntax error in /add cmd

fix:

Code:
				else if ( memcmp(lpChat->chatmsg,"/add",strlen("/add")) == 0 )
				{
					ChatAdd(aIndex,&lpChat->chatmsg[5]);
				}
 
Last edited:
Junior Spellweaver
Joined
Dec 23, 2006
Messages
140
Reaction score
153
i'm sorry, but...

IllusionTemple.cpp line 10:
Code:
bool bIT[7];

IllusionTemple.cpp line 115:
Code:
		if(t_time.wHour == IT_Manager[i] && t_time.wMinute == 00 && !bIT[7])
		{
			IL_EVENT_STATE = IL_STATE_BATTLE_START;

			LogAdd("[ ILLUSION TIMER ] Changed state to IL_STATE_BATTLE_START.");
			bIT[7] = true;
		}

		if(t_time.wHour == IT_Manager[i] && t_time.wMinute == 25 && !bIT[8])
		{
			IL_EVENT_STATE = IL_STATE_BATTLE_CLEAR;

			LogAdd("[ ILLUSION TIMER ] Changed state to IL_STATE_BATTLE_CLEAR.");
			bIT[8] = true;
		}

is it correct? i think no ^^
 
Play4Free™
Joined
Aug 8, 2007
Messages
469
Reaction score
277
mmm sorry but i dont see mistake. Maybe im bored...

Regz

thx. I will fix it. But /add command - correct
 
Junior Spellweaver
Joined
Dec 23, 2006
Messages
140
Reaction score
153
bool bIT[7];

bIT[7] = true;
bIT[8] = true;

you have array with 7 elements (0-6). You are trying to set 8 and 9 element as true, which is out of array's range.

ps. add call to gObjViewportListProtocolCreate in ILAPI_MaskTeam, without this your illusion skin may not work
 
Last edited:
Junior Spellweaver
Joined
Aug 1, 2011
Messages
126
Reaction score
90
Dudi is right. This is big mistake ;)

add call to gObjViewportListProtocolCreate in ILAPI_MaskTeam, without this your illusion skin may not work

Code:
void ILAPI_MaskTeam(IL_TEAMSTRUCT *pTeam, int m_Change) {
	for(unsigned i = 0; i < pTeam->v_Members.size(); i++)
	{
		gObj[pTeam->v_Members.at(i).aIndex].m_Change = m_Change;
		gObjViewportListProtocolCreate(&gObj[pTeam->v_Members.at(i).aIndex]);
	}
}

but Dudi said too: we have to remove: gGameServerAuth.
- i dont think so but...
Code:
#define FOREIGN_GAMESERVER 0

Try it !








hmm...
Code:
#if (FOREIGN_GAMESERVER==1)

	gGameServerAuth.RequestData(4);
	DataBufferSize = gGameServerAuth.GetDataBufferSize();
	DataBuffer = gGameServerAuth.GetDataBuffer();
	g_QuestInfo.LoadQuestInfo(DataBuffer, DataBufferSize);	
	gGameServerAuth.GetClientVersion(szTemp, szGameServerExeSerial);
#endif

	char *tok;
	cvstr = strtok_s(szTemp, ".",&tok);
	szClientVersion[0] = cvstr[0];             <- you know why error ;]
	cvstr = strtok_s(NULL, ".",&tok);
	szClientVersion[1] = cvstr[0];
	szClientVersion[2] = cvstr[1];
	cvstr = strtok_s(NULL, ".",&tok);
	szClientVersion[3] = cvstr[0];
	szClientVersion[4] = cvstr[1];

New Version of Client ... bla bla bla
Problem with monsters too... ;]




We can remove this defines in gameserver.h

#define HACK_LOG_SERVER_ENABLED 0
#define CSAUTH_VERSION 2


and this code in GameMain.cpp:

#if (GS_PROTECTED==1)
UnProtectProtocolCore();
#endif

and this defines in GameMain.h

#if (GS_PROTECTED==1)
BOOL UnProtectProtocolCore();
#endif







PS. CRYWOLF EVENT DONT WORKS!!!
AND BILL_CLASS SUXX!
 
Last edited:
Play4Free™
Joined
Aug 8, 2007
Messages
469
Reaction score
277
Thx. I have some free time. And now going to work with GS =)
 
Junior Spellweaver
Joined
Aug 1, 2011
Messages
126
Reaction score
90
Oh my god, just find any season 3 client with KOR protocol and change ip serial and version using a hex editor. There is no client there is a source code of server. you have another topic where you can ask about client.
 
Last edited:
Play4Free™
Joined
Aug 8, 2007
Messages
469
Reaction score
277
No =) bill system means "pay system" or "Vip" system. But... yep... no need. Recode some CM functions, some changes in IT (thx dudi2), some changes in /drop function. Also removed Bill system (maybe not full).
 
Junior Spellweaver
Joined
Aug 1, 2011
Messages
126
Reaction score
90
Then why in first downloaded source I have a Bill system and Vip system ? ; > ...

As I know: Bill system is checking your acc... if you have payed for acc you can play the game but a vip system is checking for etc. additional exp...

by the way... Your eJoinServer dont have auto disconnect ppl when GameServer disconnected/crashed ; )
 
Junior Spellweaver
Joined
Oct 21, 2008
Messages
188
Reaction score
17
bug in gobjSaveItemPet
full inventory with horses or reven = crash gs
 
Junior Spellweaver
Joined
Aug 1, 2011
Messages
126
Reaction score
90
nope... i tested this bug and crashes a dataserver... ; p


Code:
	if ( founditemcount )
	{
		SDHP_SAVE_PETITEM_INFO pMsg;

		pMsg.h.set((LPBYTE)&pMsg, 0x57, lofs+sizeof(pMsg));
		pMsg.nCount = founditemcount;
		memcpy(pbuffer, &pMsg, sizeof(pMsg));

		wsDataServerCli.DataSend(pbuffer, lofs+sizeof(pMsg));
	}

==
Code:
if ( too_much(pets) ) {   DataServer_Crash();  }


we need to limit a pets count in inventory and warehouse or secure this in dataserver... normal users dont have a full inventory of ravens or horses... ;)

its impossible to make full inv of ravens on the server where no pets in shop ;]
 
Last edited:
Play4Free™
Joined
Aug 8, 2007
Messages
469
Reaction score
277
i think all it possible. I try to startup server... and i think soon i will fix it
 
Joined
Aug 6, 2005
Messages
552
Reaction score
298
we need to limit a pets count in inventory and warehouse or secure this in dataserver... normal users dont have a full inventory of ravens or horses... ;)

its impossible to make full inv of ravens on the server where no pets in shop ;]
not impossible. on gmo some guy did that, and all players had long waiting times for vault, login etc :lol:

@Kirgston:
Why you don't try to be a little innovative, and use something like caching? ;) 1 Memcached instance will do the job easy.
 
Back
Top