Commit 7d0a5a85 authored by mercury233's avatar mercury233 Committed by mercury233

add CtosMessage.ExternalAddress

parent 5f7814d0
using System.IO; using System;
using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Text;
using YGOSharp.Network; using YGOSharp.Network;
using YGOSharp.Network.Enums; using YGOSharp.Network.Enums;
using YGOSharp.Network.Utils; using YGOSharp.Network.Utils;
...@@ -65,7 +65,12 @@ namespace WindBot.Game ...@@ -65,7 +65,12 @@ namespace WindBot.Game
private void OnConnected() private void OnConnected()
{ {
BinaryWriter packet = GamePacketFactory.Create(CtosMessage.PlayerInfo); BinaryWriter packet = GamePacketFactory.Create(CtosMessage.ExternalAddress);
packet.Write((UInt32)0); // real_ip, is always 0 in normal client
packet.WriteUnicodeAutoLength(_serverHost, 255);
Connection.Send(packet);
packet = GamePacketFactory.Create(CtosMessage.PlayerInfo);
packet.WriteUnicode(Username, 20); packet.WriteUnicode(Username, 20);
Connection.Send(packet); Connection.Send(packet);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
Surrender = 0x14, Surrender = 0x14,
TimeConfirm = 0x15, TimeConfirm = 0x15,
Chat = 0x16, Chat = 0x16,
ExternalAddress = 0x17,
HsToDuelist = 0x20, HsToDuelist = 0x20,
HsToObserver = 0x21, HsToObserver = 0x21,
HsReady = 0x22, HsReady = 0x22,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment