Alright, i don't know why i had my last thread closed, I guess I thought I could handle is.
I have been at this problem literally all day and have tried 4 different socket wrappers and they all have the same issue.
PHP Code:
Console.WriteLine("Incoming Auth Data");
AuthClient sender = Sender.Wrapper as AuthClient;
sender.AuthServer.Send(Data);
This is currently Hybrids socket that were upgraded for 5018+
sender is ALWAYS null so when i try to send the data it throws the null exception. My question is is how come it is null and won't 'define' as a AuthClient. If it helps this is my AuthClient class
I think this is happening because you're not setting the Wrapper member in WinsockClient to the AuthClient instance.
Code:
AuthServer.Wrapper = this
However it is irrelevant, why are you using the Sender.Wrapper instead of directly using 'this' keyword? You're essentially in a member function of the same class.
To clear up what they are saying some... go to where you have your on connect method and set the wrapper to the instance of the auth client object you create...
IE on connect you'd be doing something like...
Sender.Wraper = new AuthClient(Socket, Port);
that way the wrapper is not null and you can therefor use it when receiving packets from that client.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using OpenSSL; using System.Net; using System.Net.Sockets; using Network; namespace Conquer_Proxy.Connections { class Connections { public static void Connect() { ConquerSocket AuthS = new ConquerSocket(); AuthS.Port = Program.ProxyPort; AuthS.ClientBufferSize = 100; AuthS.Backlog = 10; AuthS.OnClientDisconnect = new SocketEvent<HybridWinsockClient, object>(AuthDisconnect); AuthS.OnClientReceive = new SocketEvent<HybridWinsockClient, byte[]>(AuthReceive); AuthS.OnClientConnect = new SocketEvent<HybridWinsockClient, object>(AuthConnect); AuthS.Enable();
ConquerSocket GameS = new ConquerSocket(); GameS.Port = 5000; GameS.ClientBufferSize = 1000; GameS.Backlog = 10; GameS.OnClientDisconnect = new SocketEvent<HybridWinsockClient, object>(GameDisconnect); GameS.OnClientReceive = new SocketEvent<HybridWinsockClient, byte[]>(GameReceive); GameS.OnClientConnect = new SocketEvent<HybridWinsockClient, object>(GameConnect); GameS.Enable();
/*ServerSocket Auth = new ServerSocket(); Auth.Listen(5001); Auth.OnClientDisconnect += new SocketErrorEvent(Auth_OnClientDisconnect); Auth.OnReceivePacket += new SocketEvent(Auth_OnReceivePacket); Auth.OnClientConnect += new SocketEvent(Auth_OnClientConnect);
ServerSocket Game = new ServerSocket(); Game.Listen(5000); Game.OnClientDisconnect += new SocketErrorEvent(Game_OnClientDisconnect); Game.OnReceivePacket += new SocketEvent(Game_OnReceivePacket); Game.OnClientConnect += new SocketEvent(Game_OnClientConnect);*/ } public static void AuthConnect(HybridWinsockClient Sender, object param) {//First try { Console.WriteLine("Accepting New Auth Connection"); //remove from LoginConnections Sender.Wrapper = new AuthClient(Sender); //add to LoginConnections } catch (Exception e) { Console.WriteLine(e.ToString()); } } public static void AuthReceive(HybridWinsockClient Sender, byte[] param) {//Second try { byte[] Data = param; Console.WriteLine("Incoming Auth Data"); AuthClient sender = Sender.Wrapper as AuthClient; Console.WriteLine("Length: " + Data.Length + " Data: \r\n" + Dump(Data)); sender.AuthServer.Send(Data); } catch (Exception e) { Console.WriteLine(e.ToString()); } } public static void AuthDisconnect(HybridWinsockClient Sender, object param) { try { Console.WriteLine("Auth Disconnected"); ((AuthClient)param).Disconnect(); } catch (Exception e) { Console.WriteLine(e.ToString()); } } public static void GameConnect(HybridWinsockClient Sender, object param) {//third try { Console.WriteLine("Accepting New Game Connection"); //ifconnected client contains socket- disconnect param = new Client(Sender.Connection, Program.ServerGamePort); //add connected client } catch { } } public static void GameReceive(HybridWinsockClient Sender, byte[] param) {//forth try { byte[] Data = param; Console.WriteLine("Accepting Game Data"); Client C = Sender.Wrapper as Client; C.ServerCrypto.Decrypt(Data); if (C.Exchanging && Data.Length > 36) { C.ClientDHPacket = new Encryption.ClientDHPacket(Data); C.ClientDHPacket.Edit(Data, C.ClientCrypto.DH.PublicKey.ToHexString()); C.ToServerQueue.Enqueue(Data); SetUpCrypt(C); } else { /*split client packet*/ } } catch { } } public static void GameDisconnect(HybridWinsockClient Sender, object param) { Console.WriteLine("Game Disconnected"); Client C = Sender.Wrapper as Client; //disconnect } public static object Dump(byte[] Bytes) { string Hex = ""; foreach (byte b in Bytes) { Hex = Hex + b.ToString("X2") + " "; } string Out = ""; while (Hex.Length != 0) { int SubLength = 0; if (Hex.Length >= 48) { SubLength = 48; } else { SubLength = Hex.Length; } string SubString = Hex.Substring(0, SubLength); int Remove = SubString.Length; SubString = SubString.PadRight(60, ' '); Hex = Hex.Remove(0, Remove); Out = Out + SubString + "\r\n"; } return Out; } static void SetUpCrypt(Client C) { try { BigNumber RealClientPublicKey = BigNumber.FromHexString(C.ClientDHPacket.Client_PubKey); BigNumber RealServerPublicKey = BigNumber.FromHexString(C.ServerDHPacket.Server_PubKey);
Encryption.GameEncryption ClientCrypt = new Encryption.GameEncryption(ASCIIEncoding.ASCII.GetString((C.ClientCrypto).DH.ComputeKey(RealServerPublicKey))); Encryption.GameEncryption ServerCrypt = new Encryption.GameEncryption(ASCIIEncoding.ASCII.GetString((C.ServerCrypto).DH.ComputeKey(RealClientPublicKey)));
null kal 1hithack? 08/16/2010 - Kal Online - 11 Replies naja da sind'n paar leute mit 1hithack o.o
weiß einer wie das da geht?
der macht 2 mio dmg beim boss xd...
NULL NULL 11/01/2008 - Kal Online - 1 Replies Hallo zusammen ,
Ich habe mir nach dieser anleitung Server erstellen - KalZone.de - Deutscher KalOnline P-Server Support
einen kalserver gebaut .
Aber wen ich in das spiel möchte ... zeigt er mir den fehler NULL NULL an i einem kleinem fenster.
Null-Config für 1.9.3? 02/09/2007 - Ragnarok Online - 6 Replies Ich wollte mal ein paar einfache Makros laufen lassen im xkore wie etwa Phenswitch. ich fand null-configs für 1.9.0 bzw 1.9.1 aber darüber hinaus nichtmehr. Mit der Suchfunktion hier bzw im openkore forum direkt kam ich auch nicht weiter. mit den älteren versionen ist es ja nicht möglich auf euro zu botten. Muss ich komplett die ganze Config ändern oder hat da vielleicht schon wer einen link? Hoffe ihr könnt mir da helfen.