void send() { socket.writeByte(252); socket.writeShort((short)enckey.Length); socket._stream.Write(enckey, 0, enckey.Length); socket.writeShort((short)enctoken.Length); socket._stream.Write(enctoken, 0, enctoken.Length); }
public void writeSlot(Item item, Wrapped.Wrapped socket) { if (item == null) { socket.writeShort(-1); } socket.writeShort((short)item.itemID); socket.writeByte(item.itemCount); socket.writeShort(item.itemDamage); socket.writeShort(-1); }
public creativeInventory(Wrapped.Wrapped socket, Form1 mainform, short slot, Classes.Item clicked) { functions helper = new functions(); socket.SendByte(0x6b); socket.writeShort(slot); helper.writeSlot(clicked, socket); }
//Client-to-Server only public ClickWindow(Wrapped.Wrapped socket, Form1 MainForm, short slot, byte mouse, byte mode, Classes.Item clicked) { socket.writeByte(0x66); socket.writeByte(0); socket.writeShort(slot); socket.writeByte(mouse); socket.writeShort(13); socket.writeByte(mode); if (clicked == null) { socket.writeShort(-1); } else { socket.writeShort((short)clicked.itemID); socket.writeByte(clicked.itemCount); socket.writeShort(clicked.itemDamage); socket.writeShort(-1); } if (slot == -999 && clicked != null) { MainForm.inventory.Remove(clicked); // Just to make sure, pretty sure that minecraft will send a setwindowitem for it to clear anyway. } }
public ConfirmTransaction(Wrapped.Wrapped socket, Form1 mainform) { // Should only be sent if we actually receive one with a "false" for accepted. byte windowID = socket.readByte(); short actionNumber = socket.readShort(); bool accepted = socket.readBool(); if (accepted == false) { socket.writeByte(0x6A); socket.writeByte(windowID); socket.writeShort(actionNumber); socket.writeBool(accepted); ClickWindow cw = new ClickWindow(socket, mainform, -999, 0, 0, null); // If we're holding something on our cursor, drop it. } }
void send() { socket.writeByte(16); socket.writeShort(myform.selectedSlot); }