-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
304 additions
and
52 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_16_0.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
.idea/libraries/Maven__org_apache_logging_log4j_log4j_core_2_16_0.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import mmo.core.netty.NettyBootstrap; | ||
import network.NetworkFactory; | ||
|
||
import java.time.Duration; | ||
|
||
public class MMOServer { | ||
|
||
public static void main(String[] args) { | ||
NettyBootstrap bootstrap = new NettyBootstrap(new NetworkFactory(), 10000, Duration.ofSeconds(10)); | ||
bootstrap.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package network; | ||
|
||
import mmo.core.netty.ChannelAdapter; | ||
import mmo.core.session.Session; | ||
import mmo.core.session.SessionFactory; | ||
|
||
public class NetworkFactory implements SessionFactory { | ||
@Override | ||
public Session create(ChannelAdapter channel) { | ||
return new NetworkSession(channel); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package network; | ||
|
||
import mmo.core.netty.ChannelAdapter; | ||
import mmo.core.network.Channel; | ||
import mmo.core.session.Session; | ||
|
||
public class NetworkSession implements Session { | ||
private ChannelAdapter channel; | ||
|
||
public NetworkSession(ChannelAdapter channel) { | ||
this.channel = channel; | ||
} | ||
|
||
@Override | ||
public void close() { | ||
|
||
} | ||
|
||
@Override | ||
public void receive(Object msg) { | ||
|
||
} | ||
|
||
@Override | ||
public void inactive() { | ||
|
||
} | ||
|
||
@Override | ||
public ChannelAdapter channel() { | ||
return channel; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package mmo.core.netty.codec | ||
|
||
import io.netty.buffer.ByteBuf | ||
import io.netty.channel.ChannelHandlerContext | ||
import io.netty.handler.codec.ByteToMessageDecoder | ||
|
||
class MessageDecoder : ByteToMessageDecoder() { | ||
@Throws(Exception::class) | ||
override fun decode(ctx: ChannelHandlerContext, `in`: ByteBuf, out: List<Any>) { | ||
if (`in`.readableBytes() < 6) return | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package mmo.core.netty.codec | ||
|
||
import io.netty.buffer.ByteBuf | ||
import io.netty.channel.ChannelHandlerContext | ||
import io.netty.handler.codec.MessageToByteEncoder | ||
|
||
class MessageEncoder : MessageToByteEncoder<Any?>() { | ||
@Throws(Exception::class) | ||
override fun encode(channelHandlerContext: ChannelHandlerContext, o: Any?, byteBuf: ByteBuf) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.