Chatting Test
Server
- PacketGenerator\PDL.bat
- Server\Packet\PacketHandler.cs
- Server\Session\ClientSession.cs
- Server\Session\SessionManager.cs
- Server\GameRoom.cs
- Server\Program.cs
- ServerCore\Session.cs
- update for multi thread
Client
- DummyClient\Packet\PacketHandler.cs
- DummyClient\Program.cs
- DummyClient\ServerSession.cs
- DummyClient\SessionManager.cs
- PacketGenerator\PacketFormat.cs
- Server\GameRoom.cs
- Server\Program.cs
- ServerCore\Connector.cs
Test
- but, this lock machanism is not good
- all threads is locked except main thread, so they hier new thread again and again
Job Queue
- Server\Packet\PacketHandler.cs
- Server\Session\ClientSession.cs
- Server\GameRoom.cs
- ServerCore\JobQueue.cs
Test
Packet Merge-Sending
- DummyClient\PacketHandler.cs
- Server\Session\ClientSession.cs
- Server\GameRoom.cs
- Server\Program.cs
- ServerCore\Listener.cs
- ServerCore\SendBuffer.cs
- ServerCore\Session.cs
Test
Job Timer
- Server\JobTimer.cs
- Server\Program.cs
- ServerCore\PriorityQueue.cs
- PriorityQueue is on A* Maze Post
Test
Unity
System Link
- PacketGenerator\PacketFormat.cs
Span
andTryWriteBytes
is not applied in Unity
- DummyClient\Program.cs
- for Test, change connect count to 10
Unity
- copy files from
DummyClient/Packet
inServer
solution -
copy files from
ServerCore
inServer
solution and createNetwork
folder - Network\SendBuffer.cs
- NetworkManager.cs
- copy codes from
DummyClient\Program.cs
inServer
solution
- copy codes from
Test
Player
- Create Cylinder in Unity and change name to
Player
- Assets\Scripts\Packet\PacketHandler.cs
- when main thread is busy, then the job is continue excuted on other thread
-
but in Unity, other thread cannot be accessed on part which related with Game
- Assets\Scripts\PacketQueue.cs
- so make packet, and save this packet on queue
- and when unity main thread is working status, excute
- Assets\Scripts\NetworkManager.cs
- Create empty game object and change name to
NetworkManager
- drag and drop
NetworkManager.cs
toNetworkManager
- PacketGenerator\ClientPacketManager.cs
- for automatic, you should call
PacketHandler
fromClientPacketManager
- for automatic, you should edit
PacketFormet
to editClientPacketManager
fromServer
solution
- for automatic, you should call
- Assets\Scripts\Network\ServerSession.cs
- next step of
OnRecvPacket
- next step of
- NetworkManager.cs
- Assets\Scripts\Network\SendBuffer.cs
- NetworkManager.cs
Test
- execute
Server
fromServer
solution - execute Unity
Server
- PacketGenerator\PDL.xml
- we used
S_Chat
andC_Chat
for just chatting message - now, we will change for player(Enter, Leave and Move)
- we used
S_BroadcastEnterGame
is for broadcasting new player info to all playersC_LeaveGame
is for getting leave claim from clientS_BroadcastLeaveGame
is for broadcasting leaving player info to all playersS_PlayerList
is for sending all players info to new player andisSelf
is for checking it is playerselfC_Move
is for getting move claim from client and it dosen’t have playerId because it has already client session-
S_BroadcastMove
is for broadcasting player move to all players - PacketGenerator\PacketFormat.cs
- Server\Session\ClientSession.cs
- Server\GameRoom.cs
- Server\Packet\PacketHandler.cs
- DummyClient\Packet\PacketHandler.cs
- DummyClient\SessionManager.cs
Test
- execute
Server
ancDummyClient
fromServer
solution
Client
- Server\Packet\PacketHandler.cs
- Assets\Scripts\Packet\PacketHandler.cs
- Unity UI
- Create Plane and resize to (10, 10, 10) and set position to (0, 0, 0)
- Create Material in Assets and change name to
Floor
and Albedo(color) to blue
- Assets\Scripts\Player.cs
- this is for normal player
- Assets\Scripts\MyPlayer.cs
- this is for player you have
- Assets\Scripts\NetworkManager.cs
-
Assets\Scripts\PlayerManager.cs
- Create
Player
prefab
- Create
- Assets\Scripts\PacketQueue.cs
Test
- you can change number of DummyClient Session count