- Joined
- Sep 4, 2009
- Messages
- 248
- Reaction score
- 69
I'm "kinda" new to C#, but not completely stupid. I just started to finish a GunZ emulator that was started by Team Zebra.
Problem: After selecting your character and attempting to join the "lobby", an exception is caught. The exception says "Object reference not set to an instance of an object."
After debugging the crap outta it, I believe this is the cause.
Which 'response' acts on a packet, and executes a function that sends/grabs packets to the client.
Here's the function.
I know it's something little. T_T
Problem: After selecting your character and attempting to join the "lobby", an exception is caught. The exception says "Object reference not set to an instance of an object."
After debugging the crap outta it, I believe this is the cause.
Code:
response.writeString(lobby.name);
Which 'response' acts on a packet, and executes a function that sends/grabs packets to the client.
Here's the function.
Code:
public static void responseJoin(Client c, GunzPacket p)
{
p.setIndex(11);
UID uidPlayer = new UID();
UID uidChannel = new UID();
uidPlayer.first = (uint)p.readInt();
uidPlayer.second = (uint)p.readInt();
uidChannel.first = (uint)p.readInt();
uidChannel.second = (uint)p.readInt();
if (uidPlayer != c.uid)
return;
Lobby lobby = Lobby.getLobbyByUID(uidChannel);
GunzPacket response = new GunzPacket(0x64, 0x4B7);
response.startHeader();
response.writeInt(uidChannel.first);
response.writeInt(uidChannel.second);
response.writeInt(0x00);
response.writeString(lobby.name); //....
response.writeByte(0x00);
response.writeByte(0x01);
response.finishHeader();
c.send(response);
lobby.addClient(c);
responseRule(c, uidChannel);
Stage.list(c, uidChannel);
}
I know it's something little. T_T
Last edited:

