I asked a question before, but it sounds like I didn’t explain it in a good way, so here are the codes for the worst part (getting information from the package and storing them in x, y and there is a structure that accepts 2 ushort ref, so when I define an object, it changes the value of the variables that I send)
public class PacketHandler : GUI { GameUser role; public PacketHandler(GameUser who) { role = who; } ushort Actualx, Actualy; public PacketHandler(ref ushort x ,ref ushort y) { x = Actualx; y = Actualy; } public unsafe void HandleServer(byte[] data) { . . . case 10010: { if (BitConverter.ToUInt16(data, 8) == 1002) { Actualx = BitConverter.ToUInt16(data, 24); Actualy = BitConverter.ToUInt16(data, 26); } break; }
this gets the value from the packages, saves them in actualx, actually getting ready to give them to any ushort ref request when defining an object parameter
there is another class here
public class ClientBase { GameUser role2; public ClientBase(GameUser role) { role2 = role; Thread T = new Thread(HuntThread) { Name = "Hunt Thread" }; T.Start(this); } . . . public void HuntThread(object Sender) { ClientBase Client = Sender as ClientBase; while (true) { Monster Target = GetNextkill(); if (Target != null) { Thread.Sleep(1000); ProxyParadise.Network.Packets.PacketHandler getxandy = new ProxyParadise.Network.Packets.PacketHandler(ref X, ref Y); ProxyParadise.Network.Packets.PacketStructure ps = new ProxyParadise.Network.Packets.PacketStructure(); . . .
and the real problem is that I find zero in x and y, when I track it, I find zero in actualx, actual, however I'm sure they got the value, so I think I'm doing something stupid
so overall, if u cannot help me in this code or figure out what I mean, then please tell me the correct way to get values ​​from another class when using streaming, thanks everyone, please, some kind of mod delete my old question, I rephrase it better now.