Exemplo n.º 1
0
void CHelperManager::MemberListInfo_Send_toAllPlayer(entityPCList_t* pl, int fstate )
{
	
	struct tagHelper *helperlist = GetHelperPtr(pl->idx);
	if(NULL == helperlist) return;

	entityPCList_t target = { 0, };
	for (int idx = 0; idx < helperlist->List.count; idx++ )
	{	
		
		if ( g_entityListMng.FindPCList ( helperlist->List.Member[idx].name, &target ) < 0) continue;
		if( TRUE ==  helperlist->List.Member[idx].bIsMatchHELPERandTACKER) continue;
		
		if ( target.serverIdx == 0 )
		{
			MSG_BeginWriting ( &netMessage );
			MSG_Clear( &netMessage );

			MSG_WriteByte(&netMessage, EXTEND_SECOND);
			MSG_WriteShort ( &netMessage, HELPER_SYSTEM );
			MSG_WriteShort ( &netMessage, SC_LISTINFO_toAllPlayer );
			MSG_WriteByte ( &netMessage, pl->level );
			MSG_WriteByte ( &netMessage, pl->job );
			MSG_WriteByte ( &netMessage, fstate == HelpersLogout ? -1 : pl->worldIdx );				
			MSG_WriteString ( &netMessage, pl->name );				    
			MSG_WriteShort ( &netMessage, helperlist->List.mode);

			playerCharacter_t* pPlayer=gcpTools->GetPlayerRecordPointer(target.idxOnServer);
			if(NULL == pPlayer) {
				MSG_EndWriting(&netMessage);
				return;
			}
		
			NET_SendMessage ( &pPlayer->sock, &netMessage );
			MSG_EndWriting(&netMessage);
			ShowLogInfo("SC_LISTINFO_toAllPlayer: PlayName= %s, level= %d, job= %d, fstate=%d,mode=%d,",
				pl->name,pl->level, pl->job,fstate,helperlist->List.mode );
			
		}else{	

			MSG_BeginWriting ( &netMessage );
			MSG_Clear( &netMessage );
		
			MSG_WriteByte(&netMessage, EXTEND_SECOND);
			MSG_WriteShort ( &netMessage, HELPER_SYSTEM );
			MSG_WriteShort ( &netMessage, SS_REPLY_UPDATE_MemberList_toServer);				
			MSG_WriteByte ( &netMessage, target.serverIdx );
			MSG_WriteShort ( &netMessage, target.idxOnServer );
			
			MSG_WriteByte ( &netMessage, pl->level );
			MSG_WriteByte ( &netMessage, pl->job );
			MSG_WriteByte ( &netMessage, fstate == HelpersLogout ? -1 : pl->worldIdx );				
			MSG_WriteString ( &netMessage, pl->name );					
			MSG_WriteShort ( &netMessage, helperlist->List.mode);
			
			NET_SendUnreliableMessage ( &g_memberServer[target.serverIdx].sock, &netMessage );
			MSG_EndWriting(&netMessage);
		}		
	}
}
Exemplo n.º 2
0
static void SV_AntiCheat_Nag (client_t *cl)
{
	if (cl->anticheat_valid)
	{
		cl->anticheat_nag_time = 0;
		return;
	}

	if (cl->netchan.reliable_length == 0 && (strstr (cl->versionString, "Win32") || strstr (cl->versionString, "win32")))
	{
		MSG_BeginWriting (svc_stufftext);
		MSG_WriteString ("set _old_centertime $scr_centertime\n");
		SV_AddMessage (cl, true);

		MSG_BeginWriting (svc_stufftext);
		MSG_WriteString (va ("set scr_centertime %g\n", sv_anticheat_nag_time->value));
		SV_AddMessage (cl, true);

		//force a buffer flush so the stufftexts go through (yuck)
		SV_WriteReliableMessages (cl, cl->netchan.message.buffsize);
		Netchan_Transmit (&cl->netchan, 0, NULL);

		MSG_BeginWriting (svc_centerprint);
		MSG_WriteString (sv_anticheat_nag_message->string);
		SV_AddMessage (cl, true);

		MSG_BeginWriting (svc_stufftext);
		MSG_WriteString ("set scr_centertime $_old_centertime\n");
		SV_AddMessage (cl, true);

		cl->anticheat_nag_time = 0;
	}
}
Exemplo n.º 3
0
void CHelperManager_Encoder::SendMessage_ReplySummons(int reply, char* toName, char* fromName)
{
	

	int idx = GTH_FindPCByName(toName);
	if ( 0 <= idx) 
	{
		playerCharacter_t* pTaker=gcpTools->GetPlayerRecordPointer(idx);
		if(NULL == pTaker) return;
		
		MSG_BeginWriting(&netMessage);
		MSG_Clear( &netMessage );
		{
			MSG_WriteByte(&netMessage, EXTEND_SECOND);
			MSG_WriteShort ( &netMessage, HELPER_SYSTEM );
			MSG_WriteShort(&netMessage, SC_SPAWN_Res_toTaker);
			MSG_WriteByte(&netMessage, reply);	
			MSG_WriteString(&netMessage, fromName);	
			NET_SendMessage(&pTaker->sock, &netMessage);
		}
		MSG_EndWriting(&netMessage);
	}
	else	
	{
		MSG_BeginWriting(&netMessage);
		MSG_Clear( &netMessage );
		{
			MSG_WriteByte(&netMessage, EXTEND_SECOND);
			MSG_WriteShort ( &netMessage, HELPER_SYSTEM );
			MSG_WriteShort(&netMessage, SS_SPAWN_Res_fromServer);
			MSG_WriteByte(&netMessage, reply);	
			MSG_WriteString(&netMessage, toName);	
			MSG_WriteString(&netMessage, fromName);	
			
			if ( TRUE == g_config.isManager )
			{
				
				for (int serveridx=1; serveridx < MAX_MEMBER_SERVER; serveridx++)	
				{
					if ( !g_memberServer[serveridx].active ) continue;
					
					NET_SendUnreliableMessage(&g_memberServer[serveridx].sock, &netMessage);
				}
			}
			else
			{
				
				MSG_WriteByte(&netMessage, g_config.gameServerNo);
				
				NET_SendUnreliableMessage(&localSocket, &netMessage);
			}
		}
		MSG_EndWriting(&netMessage);
	}
}
Exemplo n.º 4
0
void CHelperManager::ProcessMessage_ServerReplySummons(void)
{
	int idx=-1;
	char toName[NAMESTRING+1], fromName[NAMESTRING+1];
	
	int reply = MSG_ReadByte();
	
	strncpy(toName, MSG_ReadString(),NAMESTRING);
	toName[NAMESTRING]=NULL;
	strncpy(fromName, MSG_ReadString(),NAMESTRING);
	fromName[NAMESTRING]=NULL;

	idx = GTH_FindPCByName(toName);
	if (0 <= idx) 
	{
		playerCharacter_t * pTaker=gcpTools->GetPlayerRecordPointer(idx);
		if(NULL==pTaker) return;
		MSG_BeginWriting(&netMessage);
		MSG_Clear( &netMessage );
		{
			MSG_WriteByte(&netMessage, GSC_REPLYSUMMONS);
			MSG_WriteByte(&netMessage, reply);	
			MSG_WriteString(&netMessage, fromName);	
			NET_SendMessage(&pTaker->sock, &netMessage);
		}
		MSG_EndWriting(&netMessage);
	}
	else	
	{
		if (TRUE == g_config.isManager )
		{	
			int fromMemberIdx = MSG_ReadByte(); 
			
			MSG_BeginWriting(&netMessage);
			MSG_Clear( &netMessage );
			{
				MSG_WriteByte(&netMessage, GSC_REPLYSUMMONS);
				MSG_WriteByte(&netMessage, reply);	
				MSG_WriteString(&netMessage, toName);	
				MSG_WriteString(&netMessage, fromName);	
				
				for (int severidx=1; severidx < MAX_MEMBER_SERVER; severidx++)	
				{
					if ( !g_memberServer[severidx].active ) continue;
					if ( severidx == fromMemberIdx ) continue;	
					
					NET_SendUnreliableMessage(&g_memberServer[severidx].sock, &netMessage);
				}
			}
			MSG_EndWriting(&netMessage);
		}
	}
}
Exemplo n.º 5
0
void CHelperManager::ProcessMessage_Reply_Helpers_Update ()
{
	if ( g_config.gameServerNo != MSG_ReadByte () ) return;

		int idx = MSG_ReadShort ();
		
		playerCharacter_t* pTaker=gcpTools->GetPlayerRecordPointer(idx);
		if(NULL==pTaker) return;
		
		HelperEntry HelperEntries;
		HelperEntries.level = MSG_ReadByte ();
		HelperEntries.job = MSG_ReadByte ();
		HelperEntries.worldIdx = MSG_ReadByte ();
		strncpy ( HelperEntries.name, MSG_ReadString(),NAMESTRING);
		HelperEntries.name[NAMESTRING]=NULL;
		MSG_BeginWriting( &netMessage );
		MSG_Clear( &netMessage );
		{
			MSG_WriteByte(&netMessage, EXTEND_SECOND);
			MSG_WriteShort ( &netMessage, HELPER_SYSTEM );
			MSG_WriteShort ( &netMessage, SC_LISTINFO_toAllPlayer);
			
			MSG_WriteByte ( &netMessage, HelperEntries.level );
			MSG_WriteByte ( &netMessage, HelperEntries.job );
			MSG_WriteByte ( &netMessage, HelperEntries.worldIdx );
			MSG_WriteString ( &netMessage, HelperEntries.name );
			
			NET_SendMessage ( &pTaker->sock, &netMessage );
			
		}
		MSG_EndWriting(&netMessage);
	
}
Exemplo n.º 6
0
Arquivo: Dan.cpp Projeto: gthgame/gth
void CDanBattleSys::SendBattleResult()
{
	TEAM_ITOR	iLoop;
	int			userIdx;
	BYTE		WinTeam;
	
	MSG_BeginWriting( &netMessage );
	MSG_Clear( &netMessage );		
	MSG_WriteByte( &netMessage, GSC_EXTEND );
	MSG_WriteByte( &netMessage, GSC_DAN_BATTLE );
	MSG_WriteByte( &netMessage, DANB_BATTLE_RESULT );

	WinTeam=GetWinTeam();

	MSG_WriteByte( &netMessage,	WinTeam );

	for (iLoop=m_BattleTeam[0].begin();iLoop!=m_BattleTeam[0].end();iLoop++)
	{
		userIdx=(*iLoop);
		
		NET_SendMessage( &g_pc[userIdx].sock, &netMessage );
	}
		
	for (iLoop=m_BattleTeam[1].begin();iLoop!=m_BattleTeam[1].end();iLoop++)
	{
		userIdx=(*iLoop);
		
		NET_SendMessage( &g_pc[userIdx].sock, &netMessage );
	}
		
	MSG_EndWriting( &netMessage );		
}
Exemplo n.º 7
0
Arquivo: Dan.cpp Projeto: gthgame/gth
void CDanBattleManager::SendRequesterList(i3socket_t* sock,BYTE msgType,int serverID)
{
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );

	MSG_WriteByte(&netMessage, GSC_EXTEND);
	MSG_WriteByte(&netMessage, msgType);
	MSG_WriteByte(&netMessage, DANB_REQUESTER_LIST);

	if ( msgType == GMS_DAN_BATTLE )				
	{
		
	}

	BYTE listSize = m_RequestList.size();
	MSG_WriteByte(&netMessage, listSize);

	BATTLE_ITOR			iLoop;
	LPREQUEST_RECORD	pReq;

	for ( iLoop=m_RequestList.begin();iLoop!=m_RequestList.end();iLoop++)
	{
		pReq=static_cast<LPREQUEST_RECORD>(*iLoop);
		MSG_WriteLong(&netMessage, pReq->DanIdx);
		MSG_WriteString(&netMessage, pReq->DanName);
		MSG_WriteString(&netMessage, pReq->MasterName);
	}

	NET_SendMessage( sock, &netMessage);

	MSG_EndWriting(&netMessage);	
}
Exemplo n.º 8
0
Arquivo: Dan.cpp Projeto: gthgame/gth
void CDanBattleFunc::SendGSM_BattleReady(i3socket_t* sock)
{
	
	int		Status			= g_pDanBattleSys->GetStatus();
	DWORD	StatusStartTime = g_pDanBattleSys->GetStatusStartTime();
	
	
	

	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
		
	MSG_WriteByte(&netMessage, GSC_EXTEND);
	MSG_WriteByte(&netMessage, GSC_DAN_BATTLE);
	MSG_WriteByte(&netMessage, DANB_BATTLE_READY);		

	
	

	NET_SendUnreliableMessage(sock, &netMessage);

	MSG_EndWriting(&netMessage);
	
	
}
Exemplo n.º 9
0
Arquivo: Dan.cpp Projeto: gthgame/gth
void CDanBattleFunc::SendGSM_SuggestResult(BYTE isallow)
{
	
	LPREQUEST_RECORD pSuggest=g_pDanBattleManager->GetSuggester();		
	LPREQUEST_RECORD pRequest=static_cast<LPREQUEST_RECORD>(g_pDanBattleManager->GetRequestPointer(NULL));

	if ( pRequest->ServerID >= MAX_PCS || pRequest->ServerID < 0)
		return;

	if (pSuggest==NULL)
	{
		SendErrorCode(&g_pc[pRequest->ServerID].sock,GSC_DAN_BATTLE,1,0);		
		return;
	}	
	
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
		
	MSG_WriteByte(&netMessage, GSC_EXTEND);
	MSG_WriteByte(&netMessage, GSC_DAN_BATTLE);
	MSG_WriteByte(&netMessage, DANB_SUGGEST_RESULT);
	MSG_WriteByte(&netMessage, isallow);

	NET_SendUnreliableMessage(&g_pc[pRequest->ServerID].sock, &netMessage);

	MSG_EndWriting(&netMessage);

}
Exemplo n.º 10
0
void CHelperManager::MemberList_Request_List_OtherServer ( playerCharacter_t* pHelper )
{
	MSG_BeginWriting ( &netMessage );
	MSG_Clear( &netMessage );
	{

		MSG_WriteByte(&netMessage, EXTEND_SECOND);
		MSG_WriteShort(&netMessage, HELPER_SYSTEM);
		MSG_WriteShort( &netMessage, SS_REQUESTMemberList_toServer);
		MSG_WriteString ( &netMessage, pHelper->name );
		MSG_WriteByte ( &netMessage, pHelper->tHelper.List.count );
		
		MSG_WriteShort(&netMessage, pHelper->tHelper.List.mode);
		for (int idx = 0; idx < pHelper->tHelper.List.count; idx++ )
		{
			MSG_WriteString ( &netMessage, pHelper->tHelper.List.Member[idx].id );
			MSG_WriteString ( &netMessage, pHelper->tHelper.List.Member[idx].name );
			
			MSG_WriteByte(&netMessage, pHelper->tHelper.List.Member[idx].bIsMatchHELPERandTACKER);
		}
		
		NET_SendUnreliableMessage ( &localSocket, &netMessage );
	}
	MSG_EndWriting(&netMessage);
}
Exemplo n.º 11
0
void GTH_SendMessage_AddItemObject(itemObject_t *itemObject)
{
	int i;
	int idx;

	
	GTH_GetPCListInValidRange(itemObject->worldIdx, itemObject->position);
	if (g_zonePCListNumber < 1)	return;

	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, GSC_ADDITEMOBJECT);
		MSG_WriteShort(&netMessage, itemObject->idx);
		MSG_WritePosition(&netMessage, itemObject->position);
		MSG_WriteByte(&netMessage, itemObject->objectType);
		
		if( itemObject->objectType == OBJECT_TYPE_ITEM )
		{
			MSG_WriteShort(&netMessage, itemObject->item.itemTableIdx);
		} else if( itemObject->objectType == OBJECT_TYPE_PORTAL )
		{
			MSG_WriteShort(&netMessage, itemObject->portal.portalType);
		}
		
		for (i=0; i < g_zonePCListNumber; i++)
		{
			idx = g_zonePCList[i].idx;
			if ( !g_pc[idx].ready ) continue;
			NET_SendMessage(&g_pc[idx].sock, &netMessage);
		} 
	}
	MSG_EndWriting(&netMessage);
}
Exemplo n.º 12
0
void CWeatherSystem::GTH_SendMessageEventSeting(int event)
{
	if ( event < 0)	
		event = 0;			

	MSG_BeginWriting( &netMessage );
	
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, EXTEND_SECOND);		
		MSG_WriteShort(&netMessage, WEATHER_SYSTEM );				
		MSG_WriteShort(&netMessage, CC_WEATHER_SYSTEM );
		MSG_WriteByte(&netMessage, CC_WEATHER_SYSTEM_BROAD_CASTING_EVENT_SETING);				
		MSG_WriteByte(&netMessage, event);					
		NET_SendMessage(&gsSocket, &netMessage);
	}
	MSG_EndWriting(&netMessage);

	if ( event == 0)	
	{
		g_ifMng->AddChatMessage( g_LPACK.GetMassage(LPACK_TYPE_NORMAL2, 251), GTHCOLOR_SYSMESSAGE, g_LPACK.GetMessage(LPACK_TYPE_NORMAL,322));			
	}
	else
	{
		g_ifMng->AddChatMessage( g_LPACK.GetMassage(LPACK_TYPE_NORMAL2, 252), GTHCOLOR_SYSMESSAGE, g_LPACK.GetMessage(LPACK_TYPE_NORMAL,322));			
	}

	
	g_musicMng->PlaySample( g_soundMng->GetNormalSoundID( GTH_SOUND_ID_WARNING_2 ), GTH_SOUND_PLAY_ONCE );

}
Exemplo n.º 13
0
void GTH_SendMessage_DestroyItem( playerCharacter_t *pc, int reply, int error, int itemIdx )
{
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, GSC_REPLY_DESTROY_ITEM );
		
		MSG_WriteByte(&netMessage, reply );
		
		if( reply > 0 )
		{
			
			MSG_WriteShort(&netMessage, (int)pc->curChargeRA );

			
			MSG_WriteShort(&netMessage, (int)pc->curChargeSA );

			MSG_WriteShort(&netMessage, itemIdx );
			MSG_WriteShort(&netMessage, pc->curItemWeight );
			
			
			MSG_WriteShort(&netMessage, error);
		}
		else
		{
			MSG_WriteByte(&netMessage, error );
		}
		
		NET_SendMessage(&pc->sock, &netMessage);
	}
	MSG_EndWriting(&netMessage);
}
Exemplo n.º 14
0
void GTH_SendMessage_AddInvItem( playerCharacter_t *pc, int reply, int error, item_t *item )
{
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, GSC_ADDITEMINV);
		
		MSG_WriteByte(&netMessage, reply);
		if( reply )
		{
			MSG_WriteItem(&netMessage, item);
			
			
			
			MSG_WriteByte(&netMessage, error);
		}
		else
		{
			MSG_WriteByte(&netMessage, error);
		}
		
		NET_SendMessage(&pc->sock, &netMessage);
	}
	MSG_EndWriting(&netMessage);
}
Exemplo n.º 15
0
Arquivo: Dan.cpp Projeto: gthgame/gth
void CDanBattleSys::SendBattleStart()
{
	TEAM_ITOR	iLoop;
	int			userIdx;

	MSG_BeginWriting( &netMessage );
	MSG_Clear( &netMessage );		
	MSG_WriteByte( &netMessage, GSC_EXTEND );
	MSG_WriteByte( &netMessage, GSC_DAN_BATTLE );
	MSG_WriteByte( &netMessage, DANB_BATTLE_START );
	for (iLoop=m_BattleTeam[0].begin();iLoop!=m_BattleTeam[0].end();iLoop++)
	{
		userIdx=(*iLoop);

		NET_SendMessage( &g_pc[userIdx].sock, &netMessage );
		ShowLogInfo("SendName = %s",g_pc[userIdx].name);
	}

	for (iLoop=m_BattleTeam[1].begin();iLoop!=m_BattleTeam[1].end();iLoop++)
	{
		userIdx=(*iLoop);

		NET_SendMessage( &g_pc[userIdx].sock, &netMessage );
		ShowLogInfo("SendName = %s",g_pc[userIdx].name);
	}

	MSG_EndWriting( &netMessage );		
}
Exemplo n.º 16
0
void GTH_SendMessage_ReplyGetInventoryItem(playerCharacter_t *pc, int reply, int error, int inventoryPos, int equipPos )
{
	int itemIdx;
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, GSC_REPLY_GETINVENTORYITEM);
		
		if( reply > 0 )
		{
			MSG_WriteByte(&netMessage, reply);
			MSG_WriteByte(&netMessage, inventoryPos);
			MSG_WriteByte(&netMessage, equipPos);
			
			if( reply == 5 )
			{
				MSG_WriteByte(&netMessage, pc->mouseInventory);
				itemIdx = pc->inventory[inventoryPos];
				MSG_WriteItem( &netMessage, &pc->item[itemIdx] );
				MSG_WriteItem( &netMessage, &pc->item[pc->mouseInventory] );
			}
		}
		else
		{
			MSG_WriteByte(&netMessage, reply);
			MSG_WriteByte(&netMessage, error);
		}
		
		NET_SendMessage(&pc->sock, &netMessage);
	}
	MSG_EndWriting(&netMessage);

	GTH_PC_Calculate( pc, PCINFO_BASIC );
}
Exemplo n.º 17
0
int CPostFunc::GTH_SendMessage_PostSystem_ReceiveItems()
{	
	CPostManager::PostPackage_t* pPostPackage = NULL;
	pPostPackage = g_cgv.myCharacterInfo->m_PostMng.GetOpenPost();	
	int	OpenIdx = g_cgv.myCharacterInfo->m_PostMng.m_OpenPostIdx;

	
	
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, CC_EXTEND );
		MSG_WriteByte(&netMessage, CC_MAILBOX );
		MSG_WriteByte(&netMessage, MAILBOX_RECEIVE_ITEMS );		
		MSG_WriteLong(&netMessage, OpenIdx );				
		
		NET_SendMessage(&gsSocket, &netMessage); 
	}
	MSG_EndWriting( &netMessage );
	
	return 1;

	

}
Exemplo n.º 18
0
Arquivo: Dan.cpp Projeto: gthgame/gth
void CDanBattleSys::SendBattleInfo()
{
	TEAM_ITOR	iLoop;
	int			userIdx;
	int			totalUser;
	int			aliveUser;

	DWORD remainTime=g_logic.danBattleStatusTime[m_iBattleStatus]-(g_globalTime-m_dwStatusStartTime);

	MSG_BeginWriting( &netMessage );
	MSG_Clear( &netMessage );		
	MSG_WriteByte( &netMessage, GSC_EXTEND );
	MSG_WriteByte( &netMessage, GSC_DAN_BATTLE );
	MSG_WriteByte( &netMessage, DANB_BATTLE_INFO );
	MSG_WriteLong( &netMessage, m_BattleTeamInfo[0].BattlePoint );
	MSG_WriteLong( &netMessage, m_BattleTeamInfo[1].BattlePoint );
	MSG_WriteLong( &netMessage, remainTime );
	totalUser=m_BattleTeam[0].size();
	aliveUser=CountLiveUser(0);
	MSG_WriteLong( &netMessage, totalUser );
	MSG_WriteLong( &netMessage, aliveUser );
	totalUser=m_BattleTeam[1].size();
	aliveUser=CountLiveUser(1);
	MSG_WriteLong( &netMessage, totalUser );
	MSG_WriteLong( &netMessage, aliveUser );
	MSG_WriteLong( &netMessage, m_BattleTeamInfo[0].startDanUserCount );
	MSG_WriteLong( &netMessage, m_BattleTeamInfo[1].startDanUserCount );

	
	
	MSG_WriteString( &netMessage, m_BattleTeamInfo[0].DanName);
	MSG_WriteString( &netMessage, m_BattleTeamInfo[1].DanName);
	
	

	




	for (iLoop=m_BattleTeam[0].begin();iLoop!=m_BattleTeam[0].end();iLoop++)
	{
		userIdx=(*iLoop);

		NET_SendMessage( &g_pc[userIdx].sock, &netMessage );
	}

	for (iLoop=m_BattleTeam[1].begin();iLoop!=m_BattleTeam[1].end();iLoop++)
	{
		userIdx=(*iLoop);

		NET_SendMessage( &g_pc[userIdx].sock, &netMessage );
	}

	MSG_EndWriting( &netMessage );		

}
Exemplo n.º 19
0
void CHelperManager::ProcessMessage_Reply_Helpers_List ()
{
	if ( g_config.gameServerNo != MSG_ReadByte () ) return;

	char czTempName[NAMESTRING+1];

	strncpy(czTempName,MSG_ReadString(),NAMESTRING);

	int idx = MSG_ReadShort ();
	int count = MSG_ReadByte ();
	int enumMode = static_cast<tagHelper::tagMemberList::enumMode>(MSG_ReadShort());
	
	playerCharacter_t* pTaker=gcpTools->GetPlayerRecordPointer(idx);
	
	if(NULL == pTaker) return;
	if(NULL != strcmp(pTaker->name,czTempName)) return;
	
	if(count < USERCOUNT || count > tagHelper::MAX_MEMBER) return;

	HelperEntry HelperEntries[tagHelper::MAX_MEMBER];


	for (int listmember = 0; listmember < count; listmember++ )
	{
		HelperEntries[listmember].level = MSG_ReadByte ();
		HelperEntries[listmember].job = MSG_ReadByte ();
		HelperEntries[listmember].worldIdx = MSG_ReadByte ();
		strncpy (HelperEntries[listmember].name, MSG_ReadString (),NAMESTRING);
		HelperEntries[listmember].name[NAMESTRING]=NULL;
		HelperEntries[listmember].bsync= MSG_ReadByte ();
	}

	MSG_BeginWriting ( &netMessage );
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, EXTEND_SECOND);
		MSG_WriteShort( &netMessage, HELPER_SYSTEM );
		MSG_WriteShort( &netMessage, SC_LIST_Res_toServer );
		MSG_WriteByte( &netMessage, count);
		
		MSG_WriteShort ( &netMessage, enumMode);
		for ( int listmember = 0; listmember < count; listmember++)
		{
			MSG_WriteByte ( &netMessage, HelperEntries[listmember].level );
			MSG_WriteByte ( &netMessage, HelperEntries[listmember].job );
			MSG_WriteByte ( &netMessage, HelperEntries[listmember].worldIdx );
			MSG_WriteString ( &netMessage, HelperEntries[listmember].name );
			MSG_WriteByte(&netMessage, HelperEntries[listmember].bsync);
		}
	
		NET_SendMessage ( &pTaker->sock, &netMessage );
		
	}
	MSG_EndWriting(&netMessage);

}
Exemplo n.º 20
0
void GTH_SendMessageRequestItemSyncItem()
{
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage,	EXTEND_SECOND);
		MSG_WriteShort(&netMessage, ITEM_EXTEND_SYSTEM);
		MSG_WriteShort(&netMessage,	REQUEST_ITEM_SYNC_TIME);
		NET_SendMessage(&gsSocket, &netMessage);
	}
	MSG_EndWriting(&netMessage);	
}
Exemplo n.º 21
0
void CHelperManager_Encoder::SendMessage_Helper_StackOpen(playerCharacter_t* pHelper)
{
		MSG_BeginWriting(&netMessage);
		MSG_Clear( &netMessage );
		{
			MSG_WriteByte(&netMessage, EXTEND_SECOND);
			MSG_WriteShort ( &netMessage, HELPER_SYSTEM );
			MSG_WriteShort(&netMessage, SC_STACK_OPEN_Req_toPlayer);
			NET_SendMessage(&pHelper->sock, &netMessage);
		}
		MSG_EndWriting(&netMessage);
}
Exemplo n.º 22
0
void CGs_To_Cc::Send(playerCharacter_t* pPlayer,int SystemType,int mainType, int subType)
{
	MSG_BeginWriting( &netMessage );
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, EXTEND_SECOND);
		MSG_WriteShort(&netMessage, SystemType);
		MSG_WriteShort(&netMessage, mainType);		
		MSG_WriteShort(&netMessage, subType);		
		NET_SendMessage(&pPlayer->sock, &netMessage);
	}
	MSG_EndWriting(&netMessage);
}
Exemplo n.º 23
0
void CGMCtrl::TransmitePacket_cs_request_AUTHstate(void)
{
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, EXTEND_SECOND);
		MSG_WriteShort(&netMessage, GMsystem);
		MSG_WriteShort(&netMessage, tagExtendSecondPacket_GMsystem::GMsystem_NProtect);
		MSG_WriteShort(&netMessage, tagExtendSecondPacket_GMsystem::tagNProtect::cs_request_AUTHstate);		
		NET_SendMessage(&gsSocket, &netMessage);
	}
	MSG_EndWriting( &netMessage );
}
Exemplo n.º 24
0
void CPostFunc::GTH_SendMessage_PostSystem_WriteOpen(void)
{
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, CC_EXTEND);
		MSG_WriteByte(&netMessage, CC_POSTSYSTEM);
		MSG_WriteByte(&netMessage, POSTSYSTEM_WRITEOPEN);		
		
		NET_SendMessage(&gsSocket, &netMessage); 
	}
	MSG_EndWriting( &netMessage );
}
Exemplo n.º 25
0
void CHelperManager_Encoder::SendMessage_Helper_Helppoint(playerCharacter_t* pHelper)
{
		MSG_BeginWriting(&netMessage);
		MSG_Clear( &netMessage );
		{
			MSG_WriteByte(&netMessage, EXTEND_SECOND);
			MSG_WriteShort ( &netMessage, HELPER_SYSTEM );
			MSG_WriteShort(&netMessage, SC_CONFIRM_HELPPOINT_Res_toPlayer);
			MSG_WriteLong(&netMessage, pHelper->tHelper.tPoint.iHelpPoint);	
			NET_SendMessage(&pHelper->sock, &netMessage);
		}
		MSG_EndWriting(&netMessage);
}
Exemplo n.º 26
0
void GTH_SendMessage_Request_WorldChangeUseItem(WorldChangeSystem *pWorldChangeSystem)
{
	MSG_BeginWriting( &netMessage);	
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte	( &netMessage, CC_EXTEND);
		MSG_WriteByte	( &netMessage, CC_WORLD_CHANGE);	
		MSG_WriteByte	( &netMessage, GTH_REQUEST_USE_ITEM);			
		MSG_WriteByte	( &netMessage, pWorldChangeSystem->m_SaveInvenPos);
		NET_SendMessage	( &gsSocket, &netMessage);
	}
	MSG_EndWriting( &netMessage );
}
Exemplo n.º 27
0
void GTH_SendMessage_GambleSystem_Active(BOOL bActive)
{	
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage,	 EXTEND_SECOND);
		MSG_WriteShort(&netMessage,  GAMBLE_SYSTEM );		
		MSG_WriteShort(&netMessage,  ACTIVE_SYSTEM_REQUEST );
		MSG_WriteLong(&netMessage,   bActive);
		
		NET_SendMessage(&gsSocket, &netMessage); 
	}
	MSG_EndWriting( &netMessage );
}
Exemplo n.º 28
0
inline void CGuildCtrl::TransmitePackete_Summary_Req(const int guildIdx) const
{
	MSG_BeginWriting( &netMessage );
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, CC_GUILD );
		MSG_WriteByte(&netMessage, GUILD_SYNC );
		MSG_WriteByte(&netMessage,enumClientGsvr::fromClient_toGsvr_Summary_Req);
		MSG_WriteShort( &netMessage, guildIdx );
		NET_SendMessage( &gsSocket, &netMessage );
	}
	MSG_EndWriting( &netMessage );

}
Exemplo n.º 29
0
void CHelperManager_Encoder::SendMessage_Invite_Respond_toTaker( 
	playerCharacter_t* pTaker,int errorCode)
{
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, EXTEND_SECOND);
		MSG_WriteShort(&netMessage, HELPER_SYSTEM);
		MSG_WriteShort(&netMessage, SC_INVITE_Res_toTAKER);
		MSG_WriteShort(&netMessage, errorCode);
		NET_SendMessage(&pTaker->sock, &netMessage);
	}
	MSG_EndWriting(&netMessage);
}
Exemplo n.º 30
0
void CGMCtrl::TransmitePacket_NProtect_sc_response_AUTH(playerCharacter_t* pPlayer) const
{
	MSG_BeginWriting(&netMessage);
	MSG_Clear( &netMessage );
	{
		MSG_WriteByte(&netMessage, EXTEND_SECOND);		
		MSG_WriteShort(&netMessage, GMsystem);
		MSG_WriteShort(&netMessage, tagExtendSecondPacket_GMsystem::GMsystem_NProtect);
		MSG_WriteShort(&netMessage, tagExtendSecondPacket_GMsystem::tagNProtect::sc_response_AUTH);
		MSG_WriteLong(&netMessage,  m_cpServerStateDataCtrl->isNProtectAUTH());
		NET_SendMessage( &(pPlayer->sock), &netMessage );
	}
	MSG_EndWriting(&netMessage);
}