UPDATE TITLE W/O TELEPORT HELP

10/09/2018 21:03 GhosTly93#16
Quote:
Originally Posted by Zoro.Sro View Post
dude you must send the packet for all players on the same region

Packet pack = new Packet(0x30DF); // update title packet
pack.WriteUInt32(session.Character.UniqueID); // Char UniqueID
pack.WriteUInt8(TitleID); // title numb
SessionExt.BroadCastToSameRegion(session, pack); // here method thats send the packet for every player on the same region
its simple for each player send the title update packet
i use supermike source...

but i cant use this session:
--- SessionExt.BroadCastToSameRegion(session, pack);

[Only registered and activated users can see links. Click Here To Register...]

how i can find player around chars with use SUPERMIKE ???
10/09/2018 21:29 #HB#17
Quote:
Originally Posted by GhosTly93 View Post
i use supermike source...

but i cant use this session:
--- SessionExt.BroadCastToSameRegion(session, pack);

[Only registered and activated users can see links. Click Here To Register...]

how i can find player around chars with use SUPERMIKE ???
For supermike source, use this to send S -> C packets:
Code:
m_LocalSecurity.Send(packet);
You can make your own BroadCastToSameRegion though, its not hard.
10/09/2018 22:11 GhosTly93#18
Quote:
Originally Posted by #HB View Post
You can make your own BroadCastToSameRegion though

I've been asking how I can do it for all days :feelsbadman:
10/09/2018 23:42 #HB#19
It's very simple, make a new function at Silkroad API packet reference called BroadCastToSameRegion if you want to call it like:
Code:
packet.BroadCastToSameRegion(bool agreement);
The function will simply do this check the current region then do this:
Code:
if (agreement)
{
	if (ThisRegion == "C->S")
	{
		m_RemoteSecurity.Send(packet);
	}
	else
	{
		m_LocalSecurity.Send(packet);
	}
}
else
{
	if (ThisRegion == "C->S")
	{
		m_LocalSecurity.Send(packet);
	}
	else
	{
		m_RemoteSecurity.Send(packet);
	}
}
Or you can even edit it to send it to the region you want, which I'd prefer.
10/10/2018 07:15 B1Q#20
Quote:
Originally Posted by #HB View Post
Code:
if (agreement)
{
	if (ThisRegion == "C->S")
	{
		m_RemoteSecurity.Send(packet);
	}
	else
	{
		m_LocalSecurity.Send(packet);
	}
}
else
{
	if (ThisRegion == "C->S")
	{
		m_LocalSecurity.Send(packet);
	}
	else
	{
		m_RemoteSecurity.Send(packet);
	}
}
what in the actual fuck is that. PLEASE DO NOT USE THIS!

Quote:
Originally Posted by GhosTly93 View Post
I've been asking how I can do it for all days :feelsbadman:
ok here

Code:
class CSCommunication
{
	// 2 sockets here
	
	// 2 security instances 
	
	// buffer 
	
	
	// constructor 
	
	
	// methods
	private void ForwardToClient()
	{
		var packets = this.clientSecurity.TransferOutGoing();
		// loop & send 
	}
	public void SendToClient(Packet pck) // you can always use a bool / enum to switch
	{
		this.clientSecurity.Send(pck);
		this.ForwardToClient();
	}
	
	// public properties
	public ushort RegionID {get;set;} // this updates everytime the user moves (use the S->C packets for reliability) 
}


class SocketListener : Socket
{
	// this is where you initialize your server's socket and your clients list 
	public List<CSCommunication> ConnectedClients = new List<CSCommunication>();
	
	
	public void BroadCastToSameRegion(Packet pck, ushort region)
		=> ConnectedClients.Where(c=>c.RegionID==region).ToList().Foreach(c=>c.SendToClient(pck));
}
notepad++ function names may not be the same but you get the concept
10/10/2018 12:30 #HB#21
Quote:
Originally Posted by B1Q View Post
what in the actual fuck is that. PLEASE DO NOT USE THIS!
.

Quote:
Originally Posted by #HB View Post
Or you can even edit it to send it to the region you want, which I'd prefer.
10/10/2018 16:29 B1Q#22
Quote:
Originally Posted by #HB View Post
.
your statement has nothing to do with the code you posted
you had the choice of posting a proper piece of code to help him but instead you just distracted him and possibly put him in the wrong direction.
10/10/2018 17:21 #HB#23
Quote:
Originally Posted by B1Q View Post
your statement has nothing to do with the code you posted
you had the choice of posting a proper piece of code to help him but instead you just distracted him and possibly put him in the wrong direction.
Okay, my bad.
10/12/2018 17:05 SubZero**#24
request to close :kappa: