|
You last visited: Today at 20:11
Advertisement
Send a data to Client
Discussion on Send a data to Client within the Flyff Private Server forum part of the Flyff category.
11/13/2016, 20:00
|
#1
|
elite*gold: 0
Join Date: Apr 2011
Posts: 91
Received Thanks: 10
|
Send a data to Client
Hello guys,
I'm trying to develop a new system. My system works like that : A chest spawn which give some loots. I want to make a certain zone around it PvP, i tried to take the Arena system, it works, but when i want to take the positions of the chests, it can't take it, because client don't have the chest ID.
What i'm asking is how to send the CCtrl m_objid value to the client so it will be able to know which ID have the chest and then allow to take the positions of it ?
I tried to add this :
ar << g_WarChestMng.m_pWarChest->m_objid;
to ObjSerializeOpt.cpp in void CObj::Serialize( CAr & ar ) function, but it only broke my server xD
If you guys could help me there ! Thanks alot
|
|
|
11/15/2016, 11:56
|
#2
|
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
|
I don't understand. Try a better explanation and the use of CObj::Serialize seems wrong to me.
|
|
|
11/15/2016, 12:52
|
#3
|
elite*gold: 0
Join Date: Apr 2011
Posts: 91
Received Thanks: 10
|
I'm trying to make the area around the chest PvP. But the chest can spawn at different places.
So i need to get the Chest ID to allow PvP around it client side.. I'm trying to send the objid to the client, but can't make it works
|
|
|
11/15/2016, 13:32
|
#4
|
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
|
Couldn't figure out right now a way to do as you want.
Some idea I had:
Add this to a function like bool CMover::IsChestPvpZone(CMover* pMover)
FOR_LINKMAP(GetWorld(), GetPos(), pObj, nRange, CObj::linkDynamic, nLayer)
{
if(pObj->GetType() == CHEST)
{
//Set PvP to true or whatever (position coordinates I think). In range return true and not range return false
}
}
END_LINKMAP
And then add to PK zones check.
|
|
|
11/15/2016, 19:19
|
#5
|
elite*gold: 0
Join Date: Apr 2011
Posts: 91
Received Thanks: 10
|
But doing like this will not make it work for every different positions of the chest, right ?
|
|
|
11/15/2016, 21:09
|
#6
|
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
|
If there is a chest it will be a pvp zone.
|
|
|
11/16/2016, 01:50
|
#7
|
elite*gold: 0
Join Date: Apr 2011
Posts: 91
Received Thanks: 10
|
Only around the chest even if the chest is at different places ?
|
|
|
11/16/2016, 08:52
|
#8
|
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
|
Quote:
Originally Posted by alfredico
If there is a chest it will be a pvp zone.
|
Please.
|
|
|
11/16/2016, 14:27
|
#9
|
elite*gold: 0
Join Date: Apr 2011
Posts: 91
Received Thanks: 10
|
Sorry, my last comment was a bug xD Thanks guys anyway, i'll try this out
|
|
|
11/18/2016, 17:24
|
#10
|
elite*gold: 0
Join Date: Apr 2011
Posts: 91
Received Thanks: 10
|
Hello back guys, i have some news. Its still not working, and i can't figure out why.
It seems like the client can't get the Chest because if i remove the RETURN FALSE after the if( pObj ) verification, it works but everywhere in map :/
Here is my BOOL CMover::IsWarChestTarget( CMover* pMover )
#ifdef __WAR_CHEST
BOOL CMover::IsWarChestTarget( CMover* pMover )
{
CObj* pObj = g_WarChestMng.m_pWarChest;
int nRange = 48;
FOR_LINKMAP(GetWorld(), GetPos(), pObj, nRange, CObj::linkDynamic, GetLayer())
{
CObj* pObj = g_WarChestMng.m_pWarChest;
if(pObj)
{
if( pObj->GetType() == OT_CTRL )
{
CWorld* pWorld = GetWorld();
if( pWorld && pWorld->IsWarChestZone() )
{
int dx = (int)( pMover->GetPos().x - 3080 );
int dy = (int)( pMover->GetPos().z - 3671 );
int d = dx * dx + dy * dy;
if( d > 12460 )
return FALSE;
dx = (int)( GetPos().x - 3080 );
dy = (int)( GetPos().z - 3671 );
d = dx * dx + dy * dy;
if( d > 12460 )
return FALSE;
return TRUE;
}
}else
return FALSE;
}else
return FALSE;
}
END_LINKMAP
}
#endif // __WAR_CHEST
And here is my chest spawn function :
void CWarChestMng::SpawnWarChest( )
{
#ifdef __WORLDSERVER
CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_MADRIGAL );
#endif
CObj* pObj = CreateObj( D3DDEVICE, OT_CTRL, 155 );
if( IsInvalidObj( pObj ) || pObj->GetType() != OT_CTRL )
return;
CCommonCtrl* pCommonCtrl = (CCommonCtrl*)pObj;
pCommonCtrl->m_CtrlElem.m_dwMinItemNum = 1;
pCommonCtrl->m_CtrlElem.m_dwMaxiItemNum = 1;
pCommonCtrl->m_CtrlElem.m_dwInsideItemKind[0] = 26456;
pCommonCtrl->m_CtrlElem.m_dwInsideItemPer [0] = 3000000000;
// pObj->SetPos( D3DXVECTOR3( 3080.388672F, 47.924984F, 3671.386230F ) );
switch(xRandom( 2 ) )
{
case 0: pObj->SetPos( D3DXVECTOR3( 3080.388672F, 47.924984F, 3671.386230F ) ); break;
case 1: pObj->SetPos( D3DXVECTOR3( 4235.388672F, 47.924984F, 4329.386230F ) ); break;
}
#ifdef __WORLDSERVER
pWorld->ADDOBJ( pObj, TRUE, NULL );
#endif
m_pWarChest = (CObj*)pObj;
Error("L'ID : %d", g_WarChestMng.m_pWarChest->m_dwIndex);
#ifdef __WORLDSERVER
CString str;
str.Format( "WarChest has spawn !");
g_DPCoreClient.SendSystem( str );
#endif
}
#endif // __WAR_CHEST
|
|
|
 |
Similar Threads
|
How to send S->C Value and object packet to client ???
04/06/2016 - SRO Private Server - 45 Replies
Hey guys,
I'm having this issue which is when i send a S->C packet to client it appears only as an object without value ... meaning is when i am inside and send it it appears just like a shape ( client sided only ) but after restarting char it disappears.
so how to send it full with value and its object ???
|
SRX Client Crashes - [Send Error]
01/27/2012 - SRO Private Server - 2 Replies
Hi.
Well, my friend got a problem. I am hosting the Server, everything works fine for me. But when he joins via Hamachi he's getting this error after some minutes.
http://s1.directupload.net/images/111222/egpy3mii .png
Help me & my friend, please! o:
|
[C# .Net] Need help to Send Login Details to SRO Client
12/19/2011 - SRO Coding Corner - 4 Replies
Hello all,
I am trying to send the login ID & password from Windows Form to Silkroad client. But I dont succeed with SendMessage, PostMessage & SendKeys. Can someone please help me send the ID & password to Silkroad client? (I dont need AutoIt/AutoITX).
Thanks in advance.
Regards,
Mahesh
|
WTF!!!EasyMetin>>Client Send Fail!!
10/09/2010 - Metin2 - 38 Replies
Hi,
wie bei mehreren usern geht EasyMetin2 ( die neuste Version ) nicht. Da kommt immer Client Send fail. Ich hab jetzt schon mehrere male gelöscht und wider installiert, aber da geht nichts. Ich komm nicht ma in mein acc rein. manche sagen das sind Wartungsarbeiten, währe dann aber bei alles EasyMetin nutzern diese Meldung?...Gibt ma Pls ne antwort, wäre echt net?!!!!!:handsdown::handsdown::handsdown::handsdo wn::handsdown::handsdown::handsdown::handsdown:
|
[Question] Hooking send() & recv() works, but recv hiding data for co???
05/06/2009 - CO2 Programming - 2 Replies
Hey guys, I've been making a DLL to allow another program to intercept the packets of conquer using windows pipes. (Then its the job of the main program to decrypt the packets, the DLL only gives a communication channel for the main program)
(winsock functions btw)
- hooking send() works fine for my internet browser
- hooking recv() works fine for my internet browser
- hooking send() works fine for conquer online
|
All times are GMT +1. The time now is 20:12.
|
|