Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
x44yz committed Aug 15, 2018
1 parent e495caf commit 1ac5a76
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
8 changes: 8 additions & 0 deletions enet/client/Assets/Scripts/Net/NetClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public enum NetMessageMethod
OnConnectedToMaster,
}

public enum OpCode : byte
{
JoinRoom = 0,

}

public class NetClient : XNetPeer
{
public string hostPlayerId;
Expand Down Expand Up @@ -166,4 +172,6 @@ public void NewSceneLoaded()
//public void ReceiveIncomingCommands()
//{
//}

public void JoinRoom()
}
34 changes: 25 additions & 9 deletions enet/client/Assets/Scripts/Net/XNet/XNetPeer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,31 @@ public enum PeerState
public enum StatusCode
{
Connect,
}
}

// TODO
// 消息格式

// short - peerId
// byte - crcEnabled
// byte - udpCommandCount
// int - timeInt
// int - challenge
// - {
// NetCommand {
// CommndType

// TODO
// 消息格式
// short - peerId
// byte - crcEnabled
// byte - udpCommandCount
// int - timeInt
// int - challenge
// 以上内容 ENet/Lidgren 已经封装,需要关注的是 Payload

// Payload {
// MsgType
// OperationCode - 内部/外部
// ReturnCode
// DebugMessage
// Parameters - ParameterCode
// }
// }
// - }

public class XNetPeer
{
Expand Down Expand Up @@ -101,7 +117,7 @@ public virtual void HandleIncomingCommands()
while (incomingCommands.Count > 0)
{
XNetCommand cmd = incomingCommands.Dequeue();

}
}
}
Expand Down
8 changes: 8 additions & 0 deletions enet/client/Assets/Scripts/Net/XNet/XNetProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@

public class XNetProtocol
{
public static void Serialize()
{

}

public static void Deserialize()
{

}
}

0 comments on commit 1ac5a76

Please sign in to comment.