How to send S->C Value and object packet to client ???

03/31/2016 03:54 Kardil#1
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 ???
03/31/2016 04:30 sarkoplata#2
there is no such thing, if you want that to be a REAL item you have to write it to gameserver's memory or write it to database and gs will get it the next time you spawn
03/31/2016 05:37 Kardil#3
then how to send packet to specific player ???
03/31/2016 09:45 sarkoplata#4
On your server filter (whatever youre using) you must keep a list of the online characters and when youre going to send a packet to that specific player just bring it from the list using linq. To demonstrate:

OnUserLogin -> UserList.Add(this);
OnUserExit -> UserList.Remove(this)

To retreive write a simple linq function and find that user's sockets so you can send the packet
FindUser(UserList, "testchar").clientsocket.Send(mypacket);

Hope that clears your mind
03/31/2016 23:39 Kardil#5
Quote:
Originally Posted by sarkoplata View Post
On your server filter (whatever youre using) you must keep a list of the online characters and when youre going to send a packet to that specific player just bring it from the list using linq. To demonstrate:

OnUserLogin -> UserList.Add(this);
OnUserExit -> UserList.Remove(this)

To retreive write a simple linq function and find that user's sockets so you can send the packet
FindUser(UserList, "testchar").clientsocket.Send(mypacket);

Hope that clears your mind
I think i can make the list but the socket thing has a send but not for packets, so ????
04/01/2016 00:20 sarkoplata#6
nah you wont send directly from the socket, you'll send through the security object
assuming you're with the drew api cuz its like standart right now
04/01/2016 00:58 Kardil#7
Quote:
Originally Posted by sarkoplata View Post
nah you wont send directly from the socket, you'll send through the security object
assuming you're with the drew api cuz its like standart right now
i knew you would say that ^^ , i need to know how to connect socket with the security assuming using filter for packets
04/01/2016 15:43 KingDollar#8
or well just create a packet handler
04/01/2016 19:31 Kardil#9
is packet handler like filter which analyse incoming and outgoing packets ???
I have that , what i need is to send from this filter a packet to specific player like sending welcome message to the one who has just logged in . got it ?
04/01/2016 22:15 KingDollar#10
it's depends on your filter code
just handle load character msg and send packet with private notice
04/01/2016 22:41 Kardil#11
Quote:
Originally Posted by Alexiuns* View Post
it's depends on your filter code
just handle load character msg and send packet with private notice
that seems familiar with what i am doing !
but explain ???
sending msg to that player and when i detect its response from server i send the packet i want ???
04/02/2016 00:34 KingDollar#12
Quote:
Originally Posted by Kardil View Post
that seems familiar with what i am doing !
but explain ???
sending msg to that player and when i detect its response from server i send the packet i want ???
ye as example

if packet.Opcode = 0x3305
{
Packet notice_to_char = new Packet(0x3026);
notice.WriteUInt8(7);
notice.WriteAscii("Welcome msg");
SendPacketToClient(notice_to_char);
}
04/02/2016 01:13 Kardil#13
Quote:
Originally Posted by Alexiuns* View Post
ye as example

if packet.Opcode = 0x3305
{
Packet notice_to_char = new Packet(0x3026);
notice.WriteUInt8(7);
notice.WriteAscii("Welcome msg");
SendPacketToClient(notice_to_char);
}
where is the player here in this packet ???
04/02/2016 01:21 KingDollar#14
Quote:
Originally Posted by Kardil View Post
where is the player here in this packet ???
charcter load packet is 0x3305 packet and you can get charname while character select
04/02/2016 01:57 Kardil#15
Quote:
Originally Posted by Alexiuns* View Post
charcter load packet is 0x3305 packet and you can get charname while character select
that's right ,from here i can save charname and send wlc msg
but that's for logging , i need to send the packet after some time